20
Optimizing Device Optimizing Device Drivers For Terminal Drivers For Terminal Server’s Plug And Server’s Plug And Play Device Play Device Redirection Redirection Framework Framework Gaurav Daga Gaurav Daga Program Manager Program Manager Windows Terminal Server Windows Terminal Server Microsoft Corporation Microsoft Corporation

Optimizing Device Drivers For Terminal Servers Plug And Play Device Redirection Framework Gaurav Daga Program Manager Windows Terminal Server Microsoft

Embed Size (px)

Citation preview

Page 1: Optimizing Device Drivers For Terminal Servers Plug And Play Device Redirection Framework Gaurav Daga Program Manager Windows Terminal Server Microsoft

Optimizing Device Drivers Optimizing Device Drivers For Terminal Server’s For Terminal Server’s Plug And Play Device Plug And Play Device Redirection Framework Redirection Framework

Gaurav DagaGaurav DagaProgram ManagerProgram ManagerWindows Terminal ServerWindows Terminal ServerMicrosoft CorporationMicrosoft Corporation

Page 2: Optimizing Device Drivers For Terminal Servers Plug And Play Device Redirection Framework Gaurav Daga Program Manager Windows Terminal Server Microsoft

AgendaAgenda

IntroductionIntroduction

ArchitectureArchitecture

How to make your device How to make your device Terminal Server redirection readyTerminal Server redirection ready

Call to actionCall to action

Page 3: Optimizing Device Drivers For Terminal Servers Plug And Play Device Redirection Framework Gaurav Daga Program Manager Windows Terminal Server Microsoft

IntroductionIntroductionTerminal Server PnP device Terminal Server PnP device redirection frameworkredirection framework

New feature introduced in Windows Vista New feature introduced in Windows Vista and Windows Server codenamed “Longhorn”and Windows Server codenamed “Longhorn”

Aligned with Terminal Server vision Aligned with Terminal Server vision of providing rich remote experiencesof providing rich remote experiences

Ability to redirect certain types of PnP devices Ability to redirect certain types of PnP devices over Remote Desktop Connection or using over Remote Desktop Connection or using Remote ProgramsRemote Programs

Applications access PnP devices seamlessly Applications access PnP devices seamlessly regardless of whether they run locally or remotelyregardless of whether they run locally or remotely

Redirected devices scoped per sessionRedirected devices scoped per session

Page 4: Optimizing Device Drivers For Terminal Servers Plug And Play Device Redirection Framework Gaurav Daga Program Manager Windows Terminal Server Microsoft

IntroductionIntroductionTerminal Server PnP device Terminal Server PnP device redirection frameworkredirection framework

Generic infrastructure lets potentially any Generic infrastructure lets potentially any type of PnP device to be redirectedtype of PnP device to be redirected

Certain set of rules to be followed to write Certain set of rules to be followed to write supported device driverssupported device drivers

All rules required to write drivers based on new All rules required to write drivers based on new User-Mode Driver Framework (UMDF) applyUser-Mode Driver Framework (UMDF) apply

Windows Logo Program for devices Windows Logo Program for devices ascertains Terminal Server redirection ascertains Terminal Server redirection readiness of devicereadiness of device

Page 5: Optimizing Device Drivers For Terminal Servers Plug And Play Device Redirection Framework Gaurav Daga Program Manager Windows Terminal Server Microsoft

ArchitectureArchitecture

UMDF Host Process

MSTSC.exe

TS ServerTS ServerTS ClientTS Client

User modeUser mode

Kernel modeKernel mode

Original DeviceDriver Stack

Hardware

RDP protocol stack

Application

Device redirection componentsDevice redirection components

RDP protocol componentsRDP protocol components

User - Mode Driver Framework (UMDF)User - Mode Driver Framework (UMDF)

Real device componentsReal device components

PnP Redirector

IORedirector

UmRdpService

Redirection Driver

UMDFReflector

Bus

IO

Bus

IO

PnP

Events

PnP

Events IO

Rep

lay

IO R

epla

y

RD

P V

irtual Channel

RD

P V

irtual Channel

RD

P V

irtual Channel

RD

P V

irtual Channel

PnP

Pro

toco

lP

nP P

roto

col

Reflected IO

Reflected IO

IOIO

Page 6: Optimizing Device Drivers For Terminal Servers Plug And Play Device Redirection Framework Gaurav Daga Program Manager Windows Terminal Server Microsoft

How It Works?How It Works?Terminal Server PnP Device Terminal Server PnP Device Redirection FrameworkRedirection Framework

No actual device driver required on serverNo actual device driver required on serverUse Terminal Server redirection driver on serverUse Terminal Server redirection driver on server

Takes care of I/O and PnP traffic between actual device Takes care of I/O and PnP traffic between actual device driver on client and application on serverdriver on client and application on server

PnP and I/O notifications sent only to appropriate device PnP and I/O notifications sent only to appropriate device in correct sessionin correct session

Support for dynamically adding or removing Support for dynamically adding or removing devices while session is activedevices while session is active

Page 7: Optimizing Device Drivers For Terminal Servers Plug And Play Device Redirection Framework Gaurav Daga Program Manager Windows Terminal Server Microsoft

Inbox Supported Inbox Supported Device CategoriesDevice CategoriesFor Windows VistaFor Windows Vista

Windows Portable Devices (WPD)Windows Portable Devices (WPD)MTP (Media Transfer Protocol) and PTP MTP (Media Transfer Protocol) and PTP (Picture Transfer Protocol)-based devices(Picture Transfer Protocol)-based devices

Windows Embedded for POS (Point of Windows Embedded for POS (Point of Service) DevicesService) Devices

Using Microsoft POS for .NET 1.1Using Microsoft POS for .NET 1.1

Page 8: Optimizing Device Drivers For Terminal Servers Plug And Play Device Redirection Framework Gaurav Daga Program Manager Windows Terminal Server Microsoft

Terminal Server PnP Terminal Server PnP Device RedirectionDevice Redirection

Page 9: Optimizing Device Drivers For Terminal Servers Plug And Play Device Redirection Framework Gaurav Daga Program Manager Windows Terminal Server Microsoft

RequirementsRequirementsMake your device Terminal Server Make your device Terminal Server redirection compliantredirection compliant

Follow UMDF guidelinesFollow UMDF guidelines

Follow Terminal Server redirection guidelinesFollow Terminal Server redirection guidelines

Modify your driver INFModify your driver INF

Get LogoGet LogoDepends on whether your device category Depends on whether your device category in WDK includes the Terminal Server in WDK includes the Terminal Server redirection Logo testredirection Logo test

Page 10: Optimizing Device Drivers For Terminal Servers Plug And Play Device Redirection Framework Gaurav Daga Program Manager Windows Terminal Server Microsoft

RequirementsRequirementsUMDF guidelinesUMDF guidelines

Do use only I/O manager APIs Do use only I/O manager APIs to communicate between driver to communicate between driver and applicationand application

Do not pass kernel objects Do not pass kernel objects between driver and applicationbetween driver and application

Do not pass data pointers for Do not pass data pointers for pre-allocated shared kernel bufferspre-allocated shared kernel buffers

Page 11: Optimizing Device Drivers For Terminal Servers Plug And Play Device Redirection Framework Gaurav Daga Program Manager Windows Terminal Server Microsoft

RequirementsRequirementsTerminal Server redirection guidelinesTerminal Server redirection guidelines

Do not assume any kind of locality of referenceDo not assume any kind of locality of referenceDo not use shared memory Do not use shared memory

Do not use registryDo not use registry

Do allow your 32-bit driver to be able to talk to Do allow your 32-bit driver to be able to talk to your 64-bit application and vice-versayour 64-bit application and vice-versa

Do not have strict timing expectations Do not have strict timing expectations in responsesin responses

Do allow multiple simultaneous access to deviceDo allow multiple simultaneous access to device

Do allow normal user context access to deviceDo allow normal user context access to device

Page 12: Optimizing Device Drivers For Terminal Servers Plug And Play Device Redirection Framework Gaurav Daga Program Manager Windows Terminal Server Microsoft

RequirementsRequirementsModify your driver INFModify your driver INF

On the server, the driver INF should load On the server, the driver INF should load the TS redirection driver instead of the the TS redirection driver instead of the actual device driveractual device driver

On the client, the driver INF should On the client, the driver INF should register the device as being availableregister the device as being availablefor redirectionfor redirection

Only then the TS Client UI will enumerateOnly then the TS Client UI will enumerateit in the list of supported PnP devicesit in the list of supported PnP devicesfor redirection for redirection

Page 13: Optimizing Device Drivers For Terminal Servers Plug And Play Device Redirection Framework Gaurav Daga Program Manager Windows Terminal Server Microsoft

Modifying Driver INFModifying Driver INF

Page 14: Optimizing Device Drivers For Terminal Servers Plug And Play Device Redirection Framework Gaurav Daga Program Manager Windows Terminal Server Microsoft

RequirementsRequirementsGet logoGet logo

Applicable only to Windows Portable Applicable only to Windows Portable Devices for Windows VistaDevices for Windows Vista

Requires two machine logical Requires two machine logical client/server setupclient/server setup

Client/Server can both be Windows VistaClient/Server can both be Windows VistaRequire modified driver INFRequire modified driver INF

WDK lab at room 617 tomorrow at 9 amWDK lab at room 617 tomorrow at 9 am

Page 15: Optimizing Device Drivers For Terminal Servers Plug And Play Device Redirection Framework Gaurav Daga Program Manager Windows Terminal Server Microsoft

Future TechnologyFuture Technology

Page 16: Optimizing Device Drivers For Terminal Servers Plug And Play Device Redirection Framework Gaurav Daga Program Manager Windows Terminal Server Microsoft

Future TechnologyFuture TechnologyTerminal Server PnP Device Terminal Server PnP Device Redirection FrameworkRedirection Framework

Inbox support for more categories Inbox support for more categories of PnP devicesof PnP devices

Windows Mobile devices, scanners, etc.Windows Mobile devices, scanners, etc.

Generalization of Windows Driver Kit Generalization of Windows Driver Kit Terminal Server redirection Logo testTerminal Server redirection Logo test

More device categories to be addedMore device categories to be added

Inclusion of checks in driver development Inclusion of checks in driver development tools like PREfast for driverstools like PREfast for drivers

Page 17: Optimizing Device Drivers For Terminal Servers Plug And Play Device Redirection Framework Gaurav Daga Program Manager Windows Terminal Server Microsoft

Call To ActionCall To Action

For your device drivers on Windows Vista For your device drivers on Windows Vista and beyondand beyond

Follow UMDF guidelinesFollow UMDF guidelines

Follow TS redirection guidelinesFollow TS redirection guidelines

Modify your driver INFModify your driver INF

Get Logo (if applicable)Get Logo (if applicable)

Page 18: Optimizing Device Drivers For Terminal Servers Plug And Play Device Redirection Framework Gaurav Daga Program Manager Windows Terminal Server Microsoft

Additional ResourcesAdditional Resources

Web ResourcesWeb ResourcesDEVFUND-0010 in Windows Logo Program Device Requirements DEVFUND-0010 in Windows Logo Program Device Requirements for Windows Vista and Windows Server codenamed “Longhorn”:for Windows Vista and Windows Server codenamed “Longhorn”:http://www.microsoft.com/http://www.microsoft.com/whdc/winlogo/hwrequirements.mspxwhdc/winlogo/hwrequirements.mspx White paper on Device Driver INF Changes for Plug and Play White paper on Device Driver INF Changes for Plug and Play Device Redirection on Terminal Server: Device Redirection on Terminal Server: http://www.microsoft.com/http://www.microsoft.com/whdc/driver/install/ts_redirect.mspxwhdc/driver/install/ts_redirect.mspx

Related SessionsRelated SessionsAsk The Experts session at noon tomorrowAsk The Experts session at noon tomorrowWindows Driver Kit Lab: Room 617 at 9 am on 05/25/2006Windows Driver Kit Lab: Room 617 at 9 am on 05/25/2006User-Mode Driver Framework: Introduction and OverviewUser-Mode Driver Framework: Introduction and OverviewUser-Mode Driver Framework: Technical SynopsisUser-Mode Driver Framework: Technical SynopsisUser-Mode Driver Framework LabUser-Mode Driver Framework Lab

For further questions on the Terminal Server PnP Device For further questions on the Terminal Server PnP Device Redirection Framework, please send e-mail to:Redirection Framework, please send e-mail to:tspnp @ microsoft.comtspnp @ microsoft.com

Page 19: Optimizing Device Drivers For Terminal Servers Plug And Play Device Redirection Framework Gaurav Daga Program Manager Windows Terminal Server Microsoft

© 2006 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.

Page 20: Optimizing Device Drivers For Terminal Servers Plug And Play Device Redirection Framework Gaurav Daga Program Manager Windows Terminal Server Microsoft