Add Windows-specific API to get device container ID #379

Merged
triplef merged 3 commits from windows-container-id into master 2022-02-25 02:53:00 -06:00
triplef commented 2022-02-09 05:47:12 -06:00 (Migrated from github.com)
As discussed in https://github.com/libusb/hidapi/discussions/252#discussioncomment-2089707.
Youw (Migrated from github.com) reviewed 2022-02-09 06:46:33 -06:00
Youw (Migrated from github.com) left a comment

Looks good

Looks good
@ -1048,6 +1048,44 @@ int HID_API_EXPORT_CALL HID_API_CALL hid_get_indexed_string(hid_device *dev, int
return 0;
Youw (Migrated from github.com) commented 2022-02-09 06:45:22 -06:00

call CM_Get_DevNode_PropertyW directly and pass guid - you'll avoid extra memory allocation/copy/free

call `CM_Get_DevNode_PropertyW` directly and pass `guid` - you'll avoid extra memory allocation/copy/free
@ -0,0 +1,54 @@
/*******************************************************
Youw (Migrated from github.com) commented 2022-02-09 06:32:02 -06:00
		int HID_API_EXPORT_CALL hid_winapi_get_container_id(hid_device *dev, GUID *container_id);
```suggestion int HID_API_EXPORT_CALL hid_winapi_get_container_id(hid_device *dev, GUID *container_id); ```
@ -0,0 +32,4 @@
extern "C" {
#endif
/** @brief Get the container ID for a HID device.
Youw (Migrated from github.com) commented 2022-02-09 06:46:27 -06:00

Add mode description/details. Make a reference to DEVPKEY_Device_ContainerId

Add mode description/details. Make a reference to `DEVPKEY_Device_ContainerId`
@ -0,0 +40,4 @@
@ingroup API
@param dev A device handle returned from hid_open().
@param guid The device's container ID on return.
Youw (Migrated from github.com) commented 2022-02-09 06:31:51 -06:00
			@param guid The device's container ID on return.

			@note Make sure to include `<Windows.h>` before including `hidapi_winapi.h`.
```suggestion @param guid The device's container ID on return. @note Make sure to include `<Windows.h>` before including `hidapi_winapi.h`. ```
triplef (Migrated from github.com) reviewed 2022-02-10 06:08:29 -06:00
@ -0,0 +40,4 @@
@ingroup API
@param dev A device handle returned from hid_open().
@param guid The device's container ID on return.
triplef (Migrated from github.com) commented 2022-02-10 06:08:29 -06:00

I included guiddef.h, which is all that should be needed to include hidapi_winapi.h.

I included `guiddef.h`, which is all that should be needed to include `hidapi_winapi.h`.
Youw (Migrated from github.com) approved these changes 2022-02-10 07:10:10 -06:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-libusb/hidapi!379
No description provided.