Re: FindFirstDevice Error 18 by Bruce
Bruce
Fri Apr 11 06:33:27 PDT 2008
This code works on a Windows CE 5.0 device. Disclaimer: I must have copied
it from someplace becuase I never use L"*" (I would have used TEXT("*") that
is my style) myself, but I don't recall where I found it.
void ListLoadedDrivers( )
{
HANDLE hDriver;
DeviceSearchType DeviceSearch;
DEVMGR_DEVICE_INFORMATION DeviceInfo;
DeviceSearch = DeviceSearchByLegacyName;
DeviceInfo.dwSize = sizeof( DEVMGR_DEVICE_INFORMATION );
hDriver = FindFirstDevice(DeviceSearch, L"*", &DeviceInfo);
if( hDriver != INVALID_HANDLE_VALUE )
{
do
{
RETAILMSG(1, (TEXT("Legacy %s Device Key %s Name %s BUS %s\n"),
DeviceInfo.szLegacyName,
DeviceInfo.szDeviceKey,
DeviceInfo.szDeviceName,
DeviceInfo.szBusName ));
} while( FindNextDevice( hDriver, &DeviceInfo ) );
FindClose( hDriver );
}
}
--
Bruce Eitman (eMVP)
Senior Engineer
beitman AT applieddata DOT net
Applied Data Systems
www.applieddata.net
An ISO 9001:2000 Registered Company
Microsoft WEP Gold-level Member
"Void" <Void@discussions.microsoft.com> wrote in message
news:4B5E9598-993D-416A-8541-8162D328BF8F@microsoft.com...
> Hi,
>
> Im trying to use the api function FindFirstDevice on a pda (WinCE 5 & 6).
> I
> have set the size of the device info structure, set the devicesearchtype
> to 3
> (search by guid) and passed a pointer to a guid. I have also tried
> seraching
> by name and passing a string "*".
>
> Every time a get the error code 18. Can anyone help me?
>