Re: WinUSB Microsoft OS descriptors

Xiaofan Chen <[email protected]> Fri, 24 Apr 2015 09:36:28 +0800
Newsgroups gmane.comp.lib.libusb.devel.windows
Message-ID <CAGjSPUCNuTGe=MqQD55mcXSDzhXj33Qc7tbeSffj7wHcD-zcsA@mail.gmail.com>
On Thu, Apr 23, 2015 at 3:00 PM, Simon Thiebaut
<[email protected]> wrote:
> The PC app USB part is written with libusb, as the app is intended to be
> cross platform, though it is first developed under Windows.
> The first version of the board firmware implements the HID class, but this
> is too limiting for the requirements of the app, and I want to change the
> class.

Yes that is a good move.

> Therefore I was looking for a generic USB device driver that would
> automatically loads when the device is plugged in.
> I have to do a choice between WinUSB or libusbK drivers.

In that case, WinUSB is a better choice since it is part of Windows
since Windows Vista (not XP).

> After a few researches on WinUSB, I found this:
> https://msdn.microsoft.com/en-us/library/windows/hardware/hh450799%28v=vs.85%29.aspx

Some more references here.
https://github.com/pbatard/libwdi/wiki/WCID-Devices

> That states that a WinUSB generic device must have in its firmware specific
> Microsoft OS Descriptors to work.

Take note "WinUSB Device" is not equal to device using WinUSB driver.
Generic USB Device can use generic USB driver like WinUSB or libusbK or
libusb0.sys. However, you need to have a driver package (an inf file and
other associated files) in order for Windows to install the driver for you.

Zadig and libusbK driver installation Wizard help the user to install the
driver. But it is still an extra process. So some applications integrate
the driver installation as part of the initial application installation process
(usually they will advise the user not to insert the device before
the installation).

WCID or "WinUSB Device" makes Windows loads the WinUSB driver
automatically for you, And it should work for Windows 8 and above right
out of the box. For Windows 7 (and maybe Windows Vista?), an Windows
update provides the same functionality.

> My question is: does libusbK have such requirements ? Will I have to add
> specific descriptors to make my device work ? Or nothing special is required
> (other than configuring properly the existing common descriptors) ?
> The point is I do not wish to embed useless and not generic code in the
> firmware if there a is generic enough PC driver (for the Windows portage)...

WinUSB/libusbK.sys/libusb0.sys (and Cypress USB driver, etc) are all
generic USB driver you can use. But WinUSB is probably the easiest to
use. So it is

Zadig provides a way to get libusb0.sys or libusbK.sys work similar to
WinUSB after one-time installation (to install a generic inf file for
libusbk.sys
and libusb0.sys to automatically install the driver for device with a specific
Microsoft OS Descriptor). But that is really as convenient as WCID since
it is part of Windows.


-- 
Xiaofan

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y