Preinstalling Drivers

Dear Team,

I modified the driver hidusbfx2.sys under ddk\src\kmdf folder and performing Software-First installation using DIFxAPI.

The call to DriverPackageInstall is returning TRUST_E_NOSIGNATURE error code.

Experts kindly suggest a way to obtain the signature for testing the driver. I see lot of tools under documentation (CertMgr, MakeCat, MakeCert, SignTool, Signability, etc.) but not getting to the correct conclusion.

I verified the general toaster example but it already included some .cat files.

Regards.

I tried selfsign_example.cmd example given in bin-SelfSign folder. At the signability statement the tool gives the Application Error saying that it referenced to memory which cannot be read.

Uday Bhaskar wrote:

I modified the driver hidusbfx2.sys under ddk\src\kmdf folder
and performing Software-First installation using DIFxAPI.

The call to DriverPackageInstall is returning TRUST_E_NOSIGNATURE
error code.

You don’t need to sign the driver to test software-first installation.

First hit on Google for “difxapi preinstall unsigned drivers”:

http://msdn2.microsoft.com/en-us/library/ms790279.aspx

I tried DriverPackagePreinstall before using DriverPackageInstall function.

The point is DriverPackagePreinstall is returning success. The INF file is getting copied to destination. The driver files are getting copied to DRIVESTORE folder.

Even then when I plug in the device, the default HID driver gets loaded ignoring my driver. The setupapi.log shows the following:

[SetupAPI Log]
OS Version = 5.1.2600 Service Pack 2
Platform ID = 2 (NT)
Service Pack = 2.0
Suite = 0x0100
Product Type = 1
Architecture = x86
[2007/11/04 02:41:44 204.3]
#-198 Command line processed: “c:\Documents and Settings\user\Desktop\CoInstaller\Debug\CoInstaller.exe”
#E367 An unsigned or incorrectly signed file “C:\WINDOWS\system32\DRVSTORE\hidusbfx2_9C9282C6B922D3C77919B4810D483E84D323DFDC\hidusbfx2.inf” for will be installed (Policy=Warn, user said ok). Error 0xe000022f: The third-party INF does not contain digital signature information.

Guide me in the correct path to prevent default HID driver and load the preinstalled driver.

Regards.

Uday Bhaskar wrote:

Guide me in the correct path to prevent default HID driver and
load the preinstalled driver.

Well, that’s a tougher one. Whenever I’ve needed to do this, I just temporarily renamed the inbox drivers to whatever._inf.

If you want a real/long-term solution then yes you need to get the drivers signed by WHQL.

There was a thread awhile back about how to get XP to install self-signed drivers silently, I believe it involved putting your machine in “test mode” among other things.

Vista. It’s easy and works quite well, but I don’t believe that it will
solve this problem; that is, replacing an inbox. I believe the official
answer is that you’re not to do this other than by service pack on Vista
at least, and in either case, self signing will not put you ahead of
anything actually signed, I believe. I’m not 100% sure about any of
this other than this is a Vista issue, but I think it’s correct.

Good luck,

mm

xxxxx@gmail.com wrote:

Uday Bhaskar wrote:

> Guide me in the correct path to prevent default HID driver and
> load the preinstalled driver.

Well, that’s a tougher one. Whenever I’ve needed to do this, I just temporarily renamed the inbox drivers to whatever._inf.

If you want a real/long-term solution then yes you need to get the drivers signed by WHQL.

There was a thread awhile back about how to get XP to install self-signed drivers silently, I believe it involved putting your machine in “test mode” among other things.

That pointer is actually guides me nearer to the destination. The final aim is to preinstall the drivers on Vista only.

Since my ddk build environment is in XP machine, I tried it on XP.

I will update the status as soon as I complete my homework on Vista.

Regards.

Dear Team,

I found self-sign-command example under bin-selfsign folder. Using this I created a catalog file and added to my driver folder.

After running self-sign-command, I ran my pre install driver application. Now my custom driver is getting loaded instead of default Windows HID driver in XP machine.

But in Vista machine, again the same problem occurs. My driver pre install returns success value but the moment I attach the device default HID driver gets loaded.

The below is the log file in both XP and Vista.

=============
WIN XP LOG

[2007/11/05 18:41:47 684.3 Driver Install]
#-019 Searching for hardware ID(s): usb\vid_04df&pid_0007&rev_0320,usb\vid_04df&pid_0007
#-018 Searching for compatible ID(s): usb\class_03&subclass_01&prot_02,usb\class_03&subclass_01,usb\class_03
#-198 Command line processed: C:\WINDOWS\system32\services.exe
#I022 Found “USB\VID_04DF&PID_0007” in C:\WINDOWS\inf\oem8.inf; Device: “KMDF HID Minidriver for OSR USB-FX2 Device”; Driver: “KMDF HID Minidriver for OSR USB-FX2 Device”; Provider: “UDAY BHASKAR”; Mfg: “UDAY BHASKAR”; Section name: “hidusbfx2.Inst”.
#I023 Actual install section: [hidusbfx2.Inst.NT]. Rank: 0x00000001. Effective driver date: 04/01/2006.
#I393 Modified INF cache “C:\WINDOWS\inf\INFCACHE.1”.
#I022 Found “USB\Class_03&SubClass_01” in C:\WINDOWS\inf\input.inf; Device: “USB Human Interface Device”; Driver: “USB Human Interface Device”; Provider: “Microsoft”; Mfg: “(Standard system devices)”; Section name: “HID_Inst”.
#I023 Actual install section: [HID_Inst.NT]. Rank: 0x00003101. Effective driver date: 07/01/2001.
#-166 Device install function: DIF_SELECTBESTCOMPATDRV.
#I063 Selected driver installs from section [hidusbfx2.Inst] in “c:\windows\inf\oem8.inf”.
#I320 Class GUID of device remains: {745A17A0-74D3-11D0-B6FE-00A0C90F57DA}.
#I060 Set selected driver.
#I058 Selected best compatible driver.
#-166 Device install function: DIF_INSTALLDEVICEFILES.
#I124 Doing copy-only install of “USB\VID_04DF&PID_0007\5&31DBB019&0&1”.
#-166 Device install function: DIF_REGISTER_COINSTALLERS.
#I056 Coinstallers registered.
#-166 Device install function: DIF_INSTALLINTERFACES.
#-011 Installing section [hidusbfx2.Inst.NT.Interfaces] from “c:\windows\inf\oem8.inf”.
#I054 Interfaces installed.
#-166 Device install function: DIF_INSTALLDEVICE.
#I123 Doing full install of “USB\VID_04DF&PID_0007\5&31DBB019&0&1”.
#I121 Device install of “USB\VID_04DF&PID_0007\5&31DBB019&0&1” finished successfully.
[2007/11/05 18:41:53 684.7 Driver Install]
#-019 Searching for hardware ID(s): hid\vid_04df&pid_0007&rev_0320&col01,hid\vid_04df&pid_0007&col01,hid_device_system_consumer,hid_device_up:000c_u:0001,hid_device
#-198 Command line processed: C:\WINDOWS\system32\services.exe
#I022 Found “HID_DEVICE_UP:000C_U:0001” in C:\WINDOWS\inf\hidserv.inf; Device: “HID-compliant consumer control device”; Driver: “HID-compliant consumer control device”; Provider: “Microsoft”; Mfg: “Microsoft”; Section name: “HIDSystemConsumer”.
#I023 Actual install section: [HIDSystemConsumer]. Rank: 0x00001003. Effective driver date: 07/01/2001.
#I022 Found “HID_DEVICE” in C:\WINDOWS\inf\input.inf; Device: “HID-compliant device”; Driver: “HID-compliant device”; Provider: “Microsoft”; Mfg: “(Standard system devices)”; Section name: “HID_Raw_Inst”.
#I023 Actual install section: [HID_Raw_Inst.NT]. Rank: 0x00001004. Effective driver date: 07/01/2001.
#-166 Device install function: DIF_SELECTBESTCOMPATDRV.
#I063 Selected driver installs from section [HIDSystemConsumer] in “c:\windows\inf\hidserv.inf”.
#I320 Class GUID of device remains: {745A17A0-74D3-11D0-B6FE-00A0C90F57DA}.
#I060 Set selected driver.
#I058 Selected best compatible driver.
#-166 Device install function: DIF_INSTALLDEVICEFILES.
#I124 Doing copy-only install of “HID\VID_04DF&PID_0007&COL01\6&1C43B69&1B&0000”.
#-166 Device install function: DIF_REGISTER_COINSTALLERS.
#I056 Coinstallers registered.
#-166 Device install function: DIF_INSTALLINTERFACES.
#-011 Installing section [HIDSystemConsumer.Interfaces] from “c:\windows\inf\hidserv.inf”.
#I054 Interfaces installed.
#-166 Device install function: DIF_INSTALLDEVICE.
#I123 Doing full install of “HID\VID_04DF&PID_0007&COL01\6&1C43B69&1B&0000”.
#I121 Device install of “HID\VID_04DF&PID_0007&COL01\6&1C43B69&1B&0000” finished successfully.
[2007/11/05 18:41:54 684.11 Driver Install]
#-019 Searching for hardware ID(s): hid\vid_04df&pid_0007&rev_0320&col02,hid\vid_04df&pid_0007&col02,hid_device_system_control,hid_device_up:0001_u:0080,hid_device
#-198 Command line processed: C:\WINDOWS\system32\services.exe
#I022 Found “HID_DEVICE” in C:\WINDOWS\inf\input.inf; Device: “HID-compliant device”; Driver: “HID-compliant device”; Provider: “Microsoft”; Mfg: “(Standard system devices)”; Section name: “HID_Raw_Inst”.
#I023 Actual install section: [HID_Raw_Inst.NT]. Rank: 0x00001004. Effective driver date: 07/01/2001.
#-166 Device install function: DIF_SELECTBESTCOMPATDRV.
#I063 Selected driver installs from section [HID_Raw_Inst] in “c:\windows\inf\input.inf”.
#I320 Class GUID of device remains: {745A17A0-74D3-11D0-B6FE-00A0C90F57DA}.
#I060 Set selected driver.
#I058 Selected best compatible driver.
#-166 Device install function: DIF_INSTALLDEVICEFILES.
#I124 Doing copy-only install of “HID\VID_04DF&PID_0007&COL02\6&1C43B69&1B&0001”.
#-166 Device install function: DIF_REGISTER_COINSTALLERS.
#I056 Coinstallers registered.
#-166 Device install function: DIF_INSTALLINTERFACES.
#-011 Installing section [HID_Raw_Inst.NT.Interfaces] from “c:\windows\inf\input.inf”.
#I054 Interfaces installed.
#-166 Device install function: DIF_INSTALLDEVICE.
#I123 Doing full install of “HID\VID_04DF&PID_0007&COL02\6&1C43B69&1B&0001”.
#I121 Device install of “HID\VID_04DF&PID_0007&COL02\6&1C43B69&1B&0001” finished successfully.
[2007/11/05 18:41:55 684.15 Driver Install]
#-019 Searching for hardware ID(s): hid\vid_04df&pid_0007&rev_0320&col03,hid\vid_04df&pid_0007&col03,hid_device_up:ff00_u:0001,hid_device
#-198 Command line processed: C:\WINDOWS\system32\services.exe
#I022 Found “HID_DEVICE_UP:FF00_U:0001” in C:\WINDOWS\inf\oem8.inf; Device: “HID Vendor-defined Collection for OSR USB-FX2”; Driver: “HID Vendor-defined Collection for OSR USB-FX2”; Provider: “UDAY BHASKAR”; Mfg: “UDAY BHASKAR”; Section name: “customCollection.Inst”.
#I023 Actual install section: [customCollection.Inst.NT]. Rank: 0x00000002. Effective driver date: 04/01/2006.
#I022 Found “HID_DEVICE” in C:\WINDOWS\inf\input.inf; Device: “HID-compliant device”; Driver: “HID-compliant device”; Provider: “Microsoft”; Mfg: “(Standard system devices)”; Section name: “HID_Raw_Inst”.
#I023 Actual install section: [HID_Raw_Inst.NT]. Rank: 0x00001003. Effective driver date: 07/01/2001.
#-166 Device install function: DIF_SELECTBESTCOMPATDRV.
#I063 Selected driver installs from section [customCollection.Inst] in “c:\windows\inf\oem8.inf”.
#I320 Class GUID of device remains: {745A17A0-74D3-11D0-B6FE-00A0C90F57DA}.
#I060 Set selected driver.
#I058 Selected best compatible driver.
#-166 Device install function: DIF_INSTALLDEVICEFILES.
#I124 Doing copy-only install of “HID\VID_04DF&PID_0007&COL03\6&1C43B69&1B&0002”.
#-166 Device install function: DIF_REGISTER_COINSTALLERS.
#I056 Coinstallers registered.
#-166 Device install function: DIF_INSTALLINTERFACES.
#-011 Installing section [customCollection.Inst.NT.Interfaces] from “c:\windows\inf\oem8.inf”.
#I054 Interfaces installed.
#-166 Device install function: DIF_INSTALLDEVICE.
#I123 Doing full install of “HID\VID_04DF&PID_0007&COL03\6&1C43B69&1B&0002”.
#I121 Device install of “HID\VID_04DF&PID_0007&COL03\6&1C43B69&1B&0002” finished successfully.

================
VISTA LOG

dvi: {Build Driver List} 03:22:21.905
dvi: Searching for hardware ID(s):
dvi: usb\vid_04df&pid_0007&rev_0320
dvi: usb\vid_04df&pid_0007
dvi: Searching for compatible ID(s):
dvi: usb\class_03&subclass_01&prot_02
dvi: usb\class_03&subclass_01
dvi: usb\class_03
dvi: Enumerating INFs from path list ‘C:\Windows\INF’
inf: Opened INF: ‘C:\Windows\System32\DriverStore\FileRepository\hidusbfx2.inf_6fdcf923\hidusbfx2.inf’ ([strings] )
inf: Saved PNF: ‘C:\Windows\System32\DriverStore\FileRepository\hidusbfx2.inf_6fdcf923\hidusbfx2.PNF’ (Language = 0409)
dvi: Created Driver Node:
dvi: HardwareID - USB\VID_04DF&PID_0007
dvi: InfName - C:\Windows\System32\DriverStore\FileRepository\hidusbfx2.inf_6fdcf923\hidusbfx2.inf
dvi: DevDesc - KMDF HID Minidriver for OSR USB-FX2 Device
dvi: DrvDesc - KMDF HID Minidriver for OSR USB-FX2 Device
dvi: Provider - UDAY BHASKAR
dvi: Mfg - UDAY BHASKAR
dvi: ModelsSec - Vendor.NTx86
dvi: InstallSec - hidusbfx2.Inst
dvi: ActualSec - hidusbfx2.Inst.NT
dvi: Rank - 0x0fff0001
dvi: Signer - testcertforwdk
dvi: Signer Score - Authenticode
dvi: DrvDate - 04/01/2006
dvi: Version - 6.0.9999.0
inf: Opened INF: ‘C:\Windows\System32\DriverStore\FileRepository\input.inf_53578522\input.inf’ ([strings.0409] )
inf: Saved PNF: ‘C:\Windows\System32\DriverStore\FileRepository\input.inf_53578522\input.PNF’ (Language = 0409)
dvi: Created Driver Node:
dvi: HardwareID - USB\Class_03&SubClass_01
dvi: InfName - C:\Windows\System32\DriverStore\FileRepository\input.inf_53578522\input.inf
dvi: DevDesc - USB Human Interface Device
dvi: DrvDesc - USB Human Interface Device
dvi: Provider - Microsoft
dvi: Mfg - (Standard system devices)
dvi: ModelsSec - Standard.NTx86
dvi: InstallSec - HID_Inst
dvi: ActualSec - HID_Inst.NT
dvi: Rank - 0x0dff3101
dvi: Signer - microsoft windows
dvi: Signer Score - INBOX
dvi: DrvDate - 06/21/2006
dvi: Version - 6.0.6000.16386
inf: Searched 2 potential matches in published INF directory
inf: Searched 27 INFs in directory: ‘C:\Windows\INF’
dvi: {Build Driver List - exit(0x00000000)} 03:22:22.561
ndv: Selecting best match…
dvi: {DIF_SELECTBESTCOMPATDRV} 03:22:22.561
dvi: No class installer for ‘Interlink RF Rece’
dvi: No CoInstallers found
dvi: Default installer: Enter 03:22:22.561
dvi: {Select Best Driver}
dvi: Selected driver installs from section [HID_Inst] in ‘c:\windows\system32\driverstore\filerepository\input.inf_53578522\input.inf’.
dvi: Class GUID of device changed to: {745a17a0-74d3-11d0-b6fe-00a0c90f57da}.
dvi: Set selected driver complete.
dvi: Selected:
dvi: Description - [USB Human Interface Device]
dvi: InfFile - [c:\windows\system32\driverstore\filerepository\input.inf_53578522\input.inf]
dvi: Section - [HID_Inst]
dvi: Signer - [microsoft windows]
dvi: Rank - [0x0dff3101]
dvi: {Select Best Driver - exit(0x00000000)}
dvi: Default installer: Exit
dvi: {DIF_SELECTBESTCOMPATDRV - exit(0x00000000)} 03:22:22.576
ndv: Driver selected, now performing install…

Experts kindly compare the log and indicate why my driver is not selected as the best match in case of Vista.

Regrets for lengthy postings. Included the log contents to make everything clear infront of you.

Regards.

Vista always loads INBOX driver. I also renamed the default INBOX driver to load the custom HID driver.

Is the WHQL signing only option left in my case. Can I get any Test Signatures from WHQL to see my driver loading without renaming any inbuilt drivers.

I wonder why WinXP is not bothering about catalog, signatures and Vista includes these things and gives low rank to my driver.

In the case of XP, it does not even searched for the default inbuilt driver. Experts kindly revert back with your opinions.

Regards.

Have you looked at the paper available here?

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

Or this page in general (for instance, the ever popular “How Device Installation Works”)?

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

Only reason I ask is anecdotal- I hear occasionally it’s underutilized…