Presentation Virtualization: Graphics Remoting Today and Tomorrow

ES21
 Nadim Abdo
Principal Development
Manager
Microsoft Corporation
 Gaurav Daga
Senior Program
Manager Lead
Microsoft Corporation
Agenda









Vista and Windows Server 2008 era







Remoting scenarios enabled by RDP








Graphics Virtual
Channels (VCs)
Mouse &
Keyboard VCs
Device
VCs
Partner
Virtual Channel
Plug-Ins
Virtual Channel Multiplexing and Framing
Bulk Compression (RDP5+, RDP6.0, RDP6.1)
Security Layer (SSL/Kerberos/NTLM)
Transport Layer (e.g. TCP, RPC/HTTP, Windows Live Tunnel)
Trends affecting presentation remoting








What is new in Windows 7?





RDP Platform Improvements
Windows 7 Aero
Direct2D &
Direct 3D 10.1
True Multimon
Support
RDP Core
Performance
Improvements
Multimedia:
Media Foundation
Multimedia:
DirectShow
Low latency Audio
Playback
Bi –directional
Audio



Deep dive into RDP Graphics Architecture














D2D App
DX10.1 App
Media App
DWMcore.DLL
TSMF.DLL
GDI App
TS Dynamic Virtual Channels
Efficient GDI
Stream
DX Runtime
RDPD3D.DLL
DWM
KERNEL
Apps
RDP
OS
Efficient Command
Streams
USER
Win32k.sys (USER/GDI)
RDPDD (Display Driver)
RDP Driver Stack
Transport: (TCPIP.Sys)
To RDP
Client
RDP Client Rendering
RDP Host Rendering
Direct2D
WPF
Direct 3D: 10.1
Silverlight
Efficient Media
Flash
Requires: Codecs on Client
Content cannot have DRM
or licensing
All other media
GDI
Direct 3D <10.1
Bandwidth Improvement per release
180
160
140
120
100
XP (RDP 5.2)
Vista (RDP 6.0)
80
60
40%
Gain!
40
20
0
Executive PPT
Windows 7 (RDP 7.0)
Bandwidth - Kbps
6
5
4
3
65%
Drop
XP (RDP 5.2)
Vista (RDP 6.0)
Windows 7 (RDP 7.0)
2
1
0
Typing and Scrolling
Scrolling




RDP Platform



How to extend RDP
API Walkthroughs
API family overview











Intro and usage






Intro and usage





WTSVirtualChannelOpenEx
(..,WTS_CHANNEL_OPTION_DYNAMIC)
WTSVirtualChannelQuery

ReadFile/WriteFile
Client-side usage
HKCU\Software\Microsoft\Terminal
Server Client\Default\AddIns
pChanMgr->CreateListener(Name,
pMyCallback)
::OnNewChannelConnection(pChannel)
IWTSVirtualChannel::Write(cbSize, buf)
CMyChannel::OnDataReceived(cbSize, buf)







How to make your apps run efficiently in a
remote session
Basics
Consider scaling down expensive graphics in remote
e.g., Animations
 Detect if the session is remote:

Managed:
System.Windows.Forms.SystemInformation.TerminalServerS
ession
Win32:
GetSystemMetrics(SM_REMOTESESSION)
Consider session transitions
 Leverage RDP Compression GP’s
 30-40% bandwidth savings
 Important to test your app remotely!

GDI

Guidance for offscreen surfaces



Layered Windows can be very expensive


Do NOT use Screen capture - GetDC(NULL)



Remoting Direct 3D and Direct2D
Use Direct2D – has efficient command remoting
 Direct3D Apps: Use DX10.1 and DXGI 1.1 (DirectX
Graphics Infrastructure)
CreateDXGIFactory1(…);
pFactory->EnumAdapters1(i, &pAdapter)
pAdapter->GetDesc1(&Desc);
BOOL IsRemote = Desc.Flags &
DXGI_ADAPTER_FLAG_REMOTE;
 Use the new IsCurrent() API to handle session
transitions and discover new adapters
 Tip: Local optimizations are magnified remotely!







http://blogs.msdn.com/ts

http://connect.microsoft.com/tsappcompat

http://www.microsoft.com/ts
www.microsoftpdc.com
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market
conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.
MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.