Compartilhar via


Installing the Sample Drivers on XP and Vista

A question was raised today on how to run the WPD sample drivers on Windows XP.    WPD drivers and applications can run downlevel on Windows XP as long as the WPD and UMDF runtimes are both installed.

 

Compiling a WPD Driver for your OS

For the driver to run on Windows XP, it has to be built using a Windows XP x86 build environment provided by the Windows Driver Kit (v6000 or later).   Similarly, for running on Windows Vista, use one of the Windows Vista build environments.

If the runtime OS does not match the build environment, you may get a "Code 10 - This Device Cannot Start" in error message in Device Manager after installing the driver.

 

Installing WPD on the XP machine

Either one of these supply the WPD runtime components for Windows XP:

1. Install Windows Media Player 11, or

2. Install the Windows Media Format SDK 11 redistributable: WMFDist11-WindowsXP-X86-ENU.exe package, typically under c:\WMSDK\WMFSDK11\Redist folder from a Windows Media Format 11 SDK install.

 

Obtaining the WUDF Co-Installer

The UMDF runtime is distributed and installed by referencing its co-installer in the driver INF.   For Windows Vista and XP, the recommended co-installer to use is the version that is distributed in the Windows Driver Kits: under the \WinDDK\6001.xxxxx\redist\wdf\ folder.   Copy this to the same location as your updated driver INF before installing your driver.

 

Modifying the Sample Driver INF

The following example shows the INF changes to enable the WpdHelloWorldDriver to install in Windows XP using the v1.7 UMDF co-installer.   The actual version number would depend on what was provided in the WDK.  The modified/added entries are highlighted in red, and the same updates would apply to both WPD driver samples.

The changes involve adding a CopyFiles directive that references WUDFUpdate_01007.dll, and updating the AddReg entries to use UMDF v1.7.

[SourceDisksFiles]
WpdHelloWorldDriver.dll=1
WUDFUpdate_01007.dll=1
...

[Basic_Install.CoInstallers]
AddReg=Basic_Install.CoInstallers_AddReg
CopyFiles=CoInstallers_CopyFiles
...

; Add the co-installer DLL to the CopyFiles list
[CoInstallers_CopyFiles]
WUDFUpdate_01007.dll

...

; Update the registration to use the correct binary
[Basic_Install.CoInstallers_AddReg]
HKR,,CoInstallers32,0x00010000,"WUDFUpdate_01007.dll"

...

; Update the UMDF version to 1.7.0
[WpdHelloWorldDriver_Install]
UmdfLibraryVersion=1.7.0

...

; Set the Co-Installer CopyFiles destination to system32
[DestinationDirs]
System32Copy=12,UMDF ; copy to system32\drivers\umdf
Basic_Install.CoInstallers_CopyFiles=11
...

 

The same updated INF will also work on Windows Vista, as long as the UMDF co-installer DLL is provided with your driver files during install AND you've compiled the driver DLL with the correct WDK build environment (see the first section of this post).  

On Windows Vista, installing the WPD runtime components is not required because WPD is available inbox for most SKUs.

 

This posting is provided "AS IS" with no warranties, and confers no rights.

Comments

  • Anonymous
    April 11, 2007
    Are the "Picture Acquisition SDK" as mentioned in MSDN and WPD API related? Is this "Picture Acquisition" another API for acquiring images?

  • Anonymous
    April 15, 2007
    The comment has been removed

  • Anonymous
    November 12, 2008
    Hello WPD team, I'm running into trouble getting my application to work on XP. The app works perfectly on Vista, so does the WpdApiSample.exe from the SDK. On XP, after installing WMFDist11-WindowsXP-X86-ENU.exe, the device count is always 0, despite that the device - a digital camera - is properly recognized and shows up properly in "Scanners and Camera". I get no errors at all, but RefreshDeviceList()+GetDevices(NULL, &nDevices) always returns zero, like the WPD runtime did not detect the camera's arrival. The WpdApiSample.exe does not detect the device either. This only happens on XP SP3/SP3, on Vista everything works fine. Is there something I must install besides WMFDist11-WindowsXP-X86-ENU.exe in order to get my application to work on XP? If yes, where do I get what's needed? Thanks in advance, Axel

  • Anonymous
    December 01, 2008
    Hi, I am also facing similar kind of probelm. I've built WPD-Health Vault driver given as part of the WDK-6001 sample code. I am able to build and install the driver. However, not able to receive the data from the device. Devlopment system in Windows XP. Driver was built using 'Windows XP' environment and also using 'Vista' environment and problem was seen in both the cases. With WDK-6000, driver works fine. Any help on this will be appreciated. Thanks.

  • Anonymous
    December 01, 2008
    Hi, Just to add more clarity to my post, the device referred here is a virtual device as part of the sample driver code. During driver installation, the hardcoded device data has to be imported into the WPD application. This importing of the data is failing. Basically, am not able to connect the UMDF service to my driver (using Visual studio  2005 debugger) after driver is installed. Have I missed installaing something over WDK-6001? Thanks again.

  • Anonymous
    December 23, 2008
    Hi, I have downloaded the WINDOWS SDK for vista in my XP machine. When I compile the WpdAPISample application at that time i am getting rhis error message " fatal error C1083: Cannot open include file: 'PortableDeviceApi.h': No such file or directory". I thought it was because of  PortableDeviceGuids.lib not there in the project,but even after adding this libaray i am still getting the same error message. Please help me out.

  • Anonymous
    December 23, 2008
    In continuation to my last post: I am building that sample application using VS 2005 and  I am using WINDOWS XP OS.

  • Anonymous
    July 21, 2014
    If you read ReadMe.txt file , they say clearly that this library works  on window vista and window 7 only , not on xp