usbser inf file for Vista 32/64

A standard CDC device.
This works fine in XP but not in Vista.
Any ideas about what to change?
Also, how you debug failed device installs?

; Windows 2000 and XP setup File
[Version]
Signature=“$Windows NT$”
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}

[DDInstall.NT]
include=mdmcpq.inf
CopyFiles=FakeModemCopyFileSection

[DDInstall.NT.Services]
include=mdmcpq.inf AddService=usbser, 0x00000000, LowerFilter_Service_Inst

[DDInstall.NT.HW]
include=mdmcpq.inf
AddReg=LowerFilterAddReg

Provider=%MFG%
LayoutFile=layout.inf
DriverVer=10/15/1999,5.0.2153.1

[Manufacturer]
%MFG%=MFG-Embedded

[MFG-Embedded]
%MFG_CDC%=Reader ,USB\VID_C1CA&PID_0008
%MFG_CDC%=Reader ,USB\VID_C1CA&PID_0009
%MFG_CDC%=Reader ,USB\VID_C1CA&PID_000A
%MFG_CDC%=Reader ,USB\VID_C1CA&PID_000B
%MFG_CDC%=Reader ,USB\VID_C1CA&PID_000C

[Reader_Install.NTx86]
;Windows2000

[DestinationDirs]
DefaultDestDir=12
Reader.NT.Copy=12

[Reader.NT]
CopyFiles=Reader.NT.Copy
AddReg=Reader.NT.AddReg

[Reader.NT.Copy]
usbser.sys

[Reader.NT.AddReg]
HKR,NTMPDriver,*ntkern
HKR,NTMPDriver,usbser.sys
HKR,EnumPropPages32,“MsPorts.dll,SerialPortPropPageProvider”

[Reader.NT.Services]
AddService = usbser, 0x00000002, Service_Inst

[Service_Inst]
DisplayName = %Serial.SvcDesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\usbser.sys
LoadOrderGroup = Base

[Strings]
MFG = “MyDevice”
MFG_CDC = “MyDevice”
Serial.SvcDesc = “USB Serial emulation driver”

> This works fine in XP but not in Vista.

Any ideas about what to change?
Also, how you debug failed device installs?

The best way is to inspect the SetupAPI.log file

http://www.microsoft.com/whdc/driver/install/setupapilog.mspx

Thanks.
Well, it seems it is totally ignoring the inf file, as the you can see the
vid and pid are in there.

[Device Install Log]
OS Version = 6.0.6001
Service Pack = 1.0
Suite = 0x0100
ProductType = 1
Architecture = amd64

[BeginLog]

>> [Device Install (Hardware initiated) -
USB\VID_C1CA&PID_000A\6&2a34bde&0&6]
>> Section start 2009/04/21 08:43:39.212
ump: Creating Install Process: DrvInst.exe 08:43:39.266
ndv: Retrieving device info…
ndv: Setting device parameters…
ndv: Building driver list…
dvi: {Build Driver List} 08:43:39.466
dvi: Searching for hardware ID(s):
dvi: usb\vid_c1ca&pid_000a&rev_0000
dvi: usb\vid_c1ca&pid_000a
dvi: Searching for compatible ID(s):
dvi: usb\class_02&subclass_02&prot_01
dvi: usb\class_02&subclass_02
dvi: usb\class_02
dvi: Enumerating INFs from path list ‘C:\Windows\INF’
inf: Searched 0 potential matches in published INF directory
inf: Searched 32 INFs in directory: ‘C:\Windows\INF’
dvi: {Build Driver List - exit(0x00000000)} 08:43:39.543
ndv: Selecting best match…
dvi: {DIF_SELECTBESTCOMPATDRV} 08:43:39.543
dvi: No class installer for ‘Unknown driver software package’
dvi: No CoInstallers found
dvi: Default installer: Enter 08:43:39.544
dvi: {Select Best Driver}
! dvi: Selecting driver failed(0xe0000228)
dvi: {Select Best Driver - exit(0xe0000228)}
! dvi: Default installer: failed!
! dvi: Error 0xe0000228: There are no compatible drivers for this
device.
dvi: {DIF_SELECTBESTCOMPATDRV - exit(0xe0000228)} 08:43:39.545
ndv: {Core Device Install}
ndv: Device install status=0xe0000203
ndv: Performing device install final cleanup…
! ndv: Queueing up error report since device installation failed…
ndv: {Core Device Install - exit(0xe0000203)}
ump: Server install process exited with code 0xe0000203 08:43:39.560
<<< Section end 2009/04/21 08:43:39.569
<<< [Exit status: FAILURE(0xe0000203)]

>> [Device Install (Found New Hardware Wizard) -
USB\VID_C1CA&PID_000A\6&2A34BDE&0&6]
>> Section start 2009/04/21 08:43:56.080
<<< Section end 2009/04/21 08:44:01.470
<<< [Exit status: FAILURE(0x000004c7)]

On Tue, Apr 21, 2009 at 8:08 AM, Mike N. wrote:

> This works fine in XP but not in Vista.
>> Any ideas about what to change?
>> Also, how you debug failed device installs?
>>
>
> The best way is to inspect the SetupAPI.log file
>
> http://www.microsoft.com/whdc/driver/install/setupapilog.mspx
>
>
>
>
> —
> 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
>

jimd wrote:

inf: Searched 32 INFs in directory: ‘C:\Windows\INF’

I hate to ask, but is your INF actually preinstalled correctly? How are you installing your INF?

glad you asked. No it is not preinstalled.
Where can I find information on how to do just that?

On Tue, Apr 21, 2009 at 10:26 AM, wrote:

> jimd wrote:
>
> > inf: Searched 32 INFs in directory: ‘C:\Windows\INF’
>
> I hate to ask, but is your INF actually preinstalled correctly? How are
> you installing your INF?
>
> —
> 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
>

jimd wrote:

glad you asked. No it is not preinstalled.

Hmm. Well, are you pointing the hardware wizard at the directory containing your INF when you plug in your device? Or is it just silently failing? Of course, now I’m wondering how you were doing this on 2K/XP…

Where can I find information on how to do just that?

Basically, you want to use this API:

http://msdn.microsoft.com/en-us/library/ms793500.aspx

…and make sure you’re using the DIFXAPI DLL’s from the latest WDK.

Yes, at this point we were just showing it the inf file.
Does the inf have to be signed for x64?

On Tue, Apr 21, 2009 at 10:37 AM, wrote:

> jimd wrote:
>
> > glad you asked. No it is not preinstalled.
>
> Hmm. Well, are you pointing the hardware wizard at the directory
> containing your INF when you plug in your device? Or is it just silently
> failing? Of course, now I’m wondering how you were doing this on 2K/XP…
>
> > Where can I find information on how to do just that?
>
> Basically, you want to use this API:
>
> http://msdn.microsoft.com/en-us/library/ms793500.aspx
>
> …and make sure you’re using the DIFXAPI DLL’s from the latest WDK.
>
> —
> 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
>

Jim Donelson wrote:

Yes, at this point we were just showing it the inf file.
Does the inf have to be signed for x64?

Yes. Also remember that you have to build a 64-bit driver binary to
install on x64. You can’t use your 32-bit binary. I noticed that the
sample setupapi log you posted was from a 64-bit system.

And while I’m on a roll:

; Windows 2000 and XP setup File
[Version]
Signature=“$Windows NT$”
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}

[DDInstall.NT]
include=mdmcpq.inf
CopyFiles=FakeModemCopyFileSection

[DDInstall.NT.Services]
include=mdmcpq.inf AddService=usbser, 0x00000000, LowerFilter_Service_Inst

[DDInstall.NT.HW]
include=mdmcpq.inf
AddReg=LowerFilterAddReg

Those sections are never referenced in your INF. When the INF reference
material talks about a “DDInstall” section, that’s a generic reference
that needs to be replaced by your specific name. You don’t really use
“DDInstall”. In your case, the specific name is “Reader”. So, your
lower filter is never going to be installed. But, since you don’t have
sections called [LowerFilterAddReg] or [LowerFilter_Service_Inst], there
are other problems to be solved here.

Also, your [DDInstall.NT.Services] section has a problem. That should
be two separate lines.

[Reader.NT.AddReg]
HKR,NTMPDriver,*ntkern
HKR,NTMPDriver,usbser.sys
HKR,EnumPropPages32,“MsPorts.dll,SerialPortPropPageProvider”

The “NTMPDriver” lines have no effect on any NT-based system. If you
are not targeting 98 or ME, you may remove them.


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

>Does the inf have to be signed for x64?

Yes - I’ve also found the WDK utility ‘Chkinf.exe’ to be very helpful in
troubleshooting basic .INF file setup issues.

Here are some general development time tips - I had to create a
self-signed development certificate.

I signed driver referring to “Kernel-Mode Code Signing Walkthrough”,
http://www.microsoft.com/whdc/winlogo/drvsign/kmcs_walkthrough.mspx,
it works fine under Srv2008/Vista 64bits. Hope following tips can help you.
* make sure your OS time is correct when you sign your cat file.
* With Vista, use bcdedit to set TESTSIGNING on in your 64bit system.
XP/Server 2003 x64 don’t need this step.
* Installing your certificate in your system, for example:
certmgr.exe /add aaa.cer /s /r localMachine root
certmgr.exe /add aaa.cer /s /r localMachine trustedpublisher

(While adding the dev certificate to root and trusted publisher is not the
“best practices” method, I found it to be the easiest. just remove it
after development is complete)

Get Vista to boot in test mode always with the command from an elevated
command prompt:
bcdedit.exe /store C:\Boot\BCD /set testsigning yes

You’ll need to turn off testsigning after development is complete; some
other things don’t work properly with test signing enabled under Vista.

>Yes. Also remember that you have to build a 64-bit driver binary to

install on x64. You can’t use your 32-bit binary. I noticed that the
sample setupapi log you posted was from a 64-bit system.

Ya, but, I am using usbser.sys - it seems that is provided on x64, as modem
inf files use it.

Just so I am clear, even though I am *not* providing any binaries, I will
still need to sign (the inf or cat?) for x64?

I will review these posts, thanks.

Jim Donelson wrote:

>Yes. Also remember that you have to build a 64-bit driver binary to
>install on x64. You can’t use your 32-bit binary. I noticed that the
>sample setupapi log you posted was from a 64-bit system.

Ya, but, I am using usbser.sys - it seems that is provided on x64, as
modem inf files use it.

Yes. The INF you posted included some sections that were trying to
install a filter driver, so I wasn’t sure.

Just so I am clear, even though I am *not* providing any binaries, I
will still need to sign (the inf or cat?) for x64?

No. The driver binary is already signed, so KMCS will be satisfied. If
you want to avoid the install-time warning about “this driver package is
unsigned”, then you’ll need to get the CAT file signed by WHQL, but
that’s not needed to satisfy the Win64 KMCS thing.


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

If a get a cert and sign the cat file, does that remove the warning?
(Which I can live with, just wondering)
Or is the warning that the device is WHQL’ed?

On Tue, Apr 21, 2009 at 2:14 PM, Tim Roberts wrote:

> Jim Donelson wrote:
> > >Yes. Also remember that you have to build a 64-bit driver binary to
> > >install on x64. You can’t use your 32-bit binary. I noticed that the
> > >sample setupapi log you posted was from a 64-bit system.
> >
> > Ya, but, I am using usbser.sys - it seems that is provided on x64, as
> > modem inf files use it.
>
> Yes. The INF you posted included some sections that were trying to
> install a filter driver, so I wasn’t sure.
>
>
> > Just so I am clear, even though I am not providing any binaries, I
> > will still need to sign (the inf or cat?) for x64?
>
> No. The driver binary is already signed, so KMCS will be satisfied. If
> you want to avoid the install-time warning about “this driver package is
> unsigned”, then you’ll need to get the CAT file signed by WHQL, but
> that’s not needed to satisfy the Win64 KMCS thing.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> 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
>

Jim Donelson wrote:

If a get a cert and sign the cat file, does that remove the warning?
(Which I can live with, just wondering)
Or is the warning that the device is WHQL’ed?

No, that won’t remove the warning. WHQL is the only way to get rid of
the warning.


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

jimd wrote:

Ya, but, I am using usbser.sys - it seems that is provided on x64, as
modem inf files use it.

You know, I’ve always sort of wondered – why did MS provide usbser.sys but not include an inbox INF pointing at, say, USB\Class_02&SubClass_02? I wonder how many problems that would have solved (or introduced) over the years…

Well, I agree. “They” would like not to have unnecessary, possibly buggy 3rd
party drivers, so why not make it easy to use the built in one.

I originally implemented the device as HID, be cause that “just works”, but
they made it so fullspeed hid can only send one 64 byte packet per
millisecond, so some applications need a bit more data thruput have to go to
CDC device.

I could have locked the customer into a “custom” bulk driver, but honestly
CDC is plenty fast and once I figure out this Vista inf deal, it is a great
compromise for my customers easy of use and maintainability.

On Wed, Apr 22, 2009 at 10:18 AM, wrote:

> jimd wrote:
>
> > Ya, but, I am using usbser.sys - it seems that is provided on x64, as
> > modem inf files use it.
>
> You know, I’ve always sort of wondered – why did MS provide usbser.sys but
> not include an inbox INF pointing at, say, USB\Class_02&SubClass_02? I
> wonder how many problems that would have solved (or introduced) over the
> years…
>
> —
> 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
>

jimd wrote:

Well, I agree. “They” would like not to have unnecessary, possibly buggy
3rd party drivers, so why not make it easy to use the built in one.

In fact, they might take WinUSB a step further and provide an INF for some proprietary USB class/subclass/protocol that is signed for WinUSB in-box.

Then if anyone wants to talk to their device without writing a driver *and* without being harassed by warning boxes, they just line up their descriptors appropriately, and get the inbox driver for free. And without the limitations of abusing HID.

Might cut into WHQL’s profits, though…

Freescale tech support came up with the answer.

  • The pre-install is not required. I just put this in windows/inf and it
    worked.
  • In my searches, I found many red herrings.
  • Change the vid/pids for your code
  • Same with the mfg and desc.

;------------------------------------------------------------------------------
; Freescale Semiconductor INC.
; Communication Device Class(CDC) INF File
;------------------------------------------------------------------------------

[Version]
Signature=“$Windows NT$”
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
Provider=%MANUFACTURER%
LayoutFile=layout.inf
;CatalogFile=%FILENAME%.cat

DriverVer= 4/24/2009,1.1.2600.0

[Manufacturer]
%MANUFACTURER%=DeviceList,NTamd64

[DestinationDirs]
DefaultDestDir=12

;------------------------------------------------------------------------------
; Windows 2000/XP/Vista32 Support
;------------------------------------------------------------------------------
[DriverInstall.nt]
include=mdmcpq.inf
CopyFiles=DriverCopyFiles.nt
AddReg=DriverInstall.nt.AddReg

[DriverCopyFiles.nt]
usbser.sys,0x20

[DriverInstall.nt.AddReg]
HKR,DevLoader,*ntkern
HKR,NTMPDriver,%DRIVERFILENAME%.sys
HKR,EnumPropPages32,“MsPorts.dll,SerialPortPropPageProvider”

[DriverInstall.nt.Services]
AddService=usbser, 0x00000002, DriverService.nt

[DriverService.nt]
DisplayName=%SERVICE%
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%%DRIVERFILENAME%.sys

;------------------------------------------------------------------------------
; Windows Vista64 Support
;------------------------------------------------------------------------------

[DriverInstall.NTamd64]
include=mdmcpq.inf
CopyFiles=DriverCopyFiles.NTamd64
AddReg=DriverInstall.NTamd64.AddReg

[DriverCopyFiles.NTamd64]
%DRIVERFILENAME%.sys,0x20

[DriverInstall.NTamd64.AddReg]
HKR,DevLoader,*ntkern
HKR,NTMPDriver,%DRIVERFILENAME%.sys
HKR,EnumPropPages32,“MsPorts.dll,SerialPortPropPageProvider”

[DriverInstall.NTamd64.Services]
AddService=usbser, 0x00000002, DriverService.NTamd64

[DriverService.NTamd64]
DisplayName=%SERVICE%
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%%DRIVERFILENAME%.sys

;------------------------------------------------------------------------------
; VID/PID Settings
;------------------------------------------------------------------------------
[SourceDisksFiles]
[SourceDisksNames]
[DeviceList]
%DESCRIPTION%=DriverInstall, USB\VID_C1CA&PID_0004
%DESCRIPTION%=DriverInstall, USB\VID_C1CA&PID_0005

[DeviceList.NTamd64]
%DESCRIPTION%=DriverInstall, USB\VID_C1CA&PID_0004
%DESCRIPTION%=DriverInstall, USB\VID_C1CA&PID_0005

;------------------------------------------------------------------------------
; String Definitions
;------------------------------------------------------------------------------
[Strings]

FILENAME=“FSL_cdc”
DRIVERFILENAME =“usbser”
MANUFACTURER=“Freescale Semiconductor”
INSTDISK=“USB2UART”
DESCRIPTION=“Freescale CDC Device”
SERVICE=“Virtual Com Driver”