0
votes

How can I get USB device manufacturer name through Win32 API.

I am looking for an example in Win32 API, not in .Net.

USB Device manufacturer name is embedded in USB descriptor.

Thanks

3
For USB HID devices you use the function HidD_GetManufacturerString from the Windows DDK.harper
Have you tried looking at SetupAPI?kichik

3 Answers

1
votes

hi I think WMI can give the all information which u need from the windows just fire query against the API it return all info available in the machine to you

http://msdn.microsoft.com/en-us/library/ms186146%28VS.80%29.aspx

1
votes

You can obtain manufacturer name of the device by using "SetupDiGetDeviceRegistryProperty" winapi.

Please refer the MSDN link for more details.

Example code :

if ( SetupDiGetDeviceRegistryProperty(hDevInfo, &spDevInfoData,SPDRP_MFG, &DataT, (PBYTE)bufManufact, sizeof(bufManufact), &nSize) ) 
{
} 
else 
{
    _tcscpy_s(bufManufact,sizeof(bufManufact)/sizeof(TCHAR),_T("Unknown"));
}
0
votes

Run the USBView sample which comes with the WDK to get the manufacturer name and other information about the USB devices.