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 (8)

  1. anony.muos says:

    Are the "Picture Acquisition SDK" as mentioned in MSDN and WPD API related? Is this "Picture Acquisition" another API for acquiring images?

  2. The "Picture Acquisition SDK" allows you to integrate photo acquisition in your application, and build plugins to extend picture acquisition functionality on Vista.  This SDK is specific to the Windows Vista Picture Acquisition component.

    The WPD API provides a more generic device communication infrastructure.  You can think of WPD as sitting in the lower level of the application stack compared to the Picture Acquisition SDK.  You can write an application to acquire images using WPD as well, and support additional content types and non-imaging devices that the Picture Acquisition SDK may not.

  3. axelriet says:

    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

  4. poornima11 says:

    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.

  5. poornima11 says:

    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.

  6. panreth says:

    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.

  7. panreth says:

    In continuation to my last post:

    I am building that sample application using VS 2005 and  I am using WINDOWS XP OS.

  8. Ahsan Ejaz says:

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