Problem with an inf file on Win7 x64

Hello,

I would like to provide my own .inf file for the usbser.sys driver for Windows.

When I use the first version of this file, it is installed without a problem on WinXP SP3 (x86) and Win7 SP1 (x64):

;Copyright (c) 2011 Baracoda SA All rights Reserved

[Version]
Signature=“$Windows NT$”
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
Provider=%ProviderName%
DriverVer=02/01/2010,1.0.0.10
CatalogFile=usbser.cat

[DestinationDirs]
CopyFilesSYS=12

[MANUFACTURER]
%ProviderName%=DeviceList, NTx86, NTamd64

[DeviceList.NTx86]
%COX3CDC%=DriverInstall,USB\VID_0525&PID_A4A7

[DeviceList.NTamd64]
%COX3CDC%=DriverInstall,USB\VID_0525&PID_A4A7

[DriverInstall]
CopyFiles=CopyFilesSYS,
AddReg=SerialPropPageAddReg

[DriverInstall.Services]
AddService = usbser, 0x00000002, usbser_Inst

[CopyFilesSYS]
usbser.sys

; This adds the serial port property tab to the device properties dialog
[SerialPropPageAddReg]
HKR,EnumPropPages32,“MsPorts.dll,SerialPortPropPageProvider”

[usbser_Inst]
DisplayName = %COX3CDC%
ServiceType = 1 ;SERVICE_KERNEL_DRIVER
StartType = 3 ;SERVICE_DEMAND_START
ErrorControl = 1; SERVICE_ERROR_IGNORE
ServiceBinary = %12%\usbser.sys

[Strings]
ProviderName=“Baracoda”
COX3CDC=“OrKan USB Port”
DiskId=“OrKan USB Port Installation Disk #1

Chkinf complains about a few problems, but the driver is installed on both operating systems (I need to confirm the installation as the driver is not signed, of course).

When I try to use the second, theoretically better version of this file (chkinf passes with 0 errors/0 warnings), it still works on WinXP SP3 (x86), but fails on Win7 (x64). The message is “not intended for this platform”. Here are the contents of the second version of the .inf file:
;Copyright (c) 2011 Baracoda SA All rights Reserved

[Version]
Signature=“$Windows NT$”
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
Provider=%ProviderName%
DriverVer=02/02/2010,1.0.0.11
CatalogFile=usbser.cat

[SourceDisksNames]
1=%DiskId%,

[SourceDisksFiles]
usbser.sys=1,

[DestinationDirs]
CopyFilesSYS=12

[MANUFACTURER]
%ProviderName%=DeviceList, NTx86, NTamd64

[DeviceList.NTx86]
%COX3CDC%=DriverInstall,USB\VID_0525&PID_A4A7

[DeviceList.NTamd64]
%COX3CDC%=DriverInstall,USB\VID_0525&PID_A4A7

[DriverInstall]
CopyFiles=CopyFilesSYS,
AddReg=SerialPropPageAddReg

[DriverInstall.Services]
AddService = usbser, 0x00000002, usbser_Inst

[CopyFilesSYS]
usbser.sys

; This adds the serial port property tab to the device properties dialog
[SerialPropPageAddReg]
HKR,EnumPropPages32,“MsPorts.dll,SerialPortPropPageProvider”

[usbser_Inst]
DisplayName = %COX3CDC%
ServiceType = 1 ;SERVICE_KERNEL_DRIVER
StartType = 3 ;SERVICE_DEMAND_START
ErrorControl = 1; SERVICE_ERROR_IGNORE
ServiceBinary = %12%\usbser.sys

[Strings]
ProviderName=“Baracoda”
COX3CDC=“OrKan USB Port”
DiskId=“OrKan USB Port Installation Disk #1

All I did was to fix the problems highlighted by chkinf. What am I doing wrong? How can I fix the problem?

Any suggestions will be welcome.

BTW. I want to create a catalog file with the second version of the .inf file. The MS tool fails however stating that usbser.sys already exists on Win7. Can I simply rename the .sys file and modify the .inf file contents accordingly to get rid of this problem?

Regards,
AP

I think you’re off on the wrong track. You don’t want to be in the business of redistributing the usbser.sys binary, and you would have to do that to get this approach to work because the .cat file is going to tie the inf and sys file together.

I believe the way you’re supposed to add support like this is to use a “Includes=” and “Needs=” directive in your DDInstall section.

You can probably read the document on using WinUSB which describes how to register hardware to work with the system provided WinUSB driver. You want to use usbser.inf obviously. Try looking at

http://msdn.microsoft.com/en-us/windows/hardware/gg487341

That having been said, FYI.
The platform error message is coming because you need a [SourceDisksNames.x86] and a [SourceDisksNames.amd64].

Let’s be clear here. You *CAN’T* redist usbser.sys or any os binary. The only binaries you can redist are in the redist folder and listed in the kit eula

d

debt from my phone


From: xxxxx@gmail.com
Sent: 12/9/2011 4:28 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Problem with an inf file on Win7 x64

I think you’re off on the wrong track. You don’t want to be in the business of redistributing the usbser.sys binary, and you would have to do that to get this approach to work because the .cat file is going to tie the inf and sys file together.

I believe the way you’re supposed to add support like this is to use a “Includes=” and “Needs=” directive in your DDInstall section.

You can probably read the document on using WinUSB which describes how to register hardware to work with the system provided WinUSB driver. You want to use usbser.inf obviously. Try looking at

http://msdn.microsoft.com/en-us/windows/hardware/gg487341

That having been said, FYI.
The platform error message is coming because you need a [SourceDisksNames.x86] and a [SourceDisksNames.amd64].


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer