I had some trouble today with the Windows 7 WDK when I tried to install a driver on the checked build of Windows Vista x86. Actually I found the answer after searching around a little bit, but since all the information was scattered around, I thought it might be nice to put it all together under one roof.
Here are the basic facts:
- Vista SP2 comes with WDF version 1.7 while the Win7 WDK has version 1.9.
- When installing the driver on the checked build of an OS you must supply the checked build of the WDF coinstallers.
- The checked build of the coinstaller is named WdfCoInstaller01009_chk.dll but you have to rename it to WdfCoInstaller01009.dll in your installation package.
- The checked WDF coinstallers are not capable of updating Windows Vista.
- This means that they cannot upgrade the installed WDF version.
- This translates to this error message, if you attempt to install the driver:
Error 776: The client of a component requested an operation which is not valid given the state of the component instance. - And this means that you have to upgrade Vista WDF manually, reboot and then install your driver (still the installation package must include the checked coinstaller).
Here is how to do it in a nutshell:
- Open the checked coinstaller DLL in Visual Studio or any other tool capable of exporting resources.
- Export the WDFCAB_RESOURCE from RCDATA resources and save the file as a .cab file.
- Open the cab and extract the .EXE with the long name (Microsoft Kernel-Mode Driver Framework Install-v1.9-Win2k-WinXP-Win2k3.exe).
- Open an elevated command prompt and navigate in that directory. Step 5 will NOT work on a non elevated command prompt, although it requests UAC elevation.
- Execute: "Microsoft Kernel-Mode Driver Framework Install-v1.9-Win2k-WinXP-Win2k3.exe" /X
- A bunch of files are exported, among which are wdf01000.sys and wdfldr.sys.
- Now you must manually override these .sys files on the target system running on the checked build. This means you have to bypass SFP (System File Protection).
- Copy the existing files as a backup measure.
- Change the security of these two files so that (a) your account appears as the owner and (b) give your account Full Control (you have to do that explicitly - ownership is not enough).
- Override the two files with the checked versions of WDF 1.9.
- Pray and reboot :-)
- After rebooting install your driver.
Have fun :-)
Dimitris Staikos
Comments