diff --git a/include/freerdp/settings.h b/include/freerdp/settings.h index 10b500cea..388551a11 100644 --- a/include/freerdp/settings.h +++ b/include/freerdp/settings.h @@ -263,6 +263,12 @@ typedef struct _TARGET_NET_ADDRESS TARGET_NET_ADDRESS; #define PACKET_COMPR_TYPE_RDP61 0x03 #define PACKET_COMPR_TYPE_RDP8 0x04 +/* Desktop Rotation Flags */ +#define ORIENTATION_LANDSCAPE 0 +#define ORIENTATION_PORTRAIT 90 +#define ORIENTATION_LANDSCAPE_FLIPPED 180 +#define ORIENTATION_PORTRAIT_FLIPPED 270 + /* SYSTEM_TIME */ typedef struct { @@ -863,7 +869,12 @@ struct rdp_settings ALIGN64 BOOL SupportGraphicsPipeline; /* 142 */ ALIGN64 BOOL SupportDynamicTimeZone; /* 143 */ ALIGN64 BOOL SupportHeartbeatPdu; /* 144 */ - UINT64 padding0192[192 - 145]; /* 145 */ + ALIGN64 UINT32 DesktopPhysicalWidth; /* 145 */ + ALIGN64 UINT32 DesktopPhysicalHeight; /* 146 */ + ALIGN64 UINT16 DesktopOrientation; /* 147 */ + ALIGN64 UINT32 DesktopScaleFactor; /* 148 */ + ALIGN64 UINT32 DeviceScaleFactor; /* 149 */ + UINT64 padding0192[192 - 150]; /* 150 */ /* Client/Server Security Data */ ALIGN64 BOOL UseRdpSecurityLayer; /* 192 */ diff --git a/libfreerdp/core/gcc.c b/libfreerdp/core/gcc.c index 3604d085a..18bf20b9d 100644 --- a/libfreerdp/core/gcc.c +++ b/libfreerdp/core/gcc.c @@ -571,11 +571,6 @@ BOOL gcc_read_client_core_data(wStream* s, rdpMcs* mcs, UINT16 blockLength) UINT16 highColorDepth = 0; UINT16 supportedColorDepths = 0; UINT32 serverSelectedProtocol = 0; - UINT32 desktopPhysicalWidth = 0; - UINT32 desktopPhysicalHeight = 0; - UINT16 desktopOrientation = 0; - UINT32 desktopScaleFactor = 0; - UINT32 deviceScaleFactor = 0; UINT16 earlyCapabilityFlags = 0; rdpSettings* settings = mcs->settings; @@ -675,27 +670,27 @@ BOOL gcc_read_client_core_data(wStream* s, rdpMcs* mcs, UINT16 blockLength) if (blockLength < 4) break; - Stream_Read_UINT32(s, desktopPhysicalWidth); /* desktopPhysicalWidth (4 bytes) */ + Stream_Read_UINT32(s, settings->DesktopPhysicalWidth); /* desktopPhysicalWidth (4 bytes) */ blockLength -= 4; if (blockLength < 4) break; - Stream_Read_UINT32(s, desktopPhysicalHeight); /* desktopPhysicalHeight (4 bytes) */ + Stream_Read_UINT32(s, settings->DesktopPhysicalHeight); /* desktopPhysicalHeight (4 bytes) */ blockLength -= 4; if (blockLength < 2) break; - Stream_Read_UINT16(s, desktopOrientation); /* desktopOrientation (2 bytes) */ + Stream_Read_UINT16(s, settings->DesktopOrientation); /* desktopOrientation (2 bytes) */ blockLength -= 2; if (blockLength < 4) break; - Stream_Read_UINT32(s, desktopScaleFactor); /* desktopScaleFactor (4 bytes) */ + Stream_Read_UINT32(s, settings->DesktopScaleFactor); /* desktopScaleFactor (4 bytes) */ blockLength -= 4; if (blockLength < 4) break; - Stream_Read_UINT32(s, deviceScaleFactor); /* deviceScaleFactor (4 bytes) */ + Stream_Read_UINT32(s, settings->DeviceScaleFactor); /* deviceScaleFactor (4 bytes) */ blockLength -= 4; if (settings->SelectedProtocol != serverSelectedProtocol) @@ -796,7 +791,7 @@ void gcc_write_client_core_data(wStream* s, rdpMcs* mcs) int clientDigProductIdLength; rdpSettings* settings = mcs->settings; - gcc_write_user_data_header(s, CS_CORE, 216); + gcc_write_user_data_header(s, CS_CORE, 234); version = settings->RdpVersion >= 5 ? RDP_VERSION_5_PLUS : RDP_VERSION_4; @@ -890,6 +885,12 @@ void gcc_write_client_core_data(wStream* s, rdpMcs* mcs) Stream_Write_UINT8(s, 0); /* pad1octet */ Stream_Write_UINT32(s, settings->SelectedProtocol); /* serverSelectedProtocol */ + + Stream_Write_UINT32(s, settings->DesktopPhysicalWidth); /* desktopPhysicalWidth */ + Stream_Write_UINT32(s, settings->DesktopPhysicalHeight); /* desktopPhysicalHeight */ + Stream_Write_UINT16(s, settings->DesktopOrientation); /* desktopOrientation */ + Stream_Write_UINT32(s, settings->DesktopScaleFactor); /* desktopScaleFactor */ + Stream_Write_UINT32(s, settings->DeviceScaleFactor); /* deviceScaleFactor */ } BOOL gcc_read_server_core_data(wStream* s, rdpMcs* mcs)