SetupDiGetDeviceProperty usage example
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Can anybody provide me with an example of using SetupDiGetDeviceProperty ? 回答1: The following code #include #include // for GUID_DEVCLASS_CDROM etc #include #include // for MAX_DEVICE_ID_LEN, CM_Get_Parent and CM_Get_Device_ID #define INITGUID #include #include //#include "c:\WinDDK\7600.16385.1\inc\api\devpkey.h" // include DEVPKEY_Device_BusReportedDeviceDesc from WinDDK\7600.16385.1\inc\api\devpropdef.h #ifdef DEFINE_DEVPROPKEY #undef DEFINE_DEVPROPKEY #endif #ifdef INITGUID #define DEFINE_DEVPROPKEY(name, l, w1, w2, b1, b2, b3, b4, b5,