Hi,
did you read the following line in the documentation:
"To return devices only for a specific device setup class,
do not set DIGCF_ALLCLASSES, and use ClassGuid to
supply the GUID of the device setup class."
"Do NOT set DIGCF_ALLCLASSES",...at first try it without
this Flag,...then we will see,...
I have something that possibly can aid you. Drop
me a few lines if you like. I wont write about it here
because it would look like house advertising, i dont
want that:
Regards
Kerem
--
--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Latest Project:
http://www.pro-it-education.de/software/deviceremover
Latest Open-Source Projects:
http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
"Gerryson" <> schrieb im Newsbeitrag
news:250D651A-8C97-4835-9BFF-...
> I use SetupDiGetClassDevs to retrieve how many usb devices are present ,
> the
> code is as follows:
> //==================================================
> DWORD dwFlag = DIGCF_ALLCLASSES | DIGCF_PRESENT;
>
> HDEVINFO hDevInfo = SetupDiGetClassDevs(NULL, "USB", NULL, dwFlag);
>
> if( hDevInfo == INVALID_HANDLE_VALUE )
> {
> WriteLog("Gerry:hDevInfo = INVALID_HANDLE_VALUE , Last Error:%d",
> GetLastError());
> return 0;
> }
> .
> .
> .
> .
> .
>
> //=========================================
> The code above runs ok when called from normal applications, but
> when this code is called from winlogon.exe before any user log on,
> SetupDiGetClassDevs failed with error code 13, I really don't know what's
> the difference and why this happens, please any one tell me how to solve
> this.