Parse more physical monitor size information

To implement a scalable login screen, we need to be able to ascertain
the DPI of the connected primary monitor.

At present, in a multi-monitor situation, this information is available in
the struct display_size_description, which can be searched for the primary
monitor. This is only the case however if the Display Control Channel
Extension is in use ([MS-RDPEDISP]), and a DISPLAYCONTROL_MONITOR_LAYOUT
has been received.

This PR retrieves physical monitor size information from the following
two additional places.

1) The TS_UD_CS_CORE PDU. Physical size information is optionally
   included in this PDU for single-screen configurations.
2) The TS_UD_CS_MONITOR_EX PDU. This includes physical size
   information for multiple-screen configurations.
This commit is contained in:
matt335672
2022-07-06 11:04:44 +01:00
parent 682ca95635
commit d5445e9dc1
6 changed files with 323 additions and 109 deletions
+1
View File
@@ -57,6 +57,7 @@
#define SEC_TAG_CLI_CHANNELS 0xc003 /* CS_CHANNELS? */
#define SEC_TAG_CLI_4 0xc004 /* CS_CLUSTER? */
#define SEC_TAG_CLI_MONITOR 0xc005 /* CS_MONITOR */
#define SEC_TAG_CLI_MONITOR_EX 0xc008 /* CS_MONITOR_EX */
/* Client Core Data: colorDepth, postBeta2ColorDepth (2.2.1.3.2) */
#define RNS_UD_COLOR_4BPP 0xCA00
+9 -1
View File
@@ -38,7 +38,8 @@ struct monitor_info
int bottom;
int flags;
/* From 2.2.2.2.1 DISPLAYCONTROL_MONITOR_LAYOUT */
/* From [MS-RDPEDISP] 2.2.2.2.1 DISPLAYCONTROL_MONITOR_LAYOUT, or
* [MS-RDPBCGR] 2.2.1.3.9.1 (TS_MONITOR_ATTRIBUTES) */
unsigned int physical_width;
unsigned int physical_height;
unsigned int orientation;
@@ -205,6 +206,13 @@ struct xrdp_client_info
/* xrdp.override_* values */
struct xrdp_keyboard_overrides xrdp_keyboard_overrides;
/* These values are optionally send over as part of TS_UD_CS_CORE.
* They can be used as a fallback for a single monitor session
* if physical sizes are not available in the monitor-specific
* data */
unsigned int session_physical_width; /* in mm */
unsigned int session_physical_height; /* in mm */
};
/* yyyymmdd of last incompatible change to xrdp_client_info */