WinUSB.sys in Vista

Dear Team,

I modified osrfx2 umdf sample driver to the custom device and loaded
successfully on XP.

When I try to load the same driver in Vista, the installation fails and
setupapi.dev.log points to the following error:

"Add Service: Binary ‘C:\Windows\system32\DRIVERS\WinUSB.sys’ for service
‘WinUsb’ is not present.

!!! inf: Error 0xe0000217: A service installation section in
this INF is invalid.

!!! dvi: Error while installing services."

I found winusb.sys in XP drivers folder but in Vista, it is located in
DriverStore.

Any pointer to the modifications required in the inf file to load the driver
in vista.

The below is the inf file:


myosrfx2.inf

[Version]
Signature = “$CHICAGO$”

Class = Sample

ClassGuid = {78A1C341-4539-11d3-B88D-00C04FAD5171}

Provider = %VENDOR%

DriverVer = 12/13/2007,6.0.6000.16549

[Manufacturer]

%VENDOR%=Vendor, NTx86

; For XP and later

[Vendor.NTx86]

%MyUsbDeviceName% = MyUsb_Install, USB\VID_xxxx&PID_xxxx&MI_01 ;composite

[ClassInstall32]

AddReg=SampleClass_RegistryAdd

[SampleClass_RegistryAdd]

HKR,%ClassName%

HKR,Icon,“-20”

[SourceDisksFiles]

WUDFOSRFx2UsbBulk.dll = 1

WudfUpdate_01005.dll = 1

WdfCoInstaller01005.dll = 1

WinUsbCoinstaller.dll = 1

[SourceDisksNames]

1 = %MediaDescription%

[MyUsb_Install.NT]

CopyFiles = UMDriverCopy

Needs = WINUSB.NT ; Run the CopyFiles & AddReg directives for WinUsb.INF

[MyUsb_Install.NT.hw]

AddReg=MyUsb_Device_AddReg

[MyUsb_Install.NT.Services]

AddService=WUDFRd,0x000001fa,WUDFRD_ServiceInstall ; service for the device

AddService=WinUsb,0x000001f8,WinUsb_ServiceInstall ; this service is
installed because its a filter.

[MyUsb_Install.NT.Wdf]

KmdfService = WINUSB, WinUsb_Install

UmdfDispatcher = WinUsb

UmdfService = WUDFMyUsb, WUDFMyUsb_Install

UmdfServiceOrder = WUDFMyUsb

[NGLMUsb_Install.NT.CoInstallers]

AddReg = CoInstallers_AddReg

CopyFiles = CoInstallers_CopyFiles

[WinUsb_Install]

KmdfLibraryVersion = 1.5

[WUDFMyUsb_Install]

UmdfLibraryVersion = 1.5.0

DriverCLSID = “{0865b2b0-6b73-428f-a3ea-2172832d6bfc}”

ServiceBinary = “%12%\UMDF\WUDFMyUsbBulk.dll”

[MyUsb_Device_AddReg]

HKR,“LowerFilters”,0x00010008,“WinUsb” ; FLG_ADDREG_TYPE_MULTI_SZ |
FLG_ADDREG_APPEND

[WUDFRD_ServiceInstall]

DisplayName = %WudfRdDisplayName%

ServiceType = 1

StartType = 3

ErrorControl = 1

ServiceBinary = %12%\WUDFRd.sys

LoadOrderGroup = Base

[WinUsb_ServiceInstall]

DisplayName = %WinUsb_SvcDesc%

ServiceType = 1

StartType = 3

ErrorControl = 1

ServiceBinary = %12%\WinUSB.sys

[CoInstallers_AddReg]

HKR,CoInstallers32,0x00010000,“WudfUpdate_01005.dll”, "
WinUsbCoinstaller.dll", “WdfCoInstaller01005.dll,WdfCoInstaller”

[CoInstallers_CopyFiles]

WudfUpdate_01005.dll

WdfCoInstaller01005.dll

WinUsbCoinstaller.dll

[DestinationDirs]

UMDriverCopy = 12,UMDF ; copy to drivers UMDF

CoInstallers_CopyFiles = 11

[UMDriverCopy]

WUDFMyUsbBulk.dll

[Strings]

VENDOR = “VENDOR”

MediaDescription = “OSR USB User Mode Driver”

ClassName = “OSR Class”

WudfRdDisplayName = “User-mode Driver Framework Reflector”

MyUsbDeviceName = “OSR Fx2 Device”

WinUsb_SvcDesc = “WinUSB Driver”


Bhaskar wrote:

I modified osrfx2 umdf sample driver to the custom device and loaded
successfully on XP.
When I try to load the same driver in Vista, the installation fails
and setupapi.dev.log points to the following error:

"Add Service: Binary ‘C:\Windows\system32\DRIVERS\WinUSB.sys’ for
service ‘WinUsb’ is not present.

!!! inf: Error 0xe0000217: A service installation section in
this INF is invalid.

!!! dvi: Error while installing services."

I found winusb.sys in XP drivers folder but in Vista, it is located in
DriverStore.

…which means it hasn’t been installed yet.

Any pointer to the modifications required in the inf file to load the
driver in vista.

The below is the inf file:

[MyUsb_Install.NT]

CopyFiles = UMDriverCopy

Needs = WINUSB.NT ; Run the CopyFiles & AddReg directives for WinUsb.INF

The problem here is that you are missing
Include = winusb.inf
in this section. The “Needs” statement needs to know which INF files to
search. Without that, it won’t inherit the CopyFiles statement for
WinUSB.sys.

The “Include” is present in all the samples, so you must have deleted it
somehow.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Thanks for the absolute pointer. I understood that Include line is missing
in the inf file.

Yes it was present in the original sample but I deleted the line long back
while working with chkinf tool to overcome some warnings - over ambitious
:slight_smile:

I included the line and the driver is getting loaded normally.

Also I found the following link useful for those who want to load same
drivers in XP as well as Vista:

http://blogs.msdn.com/peterwie/archive/2007/01/10/fixing-the-umdf-usb-samples-to-install-both-on-xp-vista.aspx

Regards.