views:

20

answers:

0

I'm trying to locate the name of the 802.11 adapter to pass to SetDevicePower() and GetDevicePower(). I was going to use FindFirstDevice() with the PMCLASS_NDIS_MINIPORT guid to do this:

DEVMGR_DEVICE_INFORMATION di = { 0 };
di.dwSize = sizeof( DEVMGR_DEVICE_INFORMATION );

GUID IID_NdisMiniport = { 0x98C5250D, 0xC29A, 0x4985, { 0xae, 0x5f, 0xaf, 0xe5, 0x36, 0x7e, 0x50, 0x06 } };
HANDLE h = ::FindFirstDevice( DeviceSearchByGuid, &IID_NdisMiniport, &di );

Unfortunately, h becomes INVALID_HANDLE_VALUE and GetLastError() returns ERROR_NO_MORE_FILES "There are no more files."

But, if I do the same thing with the PMCLASS_GENERIC_DEVICE guid, it works, but gives me every power managed device in the system:

GUID IID_PM = DEVCLASS_POWER_MANAGER_GUID;
HANDLE h = ::FindFirstDevice( DeviceSearchByGuid, &IID_PM , &di );

How can I get JUST the 802.11 interface?

Thanks, PaulH


Edit: Actually, the results are:

PMCLASS_GENERIC_DEVICE

$device\IIC1 - IIC1:
$device\COM3 - COM3:
$device\DIK1 - DIK1:
$device\WAV1 - WAV1:
$device\BMN0 - BMN0:
$device\NDS0 - NDS0:
$device\SQM1 - SQM1:
$device\PWR1 - PWR1:
$device\DRL1 - DRL1:
$device\MPX1 - MPX1:
$device\MCR1 - MCR1:
$device\RIL1 - RIL1:
$device\END1 - END1:
$device\BKL1 - BKL1:
$device\NLD1 - NLD1:
$device\HCD1 - HCD1:
$device\KBD1 - KBD1:
$device\UPT1 - UPT1:

PMCLASS_NDIS_MINIPORT

ERROR_NO_MORE_FILES

PMCLASS_BLOCK_DEVICE

$device\DSK2 - DSK2:

None of which is the WiFi radio.