acessing dbcc_name from DEV_BROADCAST_DEVICEINTERFACE win32 programming

前端 未结 2 980
不知归路
不知归路 2021-01-15 07:14

I have some c code with me which detects the usb cable removal and insertion.

I found one structure DEV_BROADCAST_DEVICEINTERFACE which is having

相关标签:
2条回答
  • 2021-01-15 07:38

    You need to cast a DEV_BROADCAST_HEADER* to a DEV_BROADCAST_DEVICEINTERFACE*. You are allowed to do so if and only if dbch_devicetype==DBT_DEVTYP_DEVICEINTERFACE.

    You getDEV_BROADCAST_HEADER* as the LPARAM of WM_DEVICECHANGE.

    To do something useful with dbcc_name, you have to pass it to SetupDiOpenDeviceInterface(). This will give you a SP_DEVICE_INTERFACE_DATA with one SP_DEVINFO_DATA. You can then call functions like SetupDiGetDeviceRegistryProperty to learn more about the device.

    0 讨论(0)
  • 2021-01-15 08:05

    Please notice the CodeSet. If it is Unicode. The data is \\0......

    0 讨论(0)
提交回复
热议问题