I have a basic driver that I use for a USB barcode scanner.
I install the driver with an *.inf (below) and it works well.
The Barcode scanner is a HID device, and my driver is used in preference to the HID driver, based on the VID/PID of the scanner.
This is my problem:
I have multiple USB ports on the PC.
I can connect the USB scanner to say port A, install my driver, that works fine.
However, if I move the USB Scanner to USB port B, the OS loads up the HID driver instead.
If I move to USB Scanner back to port A, the OS loads my driver.
Why do I get this behavior, and is there any way to install my driver once, so it is used for the USB Scanner no matter which port I connect it to?
I’d appreciate any pointers.
Thanks
Chris
; =============== BarcodeScanner inf for Win32
[Version]
Signature = “$Windows NT$”
Class=BarcodeScanner
ClassGuid={5A382F44-3B36-463e-9414-5400B25D92FD}
Provider=%MyCo%
CatalogFile=unknown.cat
DriverVer= 7/1/2007
; ================= Class section =====================
[ClassInstall32]
Addreg=BarcodeScannerClassReg
[BarcodeScannerClassReg]
HKR,0,%ClassName%
HKR,Icon,-20
[DestinationDirs]
BarcodeScanner.Files.x86_12 = 12
[SourceDisksNames.x86]
1=%Desc_x860%
[SourceDisksNames.ia64]
[SourceDisksFiles.x86]
BarcodeScanner_2_0.sys=1,.,
wdfcoinstaller01007.dll=1,.,
[SourceDisksFiles.ia64]
[Manufacturer]
%MyCo%=MyCo
[MyCo]
;;============ Add Additional Hardware IDs Here ========================
%BarcodeScannerDesc%=BarcodeScanner_Inst,USB\Vid_FFFF&Pid_0001,
[BarcodeScanner_Inst.ntx86]
CopyFiles = BarcodeScanner.Files.x86_12
[BarcodeScanner_Inst.ntx86.Services]
AddService = BarcodeScanner1,0x00000002,BarcodeScanner_Service_Instx86
[BarcodeScanner_Service_Instx86]
ServiceType = %SERVICE_KERNEL_DRIVER%
StartType = %SERVICE_DEMAND_START%
ErrorControl = %SERVICE_ERROR_IGNORE%
ServiceBinary = %12%\BarcodeScanner_2_0.sys
[BarcodeScanner.Files.x86_12]
BarcodeScanner_2_0.sys
;[BarcodeScanner_EventLog_Inst]
;AddReg = BarcodeScanner_EventLog_Inst.AddReg
;[BarcodeScanner_EventLog_Inst.AddReg]
;HKR,EventMessageFile,%REG_EXPAND_SZ%,“%%SystemRoot%%\System32\IoLogMsg.dll”
;HKR,TypesSupported,%REG_DWORD%,7
[Strings]
; *******Localizable Strings*******
MyCo= “MyCo”
Desc_x860= “MyCo USBdrivers”
ClassName=“BarcodeScanner”
; *******Non Localizable Strings*******
SERVICE_BOOT_START = 0x0
SERVICE_SYSTEM_START = 0x1
SERVICE_AUTO_START = 0x2
SERVICE_DEMAND_START = 0x3
SERVICE_DISABLED = 0x4
SERVICE_KERNEL_DRIVER = 0x1
SERVICE_ERROR_IGNORE = 0x0
SERVICE_ERROR_NORMAL = 0x1
SERVICE_ERROR_SEVERE = 0x2
SERVICE_ERROR_CRITICAL = 0x3
REG_EXPAND_SZ = 0x00020000
REG_DWORD = 0x00010001
;;===== My Device Custom Name ====?
BarcodeScannerDesc= “BarcodeScannerDevice”
;
;— Device Coinstaller installation ------
;
[BarcodeScanner_Inst.ntx86.CoInstallers]
AddReg=BarcodeScanner_Inst_CoInstaller_AddReg
CopyFiles=BarcodeScanner_Inst_CoInstaller_CopyFiles
[DestinationDirs]
DefaultDestDir = 12
BarcodeScanner_Inst_CoInstaller_CopyFiles = 11
[BarcodeScanner_Inst_CoInstaller_AddReg]
HKR,CoInstallers32,0x00010000, “WdfCoInstaller01007.dll,WdfCoInstaller”
[BarcodeScanner_Inst_CoInstaller_CopyFiles]
WdfCoInstaller01007.dll
[BarcodeScanner_Inst.ntx86.Wdf]
KmdfService = BarcodeScanner_Inst, BarcodeScanner_Inst_wdfsect
[BarcodeScanner_Inst_wdfsect]
KmdfLibraryVersion = 1.7