hidapi_cfgmgr32.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*******************************************************
  2. HIDAPI - Multi-Platform library for
  3. communication with HID devices.
  4. libusb/hidapi Team
  5. Copyright 2022, All Rights Reserved.
  6. At the discretion of the user of this library,
  7. this software may be licensed under the terms of the
  8. GNU General Public License v3, a BSD-Style license, or the
  9. original HIDAPI license as outlined in the LICENSE.txt,
  10. LICENSE-gpl3.txt, LICENSE-bsd.txt, and LICENSE-orig.txt
  11. files located at the root of the source distribution.
  12. These files may also be found in the public source
  13. code repository located at:
  14. https://github.com/libusb/hidapi .
  15. ********************************************************/
  16. #ifndef HIDAPI_CFGMGR32_H
  17. #define HIDAPI_CFGMGR32_H
  18. #ifdef HIDAPI_USE_DDK
  19. #include <cfgmgr32.h>
  20. #include <initguid.h>
  21. #include <devpkey.h>
  22. #include <propkey.h>
  23. #else
  24. /* This part of the header mimics cfgmgr32.h,
  25. but only what is used by HIDAPI */
  26. #include <initguid.h>
  27. #include <devpropdef.h>
  28. #include <propkeydef.h>
  29. typedef DWORD RETURN_TYPE;
  30. typedef RETURN_TYPE CONFIGRET;
  31. typedef DWORD DEVNODE, DEVINST;
  32. typedef DEVNODE* PDEVNODE, * PDEVINST;
  33. typedef WCHAR* DEVNODEID_W, * DEVINSTID_W;
  34. #define CR_SUCCESS (0x00000000)
  35. #define CR_BUFFER_SMALL (0x0000001A)
  36. #define CR_FAILURE (0x00000013)
  37. #define CM_LOCATE_DEVNODE_NORMAL 0x00000000
  38. #define CM_GET_DEVICE_INTERFACE_LIST_PRESENT (0x00000000)
  39. typedef CONFIGRET(__stdcall* CM_Locate_DevNodeW_)(PDEVINST pdnDevInst, DEVINSTID_W pDeviceID, ULONG ulFlags);
  40. typedef CONFIGRET(__stdcall* CM_Get_Parent_)(PDEVINST pdnDevInst, DEVINST dnDevInst, ULONG ulFlags);
  41. typedef CONFIGRET(__stdcall* CM_Get_DevNode_PropertyW_)(DEVINST dnDevInst, CONST DEVPROPKEY* PropertyKey, DEVPROPTYPE* PropertyType, PBYTE PropertyBuffer, PULONG PropertyBufferSize, ULONG ulFlags);
  42. typedef CONFIGRET(__stdcall* CM_Get_Device_Interface_PropertyW_)(LPCWSTR pszDeviceInterface, CONST DEVPROPKEY* PropertyKey, DEVPROPTYPE* PropertyType, PBYTE PropertyBuffer, PULONG PropertyBufferSize, ULONG ulFlags);
  43. typedef CONFIGRET(__stdcall* CM_Get_Device_Interface_List_SizeW_)(PULONG pulLen, LPGUID InterfaceClassGuid, DEVINSTID_W pDeviceID, ULONG ulFlags);
  44. typedef CONFIGRET(__stdcall* CM_Get_Device_Interface_ListW_)(LPGUID InterfaceClassGuid, DEVINSTID_W pDeviceID, PZZWSTR Buffer, ULONG BufferLen, ULONG ulFlags);
  45. // from devpkey.h
  46. DEFINE_DEVPROPKEY(DEVPKEY_NAME, 0xb725f130, 0x47ef, 0x101a, 0xa5, 0xf1, 0x02, 0x60, 0x8c, 0x9e, 0xeb, 0xac, 10); // DEVPROP_TYPE_STRING
  47. DEFINE_DEVPROPKEY(DEVPKEY_Device_Manufacturer, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 13); // DEVPROP_TYPE_STRING
  48. DEFINE_DEVPROPKEY(DEVPKEY_Device_InstanceId, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 256); // DEVPROP_TYPE_STRING
  49. DEFINE_DEVPROPKEY(DEVPKEY_Device_HardwareIds, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 3); // DEVPROP_TYPE_STRING_LIST
  50. DEFINE_DEVPROPKEY(DEVPKEY_Device_CompatibleIds, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 4); // DEVPROP_TYPE_STRING_LIST
  51. DEFINE_DEVPROPKEY(DEVPKEY_Device_ContainerId, 0x8c7ed206, 0x3f8a, 0x4827, 0xb3, 0xab, 0xae, 0x9e, 0x1f, 0xae, 0xfc, 0x6c, 2); // DEVPROP_TYPE_GUID
  52. // from propkey.h
  53. DEFINE_PROPERTYKEY(PKEY_DeviceInterface_Bluetooth_DeviceAddress, 0x2BD67D8B, 0x8BEB, 0x48D5, 0x87, 0xE0, 0x6C, 0xDA, 0x34, 0x28, 0x04, 0x0A, 1); // DEVPROP_TYPE_STRING
  54. DEFINE_PROPERTYKEY(PKEY_DeviceInterface_Bluetooth_Manufacturer, 0x2BD67D8B, 0x8BEB, 0x48D5, 0x87, 0xE0, 0x6C, 0xDA, 0x34, 0x28, 0x04, 0x0A, 4); // DEVPROP_TYPE_STRING
  55. DEFINE_PROPERTYKEY(PKEY_DeviceInterface_Bluetooth_ModelNumber, 0x2BD67D8B, 0x8BEB, 0x48D5, 0x87, 0xE0, 0x6C, 0xDA, 0x34, 0x28, 0x04, 0x0A, 5); // DEVPROP_TYPE_STRING
  56. #endif
  57. #endif /* HIDAPI_CFGMGR32_H */