Skip to content
This repository has been archived by the owner on Nov 18, 2023. It is now read-only.

Examples showing use of Remote Desktop Sharing and `IRDPSRAPITransportStream`

License

Notifications You must be signed in to change notification settings

mgaffigan/RemoteAssistanceSample

Repository files navigation

Windows Desktop Sharing Samples

Examples showing use of Windows Desktop Sharing.

Samples from MSDN

Taken from Writing a Desktop Sharing Application - Remote Desktop Services Blog (Alternate Link.

Useful Q&A found at Windows Desktop Sharing API - Remote Desktop Services Blog (Alternate Link)

Samples showing use of IRDPSRAPITransportStream

RdpDsViewer provides an example of a pluggable transport being used. The example only sends the data in-process, but the same could occur across the network.

One notable aspect is that calls to IRDPSRAPITransportStreamEvents must take place either during a call to a method of IRDPSRAPITransportStream or with the COM Context captured during a call to IRDPSRAPITransportStream (usually Open). Normal COM Marshalling is insufficient. The UI STA thread is unacceptable. Calls from the wrong thread will result in E_FAIL being returned by QueryInterface on a call to IRDPSRAPITransportStreamEvents.

Apparent semantics observed:

  • Calls to IRDPSRAPITransportStream come from MTA worker thread run by RDP dll
  • Calls to IRDPSRAPITransportStreamEvents
    • Succeed when on the IRDPSRAPITransportStream worker thread
    • Succeed when invoking the COM Context captured from the RDP Worker thread (which will not invoke back to the worker thread - but a new one)
    • Fail from the UI STA Thread
    • Fail from the ThreadPool
    • Fail from a new background STA Thread
    • Fail from a new background MTA Thread
  • Reads are serialized
  • Writes are concurrent, but must be delivered in order
  • Close is asynchronous and may occur during a read or write (buffers can be freed while a read or write are pending)
  • IRDPSRAPITransportStream.ReadBuffer PayloadSize represents the maximum number of bytes to read. PayloadSize should be set to the number of read bytes before calling IRDPSRAPITransportStreamEvents.OnReadCompleted.

About

Examples showing use of Remote Desktop Sharing and `IRDPSRAPITransportStream`

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages