Ejemplo n.º 1
0
static void WlanGetInterfaceCapability_test(void)
{
    DWORD ret;
    PWLAN_INTERFACE_CAPABILITY pInterfaceCapability;

    /* invalid pReserved */
    ret = WlanGetInterfaceCapability((HANDLE) -1, &InterfaceGuid, (PVOID) 1, &pInterfaceCapability);
    ok(ret == ERROR_INVALID_PARAMETER, "expected failure\n");

    /* invalid InterfaceGuid */
    ret = WlanGetInterfaceCapability((HANDLE) -1, NULL, NULL, &pInterfaceCapability);
    ok(ret == ERROR_INVALID_PARAMETER, "expected failure\n");
    
    /* invalid pInterfaceCapability */
    ret = WlanGetInterfaceCapability((HANDLE) -1, &InterfaceGuid, NULL, NULL);
    ok(ret == ERROR_INVALID_PARAMETER, "expected failure\n");    
}
Ejemplo n.º 2
0
/*!
 *  \fn DWORD PMD::getInterfaceCapability()
 *  \ingroup win32backend
 *  \private
 *  \brief Retrieves the interface's capabilities.
 *  \retval ERROR_SUCCESS : WlanGetInterfaceCapability successful.
 *  \retval int : Error code from WlanGetInterfaceCapability.
 */
DWORD PMD::getInterfaceCapability () {
	
	PWLAN_INTERFACE_CAPABILITY pCapability = NULL;
	WLAN_INTERFACE_TYPE interfaceType;
	DWORD rtn;

	__try {
		
		rtn = WlanGetInterfaceCapability (
					hClientHandle,
					&pInterfaceList->InterfaceInfo[pInterfaceList->dwIndex].InterfaceGuid,
					NULL,
					&pCapability);
		
		if ( rtn != ERROR_SUCCESS ) {
			
			__leave;
		}
		interfaceType = pCapability->interfaceType;
		//printf ("%d\n", interfaceType); 
	}
	__finally
    {
    }

	/*
	 *	Cleanup process for local handles
	 */
	/*
	if (pCapability != NULL)
	{
		printf ("\pCapability not null\n");
		WlanFreeMemory(pCapability);
	}
	
	if (interfaceType != NULL)
	{
		printf ("\interfaceType not null\n");
		WlanFreeMemory((VOID*)&interfaceType);			/// segfault?
	}
	*/

	return rtn;
}