-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Win8 features requires allocation changes #63
Comments
Interesting. Last time Travis and I did test libusb0.sys and libusbK.sys (along with WinUSB) under Windows 10/11, using libusbK.dll. |
We only started using the "contract" features in commit 65f9a19, two days ago. And it is not like you will necessarily see any problem, Windows will just not guarantee anything and there might be "bug checks". |
Tormod, again you are spot on. Super annoying :-) 👍 However, unless the driver verifyer starts complaining, I am going to try to push these changes until we deprecate Windows 7 support. For now, it would seem it still works fine to use the old APIs. I guess MS probably made it backward compatible even though the docs suggest that it is not recommended. All my testing shows that it seems to work. But thanks again for staying on top of this. |
Additionally it is worth noticing that this is not a win8 feature, but actually is supported all the way back to Vista. The docs state:
|
Right. When linking in the usbdex.lib, these features will work on Vista/Win7 as well. So when I was saying "build for pre-win8" I should rather have said "build with pre-win8 SDK". Which for now unfortunately affects MinGW. If usbdex was a run-time library like usbd.sys, we could have worked this out for MinGW quite easily. But with the statically linked usbdex.lib it gets more hairy: MinGW doesn't ship any equivalent functions or library. And if linking in an usbdex.lib (I tried, I found one on a machine even without having the SDK on it [1]), it has a lot of new dependencies:
The __imp_USBD* names I think can be sorted out (maybe I made an error) but the __security_cookie and __GSHandlerCheck point to further libraries that need to be added. If they are not so many, I would still be interested in getting it to work, but it is a pity that it just won't build with MinGW out of the box any longer, and bits and pieces (probably with restrictions on redistribution) needs to be added. [1] from C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\km\x64 |
As soon as we start using USBD_CLIENT_CONTRACT_VERSION_602 in order to access USBD_HANDLE [1] and the new stuff in usbdex.lib, we also have to fulfill the "contract" [2], and use the Win8 USB allocation routines [3] etc.
[1] https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/usbdlib/nf-usbdlib-usbd_createhandle
[2] https://learn.microsoft.com/en-us/windows-hardware/drivers/usbcon/usb-client-driver-contract-in-windows-8
[3] https://learn.microsoft.com/en-us/windows-hardware/drivers/usbcon/how-to-add-xrb-support-for-client-drivers
The text was updated successfully, but these errors were encountered: