Support custom driver for all VIDs and PIDs.

Hello All,

I am trying to install my custom usb driver on windows 64 bit platform which suppports all USB Storage devices.

for the installation, I have made the changes in my setup information (inf) file by adding VID and PID for each device for which I want to install the driver. The signature in the inf file is something like this.

%USBDEVICE.DeviceDesc%=USBDEVICE_Inst, USB\VID_XXXX&PID_XXXX

This is working as expected.

But the problem with this approach is each time for a new device, I have to add VID and PID entry in my inf file. Is there any way I could modify my inf file which supports my driver installation for all UAS storage devices?

when I looked at the uaspstor inf file (which is a windows driver for UAS Storage devices), I saw the model section configured below like this.
%Generic.DeviceDesc%=UASPort_Install_Control, USB\Class_08&SubClass_06&Prot_62

Can I use this entry “USB\Class_08&SubClass_06&Prot_62” as a generic means for my driver to install for all UAS devices instead of installing for a particular device with VID and PID, will this work?

Any help would be appreciated.

Per the “regulations”, non-Microsoft drivers are not allowed to match standard USB classes using the “USB\Class_xxx” syntax. However, you can certainly install yourself as a “class” filter, assuming you can find a GUID for the device class that applies to all of your devices of interest. That’s a pretty easy path. Technically, you don’t even need an INF file – just a couple of registry entries – although an INF is a common way to install one.

Hi Tim,

Thanks for your reply.

As I understand, if there is a class GUID which is common to all of my devices of interest, I can use that to install my driver without having to depend on VID and PID.

Is there any source which provides more information on this? like any sample inf file which I can refer to? or any articles or documentation on the same?

Any information on this would be helpful to proceed further.

Technically kbfilter.sys is both a device filter sample and a class filter sample, but it only documents the class filter install process in a comment here: https://github.com/microsoft/Windows-driver-samples/blob/f28183b782d1f113492f6eea424172f2addaf565/input/kbfiltr/sys/kbfiltr.c#L26

The devcon sample illustrates how to install a class filter here: https://github.com/microsoft/Windows-driver-samples/blob/f28183b782d1f113492f6eea424172f2addaf565/setup/devcon/cmds.cpp#L1688

Hi Mark. thanks for your input.

I had one question here. What I am trying to implement here is a function driver for an UAS Storage device and not a filter driver.

I am still not sure whether we can install our function driver as an Upper or lower class filter driver.

When I see the windows UAS Storage driver (uaspstor.inf), this driver is also a function driver. but windows is able to load this driver when it encounters any USB Device with UAS protocol supported, attached to the system.

I wanted a similar functionality in my function driver as well. To install my driver upon detection of any SCSI Device. we have a class GUID available for all our devices of interest. is there a way to make a custom function driver install for a device class??

I also saw one inf file where they are using compatible IDS of a hardware to install driver. will it help for my use case?

I am guessing that you want to install your driver for all usb uas devices. If so then just make it an upper filter for USB\Class_08&SubClass_06&Prot_62. That would resolve your original problem.

Hi Mark.

As I understand, the above approach which you suggest would result in my driver placed as an upper filter driver above the actual UAS function driver which windows provides. Please correct me if I am wrong here.

But my driver is a standalone function driver which already has all the functionalities of windows UAS driver along with additional features and functionalities. So this driver is expected to be independent and not integrated with other drivers as a filter driver.

Without configuring as a filter driver, is there any way I can configure my inf file, to install my driver for all UAS devices?

In this article,
https://stackoverflow.com/questions/43760892/inf-file-without-pid-for-multiple-products-under-same-vid
they have suggested to check for compatible IDs for an usb device. any idea on whether this approach works?

I my driver inf file, I wanted “USB\Class_08&SubClass_06&Prot_62” this string to be added in inf file. But as Tim Suggested earlier, non Microsoft drivers are not allowed to match standard usb drivers. So I was looking for an alternative solution.

You can match on the same compatible ID in your INF and then the normal INF ranking rules apply. But Microsoft will never sign the INF. Are you planning on using this driver in a private environment or broad distribution? There really is no other way to install your driver on all devices with an INF outside of a compat id match.

I am planning to use my driver on a private environment. not on a broad distribution scale.

Will try to use compatible ID approach then. thanks for your suggestion.

Personally I would rethink your design. This part:

But my driver is a standalone function driver which already has all the functionalities of windows UAS driver along with additional features and functionalities. So this driver is expected to be independent and not integrated with other drivers as a filter driver.

An upper filter could provide the ‘additional features and functionalities.’.