INF Changes for PnP Device Redirection
This topic describes required changes to the device driver INF file to enable a device for redirection over the Terminal Server Plug and Play device redirection framework.
The Terminal Server Plug and Play device redirection framework is a new feature introduced in Microsoft Windows Vista and Microsoft Windows Server 2008. This framework provides the ability to make Plug and Play devices available to applications that are running on remote sessions over Terminal Server by using the Remote Desktop Protocol.
To be eligible for redirection over this framework, the device and its driver must meet the Windows Logo Program requirement DEVFUND-0010:
- DEVFUND-0010 Device and its driver supports redirection through a Terminal Services Session over the PnP Device Redirection Framework
For more information, see Windows Logo Program Device Requirements for Windows Vista and Windows Server 2008, listed in "Resources" at the end of this topic.
Microsoft provides an inbox INF file called ts_generic.inf on the Terminal Server that simply loads the Microsoft-supplied redirection driver, usbdr.dll, as the driver for the redirected device. This driver redirects any I/O calls between an application and the physical device on the client computer.
To support the full functionality of the device remotely, you must modify the device-specific INF file by adding certain redirection sections that combine the functionality of ts_generic.inf with any device-specific installation. Thus, the primary use of ts_generic.inf is to simplify the required changes to the device driver INF.
The following sections describe the required modifications to the device driver INF file. These modifications are required for two main reasons: On the server, to load the Microsoft redirection driver instead of the actual device driver; and on the client, to enumerate the device and make it available for redirection.
Identify the Hardware IDs of Devices to Support for Redirection
Starting with the local INF file for your device, enumerate the hardware IDs that it supports and identify the IDs that you want to support for redirection.
The device section of the INF file looks something like this:
[Generic.NTx86] "My Device A"=SectionA, HardwareIDA "My Device B"SectionB, HardwareIDB
In this example, the INF file lists two hardware/compatibility IDs, HardwareIDA and HardwareIDB. SectionA and SectionB are the INF sections to execute for device A and device B, respectively.
Add a Hardware ID for the Redirected Version of the Device
To support redirection for Device A, add its hardware ID prefixed with TS_ for the redirected version.
[Generic.NTx86] "My Device A"=SectionA, HardwareIDA "My Device B"=SectionB, HardwareIDB "My Redirected Device A"=SectionARedirected, TS_HardwareIDA
In this example, [SectionARedirected] is the section to execute for the device whose hardware ID is TS_HardwareIDA. The TS_ prefix is for hardware IDs for redirected devices.
Add INF Sections for the Redirected Version of the Device
Add the required sections for the new [SectionARedirected] section. Use Include= and Needs= directives to refer to the drivers and services section of ts_generic.inf. For example:
[SectionARedirected.hw] Include=ts_generic.inf Needs=TS_Generic_Install.hw ; Add any device specific information for your device. ; The information from [SectionARedirect.hw] such as ; registry entries may go here; but make sure not to include ; your own driver installation here. Your driver should be replaced ; by the redirection driver specified by the above lines. [SectionARedirected.Services] Include=ts_generic.inf Needs=TS_Generic_Install.Services ; Any services needed by the applications should go here. ; Copy required entries from [SectionA.Services]. [SectionARedirected.CoInstallers] Include=ts_generic.inf Needs=TS_Generic_Install.CoInstallers ; Copy required coinstaller entries from [SectionA.CoInstallers]. [SectionARedirected.Wdf] Include=ts_generic.inf Needs=TS_Generic_Install_WdfBasic UmdfServiceOrder=UsbDr
Register the Device as Available for Redirection
Note The functionality that is described in this section is planned for the next prerelease version of Windows Vista and Windows Server 2008, following Windows Vista Beta 2.
On a system that is running Terminal Server client (mstsc.exe), the user can display a list of supported Plug and Play devices that are registered as available for redirection. The device driver INF must contain a [TSRedirection.Registration] section for its device to appear in this list.
For example, to display Device A in the list of devices that are available for Plug and Play device redirection:
- Add the following section to the device driver INF file:
[TSRedirection.Registration];; Enable enumeration of the device by ; the TS Client Plug and Play device redirection UI;HKR,,"TSRedirFlags",0x10001,0x1
- 2.Add the following line to the [SectionA.hw] section to create the required registry key:
[SectionA.hw]; Other entries for Section AAddReg = TSRedirection.Registration
To enable the device for Terminal Server Plug and Play device redirection, the modified device driver INF file must be installed on both the Terminal Server client and the Terminal Server.
Distribute and install the modified device driver INF with your driver installation package so that just running the driver installation package on both the Terminal Server client and Terminal Server automatically installs the modified INF on the two systems.