6.1.3 Establishing a Dynamic Virtual Channel for Plug and Play Device Redirection

Click here to view in the context of the full document

One common scenario for using a dynamic virtual channel (DVC) involves redirecting data from a Plug and Play device that is connected to an RDP Client after a user session has been established. After the Remote Desktop Protocol (RDP) connection has been made with the DVC, components of the RDP Client and TSServer find the device and redirect the data as follows:

  1. The RDP Client starts listening on a known static virtual channel that is being used for DVC communications.

  2. A Virtual Plug and Play module on the RDP Client registers itself to be the handler of redirected Plug and Play communication. The module also registers itself to handle events related to Plug and Play devices located on the RDP Client.

  3. On the TS Server, the registration of a device that can be redirected has already been established. When an application attempts to communicate with a redirected device, the I/O manager on the TS Server creates a link between the application on the TS Server and the Virtual Function Driver on the TS Server.

  4. The Virtual Function Driver on the TS Server uses a DVC to the Virtual Function Driver on the RDP Client.

  5. The application on the TS Server sends and receives I/O to and from the Virtual Function Driver representing the device.

  6. The Virtual Function Driver routes the I/O to the Virtual Function Driver on the RDP Client.

  7. The Virtual Plug and Play module on the RDP Client routes the I/O to the real Function Driver registered on the RDP Client.

The following figures illustrate the process of establishing a DVC that is then used for redirecting data from a Plug and Play device located on the RDP Client.

869695b6-089e-4e3e-bb0d-c7b10b87ae54

Figure 26: Sequence establishing a dynamic virtual channel for Plug and Play redirection

The following steps describe the sequence of establishing a DVC.

  1. The TS Server sends a Capabilities protocol data unit (PDU) that indicates the maximum supported version level as well as any capability information that is relevant for the supported version.

  2. The RDP Client responds with a Capabilities Response PDU that states the maximum version level that it supports.

  3. The TS Server and RDP Client exchange Create Request and Create Response PDUs to establish the DVC for Plug and Play redirection.

  4. The RDP Client sends data from the Plug and Play device to the TS Server (as described in the next portion of this section).

  5. To close the channel, the TS Server sends a Close Request PDU for the DVC.

  6. The RDP Client responds with a Close Response PDU.

  7. After the RDP connection sequence has begun and a DVC has been established, data from a Plug and Play device is redirected as shown in the following diagram.

a30983e5-a52b-4f2e-aabe-bd7d3d6dd646

Figure 27: Detailed sequence establishing dynamic virtual channel

d304ea4f-430b-4e57-b0a3-b4db978034a8

Figure 28: Sequence for redirecting Plug and Play device data

The following steps describe the sequence of adding a Plug and Play device to the RDP Client, transferring data to and from the device, and removing the device from the RDP Client.

  1. The TS Server exposes its capabilities and version information to the RDP Client after the RDP connection is initialized.

  2. The RDP Client responds by sending its capabilities and version information.

  3. When the Plug and Play device is physically added to the RDP Client, the TS Server sends an Authenticated Client message to the RDP Client.

  4. The RDP Client responds with a Client Device Additions message.

  5. The TS Server sends a Capabilities Request message to the RDP Client.

  6. The RDP Client responds by exposing its capabilities.

  7. Depending on the Plug and Play device added, device IO messages such as File Create/Read/Write/IO Control Request messages can be sent from the TS Server to the RDP Client.

  8. The RDP Client responds with File Create/Read/Write/IO Control Response messages.

  9. The RDP Client can send Custom Event messages to the TS Server with details.

  10. Depending on the RDP Client message, the TS Server will send a Specific IO Cancel Request message.

  11. When the Plug and Play device is physically removed from the RDP Client, the TS Server will send the Authenticated Client message to the RDP Client.

  12. The RDP Client responds by sending a Client Device Removal message.

d8f0e7e4-3adf-4fd2-ab3e-f9278709de7d

Figure 29: Detailed sequence for redirecting data from a Plug and Play device

 

Click here to view in the context of the full document

Show: