Re: IOCTL access to the HIDCLASS

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi Doron,

Thank you for your quick reply.
Our software calls "HidD_GetPreparsedData" API, when the software receives
the WM_DEVICECHANGE message. And our software enumerates the information of
attached/detached USB device.

But when we shutdown the PC, our software sometimes (very rare)freezes after
the calling of "HidD_GetPreparsedData".
"HidD_GetPreparsedData" did not return value.
I guessed that this occurred from HidD_xxx spec.
Do you know some information or reason why "HidD_GetPreparsedData", rarerly
(1/200-1/400), does not respond at shutdown?

"Doron Holan [MSFT]" wrote:

nope, none of the setupdi calls know about HIDCLASS. hidclass gives you the
VID/PID independent of setup

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Kaz" <Kaz@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:DD059E38-D049-4B41-B3C8-4902FE7B428B@xxxxxxxxxxxxxxxx
Hi,

On MSDN, I found a desciription that HidD_GetAttributes and
HidD_GetPreparsedData API will generate IOCTL for HIDCLASS.
Here, we can get the USB HID products VID/PID information also by calling
the SetupDiGetDeviceRegistryProperty API, not calling the
HidD_GetAttributes.
They also calls IOCTL for HIDCLASS or other drivers ?
I would like to know following code will generates IOCTL to HIDCLASS.

hDevInfo = SetupDiGetClassDevs( &guid, NULL, NULL, DIGCF_PRESENT |
DIGCF_DEVICEINTERFACE ); // 1)
if ( INVALID_HANDLE_VALUE == hDevInfo ) {
return FALSE;
}

for ( Loop = 0; ; Loop++ ){

devinfo.cbSize = sizeof( SP_DEVINFO_DATA );
devinfo.ClassGuid = guid ;
if ( !SetupDiEnumDeviceInfo( hDevInfo, Loop, &devinfo ) ){
SetupDiDestroyDeviceInfoList(hDevInfo);
break;
}

if ( !SetupDiGetDeviceRegistryProperty( hDevInfo, &devinfo,
SPDRP_HARDWAREID, &dwType, byBuffer, sizeof(byBuffer), &dwSize )){ break;
}
}
SetupDiDestroyDeviceInfoList(hDevInfo);



.



Relevant Pages

  • PC based robot design -- musings
    ... As I am working on the robot software. ... The task objects have only a few virtul API entry points, ... Boolean Init() ... Shutdown function is called. ...
    (comp.robotics.misc)
  • Re: WM_QUERYENDSESSION
    ... Add a handler for WM_ENDSESSION too. ... CTRL_SHUTDOWN_EVENT signal from system. ... you can play with SetProcessShutdownParameters API ... >> Try to call the API from your app and see if it works on your runtime. ...
    (microsoft.public.windowsxp.embedded)
  • Which Logoff/Shutdown API should I call?
    ... off or shutdown a computer. ... I need to write a script that would check for VMware's ... I've found four different API calls/messages and I really ... cancel or abort this call? ...
    (microsoft.public.windows.server.general)
  • Re: SetupDiGetDeviceRegistryProperty problems
    ... SetupDiGetDeviceRegistryProperty and not some other API? ... >a printer is connected to the USB port and send commands to it if so. ...
    (microsoft.public.development.device.drivers)
  • RE: How do we know when Windows goes to Standby mode?
    ... there is an API SetSuspendState which enable you switch ... For how to shutdown/Logoff the system, you may use API ... ExitWindows/ExitWindowsEx, however On windows 2000 and later system, if you ... There is also a sample to show you how to shutdown the system, ...
    (microsoft.public.dotnet.framework)