USB_UDE_Sample icon indicating copy to clipboard operation
USB_UDE_Sample copied to clipboard

Interest in extending UDEFX2 with extra WinUSB descriptors to get rid of hostudehostude driver?

Open forderud opened this issue 10 months ago • 0 comments

I haven't thought this proposal fully through, so I'm not sure if it's realistic. Stil, it's possible to extend USB devices with custom Microsoft OS Descriptors descriptors to make them a driver-less WinUSB device. This is similar to how HID devices also doesn't require custom drivers. Extending UDEFX2 this way would eliminate the need for the host-side "hostude" driver, so that the repo can focus exclusively on the UDEFX2 virtual USB device driver.

I can help preparing pull request(s) on the migration if there's interest. The migration can probably be done gradually, with a first step that converts "hostude" into a INF-only driver without any code, and a second step to also remove the INF file.

Impact

This would break existing DeviceIoControl, calls in "hostudetest.exe", since the receiving "hostude" driver would no longer be present. I'm assuming that ReadFile and WriteFile calls won't be affected though, since they are usually forwarded to the USB device and not processed by the driver.

The following DeviceIoControl calls will need to be updated:

  • IOCTL_OSRUSBFX2_GET_CONFIG_DESCRIPTOR: Can probably be replaced by WinUsb_GetDescriptor with DescriptorType=USB_CONFIGURATION_DESCRIPTOR_TYPE to retrieve the USB descriptor(s) the standard way.
  • IOCTL_OSRUSBFX2_RESET_DEVICE: Doesn't seem to be in use anywhere.
  • IOCTL_OSRUSBFX2_GET_INTERRUPT_MESSAGE: Can probably be replaced by WinUsb_ReadPipe from the interrupt endpoint.

Documentation

WinUSB device

forderud avatar Apr 04 '24 10:04 forderud