Imran
Imran

Reputation: 103

USB Device manufacturer name in Windows API

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

Upvotes: 0

Views: 2844

Answers (3)

Arun kumar Kalaiarasan
Arun kumar Kalaiarasan

Reputation: 386

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"));
}

Upvotes: 1

Imran
Imran

Reputation: 103

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

Upvotes: 0

JSJ
JSJ

Reputation: 5691

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

Upvotes: 2

Related Questions