Installing WinUSB on XP Pro, SP 2

Good Afternoon, All

I am a seasoned (10 year) developer with both embedded and .NET programming experience but I am new to working at the Windows driver level. I am working on getting a bidirectional data link between a host PC and a device and would like to use WinUSB as the driver. I have downloaded Jungo’s USB WinDriver and got that working but the SDK is fairly expensive and I would rather use something that is free as long as it will work. The data link would only be used for configuration purposes and not for regular operation of the device. I will outline the steps I have taken thus far as well as provide a copy of the .inf file I am using.

  1. Downloaded the Microsoft “How-To” guide and read it.
  2. Downloaded Jan Axelson’s C#.NET application that included a .inf file
  3. Downloaded and installed the WinDDK (ver 7600.16385.0)
  4. Modified the .inf file (see file for changes)
  5. Created a directory, c:\WinUSB, and added the winusb.inf and winusb.cat file to the root. Then created \i386 and \amd64 subdirectories and copied the respective winusbcoinstaller2.dll and WdfCoInstaller01009.dll files to each directory.
  6. Plugged a USB-to-Serial dongle into PC but DID NOT install provided driver
  7. Attempted to install the driver manually by pointing to the c:\winusb directory but it just says “Cannot Install Hardware” because it can’t find the software.

Below is a listing of my .inf file. A couple of notes on it:

  1. I know I need to apply for Vendor ID and Part ID. I will do that when we get this working.

; Adapted from the example INF in the Microsoft document “How to Use WinUSB to Communicate with a USB Device”

[Version]
Signature = “$Windows NT$”
Class = USB
ClassGUID={36FC9E60-C465-11CF-8056-444553540000}
Provider = %ProviderName%
DriverVer=12/18/2009,1.0.0
CatalogFile=winusb.cat

; ========== Manufacturer/Models sections ===========

[Manufacturer]
%ProviderName% = MyDevice_WinUSB,NTx86,NTamd64

[MyDevice_WinUSB.NTx86]
%USB\MyDevice.DeviceDesc% =USB_Install, USB\VID_0434&PID_0001

[MyDevice_WinUSB.NTamd64]
%USB\MyDevice.DeviceDesc% =USB_Install, USB\VID_0434&PID_0001

; =================== Installation ===================
[ClassINstall32]

[USB_Install]
Include=winusb.inf
Needs=WINUSB.NT

[USB_Install.Services]
Include=winusb.inf
AddService=WinUSB,0x00000002,WinUSB_ServiceInstall

[WinUSB_ServiceInstall]
DisplayName = %WinUSB_SvcDesc%
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %12%\WinUSB.sys

[USB_Install.Wdf]
KmdfService=WINUSB, WinUsb_Install

[WinUSB_Install]
KmdfLibraryVersion=1.9

[USB_Install.HW]
AddReg=Dev_AddReg

[Dev_AddReg]
HKR,DeviceInterfaceGUIDs,0x10000,“{6E3EEEEF-56AB-4035-9E05-132047FFE1D3}”

[USB_Install.CoInstallers]
AddReg=CoInstallers_AddReg
CopyFiles=CoInstallers_CopyFiles,NTx86,NTamd64

[CoInstallers_AddReg]
HKR,CoInstallers32,0x00010000,“WinUSBCoInstaller2.dll”,“WdfCoInstaller01009.dll,WdfCoInstaller”

[CoInstallers_CopyFiles.NTx86]
x86\WinUSBCoInstaller2.dll
x86\WdfCoInstaller01009.dll

[CoInstallers_CopyFiles.NTamd64]
amd64\WinUSBCoInstaller2.dll
amd64\WdfCoInstaller01009.dll

[DestinationDirs]
CoInstallers_CopyFiles=11

; ================= Source Media Section =====================

[SourceDisksNames.x86]
1 = %DISK_NAME%,\i386

[SourceDisksNames.amd64]
2 = %DISK_NAME%,\amd64

[SourceDisksFiles.x86]
WinUSBCoInstaller2.dll=1
WdfCoInstaller01009.dll=1

[SourceDisksFiles.amd64]
WinUSBCoInstaller2.dll=2
WdfCoInstaller01009.dll=2

; Copy Files section
;------------------------------------------------------------------------------
[_CopyFiles_sys]
winusb.sys

;************************************************* *****************************
; Destination Directories
;------------------------------------------------------------------------------
[DestinationDirs]
DefaultDestDir = 12 ; %SystemRoot%\system32\drivers
_CopyFiles_sys = 12

; =================== Strings ===================

[Strings]
ProviderName=“MSA”
USB\MyDevice.DeviceDesc=“Generic USB Device”
WinUSB_SvcDesc=“USB to Serial Demo”
DISK_NAME=“c:\WinUSB”

Now for a couple of questions:

  1. Is my .inf file correct? I have read lots of posts and I feel that it is correct. My only hesitation is that 90% of the posts I read dealt with a previous version of the WinDDK files. I was not able to find much on v1.9
  2. To install the driver, I just plug in a USB device and instead of using the provided drivers use the .inf file I created, right?

I feel that my error is something really small. Reading other peoples posts, it looks like they were able to get the driver installation process started, but it halted at some point due to an error. It just tells me it can’t find the software, which leads me to believe I either have the files in the wrong place or I am declaring there location incorrectly in the.inf file.

Any help/advice would be much appreciated!

Best Regards,
Jonathan J.

Try to do this in one flat directory (temporarily).
Get rid of 386 and amd64 subdirs and update the INF accordingly. Will it
work then?
–pa

wrote in message news:xxxxx@ntdev…
> Good Afternoon, All
>
> I am a seasoned (10 year) developer with both embedded and .NET
> programming experience but I am new to working at the Windows driver
> level. I am working on getting a bidirectional data link between a host
> PC and a device and would like to use WinUSB as the driver. I have
> downloaded Jungo’s USB WinDriver and got that working but the SDK is
> fairly expensive and I would rather use something that is free as long as
> it will work. The data link would only be used for configuration purposes
> and not for regular operation of the device. I will outline the steps I
> have taken thus far as well as provide a copy of the .inf file I am using.
>
> 1. Downloaded the Microsoft “How-To” guide and read it.
> 2. Downloaded Jan Axelson’s C#.NET application that included a .inf file
> 3. Downloaded and installed the WinDDK (ver 7600.16385.0)
> 4. Modified the .inf file (see file for changes)
> 5. Created a directory, c:\WinUSB, and added the winusb.inf and winusb.cat
> file to the root. Then created \i386 and \amd64 subdirectories and copied
> the respective winusbcoinstaller2.dll and WdfCoInstaller01009.dll files to
> each directory.
> 5. Plugged a USB-to-Serial dongle into PC but DID NOT install provided
> driver
> 6. Attempted to install the driver manually by pointing to the c:\winusb
> directory but it just says “Cannot Install Hardware” because it can’t find
> the software.
>
> Below is a listing of my .inf file. A couple of notes on it:
> 1. I know I need to apply for Vendor ID and Part ID. I will do that when
> we get this working.
>
> ; Adapted from the example INF in the Microsoft document “How to Use
> WinUSB to Communicate with a USB Device”
>
> [Version]
> Signature = “$Windows NT$”
> Class = USB
> ClassGUID={36FC9E60-C465-11CF-8056-444553540000}
> Provider = %ProviderName%
> DriverVer=12/18/2009,1.0.0
> CatalogFile=winusb.cat
>
> ; ========== Manufacturer/Models sections ===========
>
> [Manufacturer]
> %ProviderName% = MyDevice_WinUSB,NTx86,NTamd64
>
> [MyDevice_WinUSB.NTx86]
> %USB\MyDevice.DeviceDesc% =USB_Install, USB\VID_0434&PID_0001
>
> [MyDevice_WinUSB.NTamd64]
> %USB\MyDevice.DeviceDesc% =USB_Install, USB\VID_0434&PID_0001
>
> ; =================== Installation ===================
> [ClassINstall32]
>
> [USB_Install]
> Include=winusb.inf
> Needs=WINUSB.NT
>
> [USB_Install.Services]
> Include=winusb.inf
> AddService=WinUSB,0x00000002,WinUSB_ServiceInstall
>
> [WinUSB_ServiceInstall]
> DisplayName = %WinUSB_SvcDesc%
> ServiceType = 1
> StartType = 3
> ErrorControl = 1
> ServiceBinary = %12%\WinUSB.sys
>
> [USB_Install.Wdf]
> KmdfService=WINUSB, WinUsb_Install
>
> [WinUSB_Install]
> KmdfLibraryVersion=1.9
>
> [USB_Install.HW]
> AddReg=Dev_AddReg
>
> [Dev_AddReg]
> HKR,DeviceInterfaceGUIDs,0x10000,“{6E3EEEEF-56AB-4035-9E05-132047FFE1D3}”
>
> [USB_Install.CoInstallers]
> AddReg=CoInstallers_AddReg
> CopyFiles=CoInstallers_CopyFiles,NTx86,NTamd64
>
> [CoInstallers_AddReg]
> HKR,CoInstallers32,0x00010000,“WinUSBCoInstaller2.dll”,“WdfCoInstaller01009.dll,WdfCoInstaller”
>
> [CoInstallers_CopyFiles.NTx86]
> x86\WinUSBCoInstaller2.dll
> x86\WdfCoInstaller01009.dll
>
> [CoInstallers_CopyFiles.NTamd64]
> amd64\WinUSBCoInstaller2.dll
> amd64\WdfCoInstaller01009.dll
>
> [DestinationDirs]
> CoInstallers_CopyFiles=11
>
> ; ================= Source Media Section =====================
>
> [SourceDisksNames.x86]
> 1 = %DISK_NAME%,\i386
>
> [SourceDisksNames.amd64]
> 2 = %DISK_NAME%,\amd64
>
> [SourceDisksFiles.x86]
> WinUSBCoInstaller2.dll=1
> WdfCoInstaller01009.dll=1
>
> [SourceDisksFiles.amd64]
> WinUSBCoInstaller2.dll=2
> WdfCoInstaller01009.dll=2
>
> ; Copy Files section
> ;------------------------------------------------------------------------------
> [_CopyFiles_sys]
> winusb.sys
>
> ; ********************
>

> ; Destination Directories
> ;------------------------------------------------------------------------------
> [DestinationDirs]
> DefaultDestDir = 12 ; %SystemRoot%\system32\drivers
> _CopyFiles_sys = 12
>
> ; =================== Strings ===================
>
> [Strings]
> ProviderName=“MSA”
> USB\MyDevice.DeviceDesc=“Generic USB Device”
> WinUSB_SvcDesc=“USB to Serial Demo”
> DISK_NAME=“c:\WinUSB”
>
> Now for a couple of questions:
> 1. Is my .inf file correct? I have read lots of posts and I feel that it
> is correct. My only hesitation is that 90% of the posts I read dealt with
> a previous version of the WinDDK files. I was not able to find much on
> v1.9
> 2. To install the driver, I just plug in a USB device and instead of using
> the provided drivers use the .inf file I created, right?
>
> I feel that my error is something really small. Reading other peoples
> posts, it looks like they were able to get the driver installation process
> started, but it halted at some point due to an error. It just tells me it
> can’t find the software, which leads me to believe I either have the files
> in the wrong place or I am declaring there location incorrectly in the.inf
> file.
>
> Any help/advice would be much appreciated!
>
> Best Regards,
> Jonathan J.
>

>between a host PC and a device and would like to use WinUSB as the driver. I have downloaded

Jungo’s USB WinDriver

Forget this bad product full of bugs, it is obsoleted by UMDF which is a preferred method of WinUSB use.

Also, you can use WinUSB from the app itself, without having drivers. But yes, you need an INF for WinUSB anyway.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

Jonathan:
Your DDInstall.wdf section needs one additional line:

KmdfService=WINUSB, WinUsb_Install
UmdfServiceOrder=WINUSB ;Add this line

ghb