Driver ranking

Hi,

I’m trying to filter WPD devices on Vista and so am attempting to write a UMDF filter driver above a UMDF function driver, based on the WDK sample.

My driver installs file, and references sections from wpdmtp.inf. I set the hwid to match my Nexus 7 test device.

Now when I plug the device in the setup api indicates that my driver is being selected along with the original wpdmtp.inf, but that wins because it has a better ranking as its signer score is inbox whereas mine is authenticode. It appears that if I obtained WHQL certification, my driver would be chosen, but is it possible to get my test driver chosen so I can prove the concept? I’ve included my setupapi log for info (the inf is still named as the sample - wudfosrusbfilteronumfx2driver.inf)

Hope you can help,
Mike

>> [Device Install (Hardware initiated) - USB\VID_18D1&PID_4E44&MI_00\7&286304e&0&0000]
>> Section start 2014/03/20 09:17:19.427
ump: Creating Install Process: DrvInst.exe 09:17:19.427
ndv: Retrieving device info…
ndv: Setting device parameters…
ndv: Building driver list…
dvi: {Build Driver List} 09:17:19.458
dvi: Searching for hardware ID(s):
dvi: usb\vid_18d1&pid_4e44&rev_9999&mi_00
dvi: usb\vid_18d1&pid_4e44&mi_00
dvi: Searching for compatible ID(s):
dvi: usb\class_06&subclass_01&prot_01
dvi: usb\class_06&subclass_01
dvi: usb\class_06
dvi: Enumerating INFs from path list ‘C:\Windows\INF’
inf: Opened INF: ‘C:\Windows\System32\DriverStore\FileRepository\wpdmtp.inf_20006c56\wpdmtp.inf’ ([strings.0409] )
inf: Saved PNF: ‘C:\Windows\System32\DriverStore\FileRepository\wpdmtp.inf_20006c56\wpdmtp.PNF’ (Language = 0409)
dvi: Created Driver Node:
dvi: HardwareID - USB\Class_06&SubClass_01&Prot_01
dvi: InfName - C:\Windows\System32\DriverStore\FileRepository\wpdmtp.inf_20006c56\wpdmtp.inf
dvi: DevDesc - Digital Still Camera
dvi: DrvDesc - Digital Still Camera
dvi: Provider - Microsoft
dvi: Mfg - (Standard MTP-compliant devices)
dvi: ModelsSec - Generic.NTx86
dvi: InstallSec - MTP
dvi: ActualSec - MTP.NT
dvi: Rank - 0x0dff2000
dvi: Signer - microsoft windows
dvi: Signer Score - INBOX
dvi: DrvDate - 06/21/2006
dvi: Version - 6.0.6000.16386
inf: Opened INF: ‘C:\Windows\System32\DriverStore\FileRepository\wudfosrusbfilteronumfx2driver.inf_d2137066\wudfosrusbfilteronumfx2driver.inf’ ([strings] )
inf: Saved PNF: ‘C:\Windows\System32\DriverStore\FileRepository\wudfosrusbfilteronumfx2driver.inf_d2137066\wudfosrusbfilteronumfx2driver.PNF’ (Language = 0409)
dvi: Created Driver Node:
dvi: HardwareID - USB\VID_18D1&PID_4E44&MI_00
dvi: InfName - C:\Windows\System32\DriverStore\FileRepository\wudfosrusbfilteronumfx2driver.inf_d2137066\wudfosrusbfilteronumfx2driver.inf
dvi: DevDesc - Microsoft UMDF OSR Usb Sample Device With Filter on User-mode Driver
dvi: DrvDesc - Microsoft UMDF OSR Usb Sample Device With Filter on User-mode Driver
dvi: Provider - Microsoft Internal (WDF:UMDF)
dvi: Mfg - Microsoft Internal (WDF:UMDF)
dvi: ModelsSec - Microsoft.NTx86
dvi: InstallSec - OsrUsb_Install
dvi: ActualSec - OsrUsb_Install.NT
dvi: Rank - 0x0fff0001
dvi: Signer - wdktestcert mike,130268288603464192
dvi: Signer Score - Authenticode
dvi: DrvDate - 03/20/2014
dvi: Version - 9.11.4.221
inf: Searched 2 potential matches in published INF directory
inf: Searched 27 INFs in directory: ‘C:\Windows\INF’
dvi: {Build Driver List - exit(0x00000000)} 09:17:19.817
ndv: Selecting best match…
dvi: {DIF_SELECTBESTCOMPATDRV} 09:17:19.817
dvi: Using exported function ‘WpdClassInstaller’ in module ‘C:\Windows\system32\wpd_ci.dll’.
dvi: Class installer == wpd_ci.dll,WpdClassInstaller
dvi: No CoInstallers found
dvi: Class installer: Enter 09:17:19.817
dvi: Class installer: Exit
dvi: Default installer: Enter 09:17:19.817
dvi: {Select Best Driver}
dvi: Selected driver installs from section [MTP] in ‘c:\windows\system32\driverstore\filerepository\wpdmtp.inf_20006c56\wpdmtp.inf’.
dvi: Class GUID of device changed to: {eec5ad98-8080-425f-922a-dabf3de3f69a}.

I’m not sure exactly what you’re trying to prove, but IIRC there IS a group policy that you can use to change the way driver ranking works… specifically so it does not favor WHQL signed devices over devices that provide a “better match.”

Peter
OSR
@OSRDrivers

Thanks for the reply, I’ll see if I can find it.

I trying to add a filter for wpd devices, e.g. IOCTL_WPD_MESSAGE_READ_ACCESS. I have a KMDF driver for Windows 7+ and this works, but it doesn’t work on Vista and I think this is because UMDF couldn’t accept upper KM filters until UMDF V1.9, and even then they need to specify they do in their inf files via UmdfKernelModeClientPolicy = AllowKernelModeClients.

Umdf comes with its own coinstaller that can bring the new runtime down level. Just install 1.9 when your filter is installed

d

Bent from my phone


From: xxxxx@yahoo.co.ukmailto:xxxxx
Sent: ?3/?20/?2014 6:20 AM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: RE:[ntdev] Driver ranking

Thanks for the reply, I’ll see if I can find it.

I trying to add a filter for wpd devices, e.g. IOCTL_WPD_MESSAGE_READ_ACCESS. I have a KMDF driver for Windows 7+ and this works, but it doesn’t work on Vista and I think this is because UMDF couldn’t accept upper KM filters until UMDF V1.9, and even then they need to specify they do in their inf files via UmdfKernelModeClientPolicy = AllowKernelModeClients.


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

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</mailto:xxxxx></mailto:xxxxx>

Thanks for the reply Doron,

Sorry I’m not following “runtime down level” - will installing V1.9 fix it so my KMDF upper class driver should run? or fix the original driver selection issue so no need to apply the GPO?

Thanks again Peter,
I found the article you referred to (http://msdn.microsoft.com/en-us/library/windows/hardware/ff537759(v=vs.85).aspx) and applying the GPO setting has worked a treat, my UMDF filter over the wpd function driver is working a treat under Vista.

By installing umdf 1.9 you enable the use of your km filter. The restriction is tied to the umdf version number, not to the is itself

d

Bent from my phone


From: xxxxx@yahoo.co.ukmailto:xxxxx
Sent: ?3/?20/?2014 8:15 AM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: RE:[ntdev] Driver ranking

Thanks for the reply Doron,

Sorry I’m not following “runtime down level” - will installing V1.9 fix it so my KMDF upper class driver should run? or fix the original driver selection issue so no need to apply the GPO?

Thanks again Peter,
I found the article you referred to (http://msdn.microsoft.com/en-us/library/windows/hardware/ff537759(v=vs.85).aspx) and applying the GPO setting has worked a treat, my UMDF filter over the wpd function driver is working a treat under Vista.


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

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</mailto:xxxxx></mailto:xxxxx>

I tried that and the device fails to start (error 10). I would prefer to get the KM filter working if you could guide me into what to look for.

This is what I have done so far:

Vista SP2 x86
Installed KB2761494 to update the to 1.11
Installed my driver as I do on Windows 7 (which works). This follows:http://msdn.microsoft.com/en-us/library/windows/hardware/ff547595(v=vs.85).aspx
Insert my test device - I see my driver in the device’s drivers list and via WPP I see AddDevice is called but that is it. I’ve taken all the custom code out to leave it just as the toaster sample but the driver still fails to start.

Where would be the best place to find out what is happening?

Turning on wdf tracing (with wdftrace) and reinserting the device I see:

PNP start failed with 0xc0000182(STATUS_DEVICE_CONFIGURATION_ERROR)

> Sorry I’m not following “runtime down level”

This means UMDF runtime 1.9 can be auto-installed to Vista.


Maxim S. Shatskih

Microsoft MVP on File System And Storage

xxxxx@storagecraft.com

http://www.storagecraft.com