From the DDK documentation:

"Fast User Switching works by allowing multiple virtual display drivers to
run at the same time. (Each virtual display driver is associated with a
particular PDEV.)"

Is this true for mirror drivers as well? Could one install a mirror driver
and then, while more than one user is logged in, capture those users'
screens? (assuming things like memory mapping etc. are properly implemented
in the mirror driver)

And another question just out of curiosity, how is this implemented for
drivers that actually control real hardware? Would the driver have to share
its video memory amongst those sessions or is only the glass/physical
terminal be able to use the video hardware?

Thanks in advance

Re: Mirror driver and Terminal Services/FUS by Ivan

Ivan
Tue Jun 05 18:50:47 CDT 2007

Let's start from the beginning:

Each Session can be in different states and attached to different classes of
video devices.
Classes of video devices are: local, remote, disconnect
States are: connected, disconnected.
Terminal Server components (LSM.exe and/or termsrv.dll) controls the state
of a session, and it uses csrss.exe to driver the state transitions.

Example: a session attached to a remote terminal (remote video device class)
can be connected or disconnected (think about the case where you kill the
TS-Client).

A session attached to a glass terminal can be switched to the
disconnect video device class, for example as part of a FUS transition,
and then be switched to the disconnected state.

Root enumerated and/or bus enumerated display devices are global,
that means that they exists for all sessions, and independently from them.
For example, in a given machine you may have \\.\Display0, \\.\Display1
\\.\Display3, \\.\DisplayV1, \\.\DisplayV2, and \TsDisc,
each representing the VgaSafe device, the two heads of your video-card,
a couple of mirror drivers, and the disconnected display device.
[I will not discuss the VgaSafe issues with XPDM/LDDM and/or the
differencies between the Dual-View and Dual-Head].

On top of that, for each session, you have a current video configuration
being active.
For example, you may have:

Session - 0:
Attached to the \TsDisc display device
Session - 1
Attached to the `Glass` terminal, with a dual-head configuration
(this means 1 MDEV that wraps 2 PDEV)
Session - 2
Attached to the `Remote` terminal, with 2 display drover and 2 mirror driver
configuration
(this mens 1 MDEV that wraps 3 PDEV, one for the primary, and 2 for the
mirrors)

You can have as many mirror driver for as many session your machine can
support.
Each one would have one or more PDEVs, separated for each session.
However, a FUS-disconnected session is switched to the Disconnected Display,
and, in that configuration, loading mirror drivers is not allowed.

For drivers that control real hardware, videoprt.sys is nortified of session
changes,
and, the hardware can take any action that is appropriate.
In theory, the video memory is controlled by the miniport, that lives in
system space,
and, it's controlled by one (or more, in theory) display drivers, that live
in session space.
Nobody prevents the miniport mapping the video memory in different sessions,
even if the explicit machinery of the mode-change code prevents that
physical video
devices from being enumerated when a mode change happens towards
a remote session or a disconnected session.
However, if the hardware choosed to implement an out-of-band mechanism,
it could have mapped the video memory is the disconnected or remoted
sessions as well.

To answer your questions:
You can load the same mirror drivers in as many session you feel like.
This is, for example, how the Vista supplied rdpencdd.dll works.
Each loaded instance will have session space isolation,
and, a different PDEV for each loaded-instance in each session.

--
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


"V850R" <V850R@discussions.microsoft.com> wrote in message
news:1FC28656-8D42-42B2-82CF-8DE33F831F0B@microsoft.com...
> From the DDK documentation:
>
> "Fast User Switching works by allowing multiple virtual display drivers to
> run at the same time. (Each virtual display driver is associated with a
> particular PDEV.)"
>
> Is this true for mirror drivers as well? Could one install a mirror driver
> and then, while more than one user is logged in, capture those users'
> screens? (assuming things like memory mapping etc. are properly
> implemented
> in the mirror driver)
>
> And another question just out of curiosity, how is this implemented for
> drivers that actually control real hardware? Would the driver have to
> share
> its video memory amongst those sessions or is only the glass/physical
> terminal be able to use the video hardware?
>
> Thanks in advance