coinstaller problem KMDF 1.9 on XP

I have a driver that uses KMDF 1.9, compiled with driver kit 7600.16385.1, ships with a product, and works on everything we’ve tested. One of the beta testers reported a failure on his windows XP computer. It looks like the problem starts when setupact.log prints “KMDF on-disk version”. What file or registry key does the coinstaller check when it prints that message?

His setupapi.log gives a generic:

#I163 Device not started: Device has problem: 0x27: CM_PROB_DRIVER_FAILED_LOAD.

But there is more useful information in setupact.log:

WdfCoInstaller: DIF_INSTALLDEVICE: Pre-Processing
WdfCoInstaller: ReadComponents: WdfSection for Driver Service dtusbser using KMDF lib version Major 0x1, minor 0x9
WdfCoInstaller: DIF_INSTALLDEVICE: Coinstaller version: 1.9.7600
WdfCoInstaller: GetControlKey: RegOpenKeyEx(HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Wdf\Kmdf\KmdfLibrary\Versions) failed: error(2) The system cannot find the file specified.
WdfCoInstaller: KMDF control key was not found
WdfCoInstaller: Using default name for KMDF service: Wdf01000
WdfCoInstaller: GetInMemoryVersionUlong: No information about in-memory KMDF version
WdfCoInstaller: DIF_INSTALLDEVICE: KMDF in-memory version: 0.0.0
WdfCoInstaller: GetLatestInstalledVersion: KMDF was not previously installed in the system
WdfCoInstaller: DIF_INSTALLDEVICE: KMDF on-disk version: 7340141.7209071.7209061
WdfCoInstaller: GetControlKey: RegOpenKeyEx(HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Wdf\Kmdf\KmdfLibrary\Versions) failed: error(2) The system cannot find the file specified.
WdfCoInstaller: KMDF control key was not found
WdfCoInstaller: Using default name for KMDF service: Wdf01000
WdfCoInstaller: CheckServiceInUse: Wdf01000 service could not be opened
WdfCoInstaller: DIF_INSTALLDEVICE: No need for reboot
WdfCoInstaller: DIF_INSTALLDEVICE: Update is not required. The on-disk KMDF version is newer than or same as the version of the coinstaller

I don’t know if KMDF ever existed on this system, but the on-disk version string is clearly bogus. I had him run the batchfile described in “Packaging and Deploying KMDF and UMDF Drivers”. The only files were:

c:\windows\system32\wdfapi.dll
c:\windows\system32\wdfmgr.exe

And he had no “services\wdf01000 Service” or “control\wdf Loader” registry key. Any ideas?

When we can’t find in-memory version information (which won’t exist for versions before 1.7), we check the on-disk version. That information is read from the KMDF runtime file (wdf01000.sys) in the drivers directory. I’m quite sure we don’t try to read it if we can’t load the file.

If it doesn’t show with a simple dir command, perhaps it has been hidden (we don’t ever do that). You might check with attrib command (or set explorer to show hidden and system files).

Skip this- I’m now quite sure this is a real bug in the 1.9 coinstaller. I am now officially having a truly superb, fine and wonderful day [well-deserved as it may or may not be]…

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Bob Kjelgaard
Sent: Friday, November 05, 2010 12:40 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] coinstaller problem KMDF 1.9 on XP

When we can’t find in-memory version information (which won’t exist for versions before 1.7), we check the on-disk version. That information is read from the KMDF runtime file (wdf01000.sys) in the drivers directory. I’m quite sure we don’t try to read it if we can’t load the file.

If it doesn’t show with a simple dir command, perhaps it has been hidden (we don’t ever do that). You might check with attrib command (or set explorer to show hidden and system files).


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

For a more useful summary of this:

You and your tester have reported a bug in the 1.9 KMDF coinstaller- I was able to identify the root cause already. Embarrassing as this is to admit, it can be hit anytime you install KMDF for the first time on a pre-Vista OS. It seems to have an extremely low probability of actually occurring, because that’s been done a lot, and this is the first time I’ve seen this reported. I also can’t characterize the trigger/catalyst that caused it to appear for you- this isn’t the time or place for speculation of that sort.

Your beta tester can work around by dropping wdf01000.sys (any version, e.g. copy one from some Vista or Win7 machine, for instance) into the drivers directory. Obviously not a long term solution, but if you want him/her unblocked, that should do the job.

I can’t set expectations for fixes, etc., it will take time for any such plan, anyway- so I’m not going to talk about that.

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@drewtech.com
Sent: Friday, November 05, 2010 12:21 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] coinstaller problem KMDF 1.9 on XP

I have a driver that uses KMDF 1.9, compiled with driver kit 7600.16385.1, ships with a product, and works on everything we’ve tested. One of the beta testers reported a failure on his windows XP computer. It looks like the problem starts when setupact.log prints “KMDF on-disk version”. What file or registry key does the coinstaller check when it prints that message?

His setupapi.log gives a generic:

#I163 Device not started: Device has problem: 0x27: CM_PROB_DRIVER_FAILED_LOAD.

But there is more useful information in setupact.log:

WdfCoInstaller: DIF_INSTALLDEVICE: Pre-Processing
WdfCoInstaller: ReadComponents: WdfSection for Driver Service dtusbser using KMDF lib version Major 0x1, minor 0x9
WdfCoInstaller: DIF_INSTALLDEVICE: Coinstaller version: 1.9.7600
WdfCoInstaller: GetControlKey: RegOpenKeyEx(HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Wdf\Kmdf\KmdfLibrary\Versions) failed: error(2) The system cannot find the file specified.
WdfCoInstaller: KMDF control key was not found
WdfCoInstaller: Using default name for KMDF service: Wdf01000
WdfCoInstaller: GetInMemoryVersionUlong: No information about in-memory KMDF version
WdfCoInstaller: DIF_INSTALLDEVICE: KMDF in-memory version: 0.0.0
WdfCoInstaller: GetLatestInstalledVersion: KMDF was not previously installed in the system
WdfCoInstaller: DIF_INSTALLDEVICE: KMDF on-disk version: 7340141.7209071.7209061
WdfCoInstaller: GetControlKey: RegOpenKeyEx(HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Wdf\Kmdf\KmdfLibrary\Versions) failed: error(2) The system cannot find the file specified.
WdfCoInstaller: KMDF control key was not found
WdfCoInstaller: Using default name for KMDF service: Wdf01000
WdfCoInstaller: CheckServiceInUse: Wdf01000 service could not be opened
WdfCoInstaller: DIF_INSTALLDEVICE: No need for reboot
WdfCoInstaller: DIF_INSTALLDEVICE: Update is not required. The on-disk KMDF version is newer than or same as the version of the coinstaller

I don’t know if KMDF ever existed on this system, but the on-disk version string is clearly bogus. I had him run the batchfile described in “Packaging and Deploying KMDF and UMDF Drivers”. The only files were:

c:\windows\system32\wdfapi.dll
c:\windows\system32\wdfmgr.exe

And he had no “services\wdf01000 Service” or “control\wdf Loader” registry key. Any ideas?


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

Bob Kjelgaard wrote:

You and your tester have reported a bug in the 1.9 KMDF coinstaller- I was able to identify the root cause already.

I’m guessing it was a dangling pointer or uninitialized variable,
because of this:

WdfCoInstaller: GetLatestInstalledVersion: KMDF was not previously installed in the system
WdfCoInstaller: DIF_INSTALLDEVICE: KMDF on-disk version: 7340141.7209071.7209061

Those numbers are the decimal representation of the Unicode string
“mponen”, likely from the word “component”…


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