Addendum to Thread "Calling WinUSB from an application"

Hi. Just for completeness sake, see below for a revised version of the inf file located in the following thread:
It was pointed out to me by Zhao Yu from Motica that the inf file needed to be revised for copying files correctly in a cross-platform manner (by that I mean 32-bit vs. 64-bit). Zhao quotes from a WDK 6000 document: "The CopyFiles directive does not support decorating a file-list-section name with a system-defined platform extension (.nt, .ntx86, .ntia64, or .ntamd64). ". Thus, the coinstaller in the previous inf file couldn’t copy the two dlls on some platforms. Plus, he requested to have a SourceDiskFiles section put in as well. The inf template below puts in place his changes. So, this should be a better inf file to use to get started…

For those of you who haven’t followed this thread topic, this inf file is a template that can be used to install WinUSB as the primary device driver for a device (just replace the strings, GUIDs, VID and PID). To install, place your tweaked version of this inf file in a directory, then make two subdirectories, “amd64” and “x86”, and place the co-installer dlls (found in the WDK) for those particular platforms in their respective directory and off you go…

Thanks Zhao!

–Brian Hindman

; ================ Version section =================

Signature = “$Windows NT$”
Class = MyDeviceClass
ClassGuid = {11111111-2222-3333-4444-555555555555}
Provider = %ProviderName%
DriverVer = 05/22/2007,

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

%ProviderName% = MyDevice_WinUSB,NTx86,NTia64,NTamd64

%USB\MyDevice.DeviceDesc% =USB_Install, USB\VID_xxxx&PID_xxxx

%USB\MyDevice.DeviceDesc% =USB_Install, USB\VID_xxxx&PID_xxxx

; ================== Installation ==================

Include = WinUSB.inf
Needs = WinUSB.NT

Include = WinUSB.inf
AddService = WinUSB, 0x00000002, WinUSB_ServiceInstall

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

KmdfService = WinUSB, WinUSB_Install

KmdfLibraryVersion = 1.5

AddReg = Dev_AddReg


AddReg = CoInstallers_AddReg
CopyFiles = CoInstallers_CopyFiles

HKR, , CoInstallers32, 0x00010000, “WinUSBCoInstaller.dll”, “WdfCoInstaller01005.dll, WdfCoInstaller”


1 = %MediaDescription%

WinUSBCoInstaller.dll = 1, x86
WdfCoInstaller01005.dll = 1, x86

WinUSBCoInstaller.dll = 1, amd64
WdfCoInstaller01005.dll = 1, amd64

CoInstallers_CopyFiles = 11

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

ProviderName = “My Company”
USB\MyDevice.DeviceDesc=“My Device using WinUSB only”
MediaDescription = “My Installation Media”
WinUSB_SvcDesc = “WinUSB Driver Service”