C++ – How to retrieve USB device interface GUID

cusbwinapiwindows

To get the GUID for a HID device, I know I can do this:

GUID myHidGuid;
memset(&myHidGuid, 0, sizeof(GUID)); //allocate
HidD_GetHidGuid(&myHidGuid); //define the HID GUID

Is there a function similar to HidD_GetHidGuid() that will give me the GUID for other device classes?

I am trying to determine if a USB wireless network adaptor is attached. I believe I want GUID_DEVINTERFACE_NET but I don't know how to retrieve it.

Best Answer

I don't think you have something similar, these ClassGuids are decided by Microsoft the list is here:

http://msdn.microsoft.com/en-us/library/windows/hardware/ff553426(v=vs.85).aspx

http://msdn.microsoft.com/en-us/library/windows/hardware/ff553428(v=vs.85).aspx

A good example would be this CodeProject article.