Author Topic: When is winusb sufficient such that one does not have to write new drivers?  (Read 9916 times)

matrixofdynamism

  • Member
  • ***
  • Posts: 12
If the WinUSB provides capability to read/write a USB device of any class and configuration then why would anyone want to write new drivers?

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
All USB device drivers make use of the lower-level USB drivers included with OSes, but upper driver layer(s) can support needs or features of a specific device or class of devices. For example:

Improved performance, optimized for a particular device/purpose.

Supporting specific device features or capabilities.

WinUSB is a solution when you have a device that doesn't have or need the benefits of a function-specific driver - imagine how difficult it would be to use WinUSB to detect mouse movements or read a file from a drive.

 




matrixofdynamism

  • Member
  • ***
  • Posts: 12
WA, response from the great Jan Axelson herself. I am humbled. Thanks.  :)

It seems then that I have to use this WinUSB first to understand its limitations besides it not supporting isochonous transmission.

Coming to the examples you have given, provided that I can read data from the mouse related to X and Y movement, why then should it be difficult to detect mouse movement using WinUSB? I mean I can just compare the new value with the old value right?

As for reading files, I agree with you that it will be hard. However, assuming that I can read specific sectors from a mass storage device and implement lets say a FAT16 capability into my host program on the PC side by taking benefit of being able to randomly access sectors in the mass storage device, I think I should be able to read files.

I understand that vendor specific user mode driver may give me functions that I can call to make something happen without knowing details about what chunks of data go back and forth. However, it should still be possible with WinUSB.

I will however, spend some more time trying to read and understand why we may need to write drivers in Kernel Mode or User Mode and how we know how to write them.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Yes, of course you could read mouse movements with WinUSB if you assigned the driver to the device, but the response time would be very slow compared to using the HID-class and mouse support built into Windows. Same for mass storage. Also, why reinvent the device-specific code? It's more efficient for the OS to provide support for common functions for all applications to use.

The current version of WinUSB supports isochronous transfers.