Ported code from SetupApi to CfgMgr32 #362

Merged
DJm00n merged 4 commits from remove_setup_api into master 2022-01-21 10:43:09 -06:00
DJm00n commented 2021-12-23 06:29:11 -06:00 (Migrated from github.com)
- Ported code from SetupApi to CfgMgr32. See: https://docs.microsoft.com/windows-hardware/drivers/install/porting-from-setupapi-to-cfgmgr32 - Use Unicode Windows API internally where possible. Windows operates natively in UTF-16 (WCHAR) so do we too.
Youw (Migrated from github.com) reviewed 2021-12-24 00:55:31 -06:00
Youw (Migrated from github.com) left a comment

Once you've removed dependency on SetupAPI - we should remove link dependency on it too: from CMakeLists, autotools and vsproj files

Once you've removed dependency on SetupAPI - we should remove link dependency on it too: from CMakeLists, autotools and vsproj files
@ -627,1 +619,4 @@
CONFIGRET cr;
wchar_t* device_interface_list = NULL;
DWORD len;
Youw (Migrated from github.com) commented 2021-12-24 00:42:39 -06:00

Sinse we are refactoring - lets get rid of this comment

Sinse we are refactoring - lets get rid of this comment
Youw commented 2021-12-24 00:56:34 -06:00 (Migrated from github.com)

This is nice refactoring, thanks.

This is nice refactoring, thanks.
Youw (Migrated from github.com) reviewed 2021-12-29 09:52:47 -06:00
Youw (Migrated from github.com) commented 2021-12-29 09:52:47 -06:00

None of it is relevant to the topic of the PR.
Please revert all the white-space changes and shuffling around of the order of declarations.

It makes unnecessary noise in the git history, which I often need to consult.

None of it is relevant to the topic of the PR. Please revert all the white-space changes and shuffling around of the order of declarations. It makes _unnecessary noise in the git history_, which I often need to consult.
Youw (Migrated from github.com) reviewed 2021-12-29 10:08:35 -06:00
Youw (Migrated from github.com) left a comment

Remove all of the link dependencies on cfgmgr32 and hid from all of build scripts.

Remove all of the link dependencies on `cfgmgr32` and `hid` from all of build scripts.
@ -4,7 +4,6 @@ add_library(hidapi_winapi
)
Youw (Migrated from github.com) commented 2021-12-29 10:06:04 -06:00

And with this change you will break the build for everywone who don't have WDK installed (which is a large amount of users).

To have a support of DDK builds, it has to be done properly, e.g. a CMake option, and link against hid.lib only when the user explicitly needs to.

And with this change you will break the build for everywone who don't have WDK installed (which is a large amount of users). To have a support of DDK builds, it has to be done properly, e.g. a CMake option, and link against `hid.lib` only when the user explicitly needs to.
@ -21,11 +21,17 @@
********************************************************/
Youw (Migrated from github.com) commented 2021-12-29 10:05:34 -06:00

whese are removed, not moved - is that mean we don't use any of stdlib.h/string.h anymore?

whese are removed, not moved - is that mean we don't use any of `stdlib.h`/`string.h` anymore?
Youw (Migrated from github.com) reviewed 2021-12-29 10:10:06 -06:00
@ -4,7 +4,6 @@ add_library(hidapi_winapi
)
Youw (Migrated from github.com) commented 2021-12-29 10:10:06 -06:00

Just to be clear: DDK support is out of scope of this PR.
And it would require a lot more than I've mentioned in the previous comment.

Just to be clear: DDK support is out of scope of this PR. And it would require a lot more than I've mentioned in the previous comment.
DJm00n (Migrated from github.com) reviewed 2021-12-29 11:24:48 -06:00
DJm00n (Migrated from github.com) commented 2021-12-29 11:24:48 -06:00

alright

alright
DJm00n (Migrated from github.com) reviewed 2021-12-29 11:25:41 -06:00
@ -21,11 +21,17 @@
********************************************************/
DJm00n (Migrated from github.com) commented 2021-12-29 11:25:41 -06:00

it seems. or these are included by some other headers. not sure how to check.

it seems. or these are included by some other headers. not sure how to check.
DJm00n (Migrated from github.com) reviewed 2021-12-29 11:52:26 -06:00
@ -4,7 +4,6 @@ add_library(hidapi_winapi
)
DJm00n (Migrated from github.com) commented 2021-12-29 11:52:26 -06:00

Alright. I'll do another PR for that.

Alright. I'll do another PR for that.
Youw (Migrated from github.com) reviewed 2021-12-29 15:53:45 -06:00
@ -21,11 +21,17 @@
********************************************************/
Youw (Migrated from github.com) commented 2021-12-29 15:53:45 -06:00

or these are included by some other headers

That is a time bomb. I've had a failed builds after a compiler/library upgrade, because some of the headers where implicitly included where they shouldn't.

> or these are included by some other headers That is a time bomb. I've had a failed builds after a compiler/library upgrade, because some of the headers where implicitly included where they shouldn't.
Youw (Migrated from github.com) reviewed 2022-01-08 04:33:13 -06:00
Youw (Migrated from github.com) left a comment

except for the potential leak - looks good

except for the potential leak - looks good
@ -588,136 +589,91 @@ static struct hid_device_info *hid_get_device_info(const char *path, HANDLE hand
}
Youw (Migrated from github.com) commented 2022-01-08 04:32:16 -06:00

device_interface_list leak here

`device_interface_list` leak here
Youw (Migrated from github.com) commented 2022-01-08 04:32:42 -06:00

check for non-NULL return

check for non-`NULL` return
Youw (Migrated from github.com) approved these changes 2022-01-09 06:33:04 -06:00
Sunbreak commented 2022-03-29 01:18:27 -05:00 (Migrated from github.com)

A little curious why porting SetupApi to CfgMgr32?

UWP will continue to be supported with "bug, reliability, and security fixes", but Windows App SDK is the "single path forward"

https://github.com/flutter/flutter/issues/14967#issuecomment-1033337989

A little curious why porting SetupApi to CfgMgr32? > UWP will continue to be supported with "bug, reliability, and security fixes", but Windows App SDK is the "single path forward" https://github.com/flutter/flutter/issues/14967#issuecomment-1033337989
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!362
No description provided.