Documentation
¶
Overview ¶
Package rdpedisp implements the RDP Display Update Virtual Channel (MS-RDPEDISP), which allows the client to request a resolution change while connected. The channel name is:
"Microsoft::Windows::RDS::DisplayControl"
Typical usage:
- Register the handler with the DVC client before connecting.
- After the session is established, call SendMonitorLayout to request a new resolution. The server will reshape the desktop and send a fresh RDPGFX ResetGraphics command.
Index ¶
Constants ¶
const ChannelName = "Microsoft::Windows::RDS::DisplayControl"
ChannelName is the well-known DVC name for the Display Update channel.
const MonitorFlagPrimary = uint32(0x00000001)
DISPLAYCONTROL_MONITOR_PRIMARY marks the primary monitor.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is the DVC handler for the Display Update channel. It implements the drdynvc.DvcChannelHandler interface and the optional SetSendFunc / OnChannelCreated extension interfaces.
func NewHandler ¶
NewHandler returns a new Handler. width and height are the desired initial desktop dimensions; when both are non-zero the handler queues an initial layout change that is sent as soon as the server advertises its capabilities (MS-RDPEDISP CAPS PDU), prompting servers such as GNOME Remote Desktop (headless) to resize.
func (*Handler) OnChannelCreated ¶
func (h *Handler) OnChannelCreated()
OnChannelCreated is called by the DVC client after the CREATE_RSP has been sent.
func (*Handler) SendMonitorLayout ¶
SendMonitorLayout sends a DISPLAYCONTROL_MONITOR_LAYOUT_PDU to the server, requesting the given monitor configuration. Per MS-RDPEDISP 3.2.5.1, the client MUST NOT send a layout PDU before receiving the server CAPS PDU; if called before CAPS is received, the layout is queued and sent automatically when CAPS arrives.
The server will apply the new layout and—if using the RDPGFX pipeline—send a ResetGraphics command that resets surface dimensions to match.
func (*Handler) SetSendFunc ¶
SetSendFunc is called by the DVC client to provide a write-back function. Required by the drdynvc channel plumbing.
type Monitor ¶
type Monitor struct {
Flags uint32
Left int32
Top int32
Width uint32
Height uint32
PhysicalWidth uint32
PhysicalHeight uint32
Orientation uint32
DesktopScaleFactor uint32
DeviceScaleFactor uint32
}
Monitor describes a single monitor in a MONITOR_LAYOUT PDU. Width and Height must each be at least 200 and Width must be even. Set PhysicalWidth/Height to 0 when the physical dimensions are unknown. Orientation: 0=landscape (normal), 90, 180, 270. DesktopScaleFactor: one of 100, 125, 150, 175, 200 (use 100 if unsure). DeviceScaleFactor: one of 100, 140, 180 (use 100 if unsure).