Skip to content

Commit

Permalink
Merge pull request FreeRDP#3856 from hardening/rail_capabilities
Browse files Browse the repository at this point in the history
Don't forget to send the RAIL capabilities in server mode
  • Loading branch information
bmiklautz authored Mar 10, 2017
2 parents cab3de3 + 716eab2 commit 9d4811e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
19 changes: 13 additions & 6 deletions libfreerdp/core/capabilities.c
Original file line number Diff line number Diff line change
Expand Up @@ -2232,8 +2232,8 @@ static BOOL rdp_read_window_list_capability_set(wStream* s, UINT16 length,
return FALSE;

Stream_Seek_UINT32(s); /* wndSupportLevel (4 bytes) */
Stream_Seek_UINT8(s); /* numIconCaches (1 byte) */
Stream_Seek_UINT16(s); /* numIconCacheEntries (2 bytes) */
Stream_Read_UINT8(s, settings->RemoteAppNumIconCaches); /* numIconCaches (1 byte) */
Stream_Read_UINT16(s, settings->RemoteAppNumIconCacheEntries); /* numIconCacheEntries (2 bytes) */
return TRUE;
}

Expand All @@ -2244,8 +2244,7 @@ static BOOL rdp_read_window_list_capability_set(wStream* s, UINT16 length,
* @param settings settings
*/

static BOOL rdp_write_window_list_capability_set(wStream* s,
rdpSettings* settings)
static BOOL rdp_write_window_list_capability_set(wStream* s, rdpSettings* settings)
{
int header;
UINT32 wndSupportLevel;
Expand Down Expand Up @@ -3913,11 +3912,19 @@ BOOL rdp_write_demand_active(wStream* s, rdpSettings* settings)
return FALSE;
}

if (settings->RemoteApplicationMode)
{
numberCapabilities += 2;

if (!rdp_write_remote_programs_capability_set(s, settings) ||
!rdp_write_window_list_capability_set(s, settings))
return FALSE;
}

em = Stream_GetPosition(s);
Stream_SetPosition(s, lm); /* go back to lengthCombinedCapabilities */
lengthCombinedCapabilities = (em - bm);
Stream_Write_UINT16(s,
lengthCombinedCapabilities); /* lengthCombinedCapabilities (2 bytes) */
Stream_Write_UINT16(s, lengthCombinedCapabilities); /* lengthCombinedCapabilities (2 bytes) */
Stream_SetPosition(s, bm); /* go back to numberCapabilities */
Stream_Write_UINT16(s, numberCapabilities); /* numberCapabilities (2 bytes) */
#ifdef WITH_DEBUG_CAPABILITIES
Expand Down
4 changes: 4 additions & 0 deletions libfreerdp/core/capabilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@
/* RAIL Support Level */
#define RAIL_LEVEL_SUPPORTED 0x00000001
#define RAIL_LEVEL_DOCKED_LANGBAR_SUPPORTED 0x00000002
#define RAIL_LEVEL_SHELL_INTEGRATION_SUPPORTED 0x00000004
#define RAIL_LEVEL_LANGUAGE_IME_SYNC_SUPPORTED 0x00000008
#define RAIL_LEVEL_SERVER_TO_CLIENT_IME_SYNC_SUPPORTED 0x00000010
#define RAIL_LEVEL_HIDE_MINIMIZED_APPS_SUPPORTED 0x00000020

/* Window Support Level */
#define WINDOW_LEVEL_NOT_SUPPORTED 0x00000000
Expand Down

0 comments on commit 9d4811e

Please sign in to comment.