You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On POSIX systems, the UsbPortInfo returns custom Manufacturer and Product name linked to iVendor and iProduct attributes from Device Descriptor. In contrast, in Windows:
The Manufacturer and Product name information obtained from Windows is completely different from POSIX. If this information is used for device detection, the code will not be portable.
2. Improvement request
In Windows, the information must be obtained via DeviceIoControl. In a similar way to the lswinusb – a Rust library for listing USB Descriptors on Windows.
Workaround
This is a workaround that was developed using the lswinsub project, but using the winapi crate instead of the windows or windows-sys crate:
It can be tested using the iocontrol feature. Example:
cargo run --features iocontrol --example list_ports
But it is not a solution developed by someone who has experience with Rust and the Win32 API. This needs to be reviewed and/ or rewritten by someone with more experience.
You are absolutely right. I would expect to get the same information on systems where the port enumeration returns anything at all.
Than you very much for pointing this out and your comprehensive research! My schedule is tight these days. But it looks like you are already working on implementing this and this looks good skimming through it. Awesome! :) Would you mind filing a PR when this works for you?
Than you very much for pointing this out and your comprehensive research! My schedule is tight these days. But it looks like you are already working on implementing this and this looks good skimming through it. Awesome! :)
Thank you for the feedback.
Would you mind filing a PR when this works for you?
No problem. I will file a PR when I complete some tests.
Example:
The tests I had performed worked under the following condition:
But they failed under the following condition:
I have made new changes to the iocontrol feature to fix this issue, but they haven't been tested yet.
1. Issue description
On POSIX systems, the UsbPortInfo returns custom Manufacturer and Product name linked to iVendor and iProduct attributes from Device Descriptor. In contrast, in Windows:
This is causing the following issue:
2. Improvement request
In Windows, the information must be obtained via DeviceIoControl. In a similar way to the lswinusb – a Rust library for listing USB Descriptors on Windows.
Workaround
This is a workaround that was developed using the lswinsub project, but using the winapi crate instead of the windows or windows-sys crate:
It can be tested using the
iocontrol
feature. Example:cargo run --features iocontrol --example list_ports
But it is not a solution developed by someone who has experience with Rust and the Win32 API. This needs to be reviewed and/ or rewritten by someone with more experience.
3. Others
Additional information:
The text was updated successfully, but these errors were encountered: