-
Notifications
You must be signed in to change notification settings - Fork 354
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
Fix build issues for VStudio 2019 CE and installation failure of the wdm driver #251
Conversation
vadimgrn
commented
Jul 11, 2021
- Fix: there are build errors if use the latest Visual Studio 2019 Community Edition
- Improvement: more precise error mapping for urb status between Linux - Windows
- Fix: vhci wdm driver can't be used after installation (status is not OK in the Device Manager)
Old plugout was prone to incur BSOD when a very busy device is detached. Fiio device suffers from such the problem(see comment in cezanne#222). Indeed, there was no locking between vusb I/O and plugout. To resolve this issue, get/put for vusb has been introduced with a reference count.
Now, a port number is determined by vhci driver. Prior usbip.exe handovered a free port number chosen from port status array which were acquired from a vhci driver. This improvement is inteneded to support more complex port assignment rule such as usb 3.0 port assignment scheme of UDE.
Signed-off-by: vadimgrn <[email protected]>
Signed-off-by: vadimgrn <[email protected]>
Signed-off-by: vadimgrn <[email protected]>
Signed-off-by: vadimgrn <[email protected]>
PR(#251) reported that build error occurs with VS2019 CE 16.10.3. This issue seems to be related to VS2019 which changed stdio fuctions to inline. It's not clear why older versions don't have that problem.
This commit is from PR(#251). Slightly modified by cezanne.
Change vhub hw id to VID_1209&PID_8250 form as pointed out in #251.
pnp_query_id() in vhci has been improved refering #251. BusQueryDeviceSerialNumber is newly added.
Composite device identification is more clarified from #251. MSDN says the conditions of a composite. (See the below link) https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/enumeration-of-the-composite-parent-device
usbd flag translation for URB_SHORT_NOT_OK has been fixed as suggested in #251.
@vadimgrn : I've done to apply your PR into dev_temp branch. Please understand for selective pull from your commits. |
You've added at least one bug and removed most of my changes without explanation. But it is your repository and your rules. |
I'm sorry for that. For my late explanation for removal or modifications of your commits,
I believe to merge most of your great works, but please let me know about removed codes and the bug. |
driver/vhci/vhci_plugin.c
|
@vadimgrn : But my intention is that the current implementation changes codes less and is consistent with composite detection logic. Currently, there's no mechanism to update 0 num_configurations. I think that the current code would be fine because the else part is never called. usbpi.exe does not proceed to attach if it fails to get the descriptor. |
In such case the else section should be removed. If I were you, I would replace all lines in else section with NT_ASSERT(!"message" ). |
@vadimgrn : I agree. I'll do it later. |
PR(#251) reported that build error occurs with VS2019 CE 16.10.3. This issue seems to be related to VS2019 which changed stdio fuctions to inline. It's not clear why older versions don't have that problem.
This commit is from PR(#251). Slightly modified by cezanne.
Change vhub hw id to VID_1209&PID_8250 form as pointed out in #251.
pnp_query_id() in vhci has been improved refering #251. BusQueryDeviceSerialNumber is newly added.
Composite device identification is more clarified from #251. MSDN says the conditions of a composite. (See the below link) https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/enumeration-of-the-composite-parent-device
usbd flag translation for URB_SHORT_NOT_OK has been fixed as suggested in #251.
Old vhci gave unnecessary null check for descriptors in pluginfo which are statically allocated. Those unreachable codes are removed. See #251 (comment)