diff --git a/constants.h b/constants.h index 0d48416..974d519 100644 --- a/constants.h +++ b/constants.h @@ -793,3 +793,10 @@ enum RDP_DESKTOP_ORIENTATION /* [MS-RDPBCGR] 2.2.7.2.7 */ #define LARGE_POINTER_FLAG_96x96 1 + +/* [MS-RDPBCGR] TS_SUPPRESS_OUTPUT_PDU allowDisplayUpdates */ +enum RDP_SUPPRESS_STATUS +{ + SUPPRESS_DISPLAY_UPDATES = 0x00, + ALLOW_DISPLAY_UPDATES = 0x01 +}; diff --git a/proto.h b/proto.h index 4b88234..33be4be 100644 --- a/proto.h +++ b/proto.h @@ -150,7 +150,7 @@ void process_ts_fp_updates(STREAM s); void rdp_in_unistr(STREAM s, int in_len, char **string, uint32 * str_size); void rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags, uint16 param1, uint16 param2); -void rdp_send_client_window_status(int status); +void rdp_send_suppress_output_pdu(enum RDP_SUPPRESS_STATUS allowupdates); void process_colour_pointer_pdu(STREAM s); void process_new_pointer_pdu(STREAM s); void process_cached_pointer_pdu(STREAM s); diff --git a/rdp.c b/rdp.c index 21788f3..4210af6 100644 --- a/rdp.c +++ b/rdp.c @@ -532,35 +532,37 @@ rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags, uint16 par rdp_send_data(s, RDP_DATA_PDU_INPUT); } -/* Send a client window information PDU */ +/* Send a Suppress Output PDU */ void -rdp_send_client_window_status(int status) +rdp_send_suppress_output_pdu(enum RDP_SUPPRESS_STATUS allowupdates) { STREAM s; static int current_status = 1; - if (current_status == status) + if (current_status == allowupdates) return; s = rdp_init_data(12); - out_uint32_le(s, status); + out_uint8(s, allowupdates); /* allowDisplayUpdates */ + out_uint8s(s, 3); /* pad3Octets */ - switch (status) + switch (allowupdates) { - case 0: /* shut the server up */ + case SUPPRESS_DISPLAY_UPDATES: /* shut the server up */ break; - case 1: /* receive data again */ - out_uint32_le(s, 0); /* unknown */ - out_uint16_le(s, g_width); - out_uint16_le(s, g_height); + case ALLOW_DISPLAY_UPDATES: /* receive data again */ + out_uint16_le(s, 0); /* left */ + out_uint16_le(s, 0); /* top */ + out_uint16_le(s, g_width); /* right */ + out_uint16_le(s, g_height); /* bottom */ break; } s_mark_end(s); rdp_send_data(s, RDP_DATA_PDU_CLIENT_WINDOW_STATUS); - current_status = status; + current_status = allowupdates; } /* Send persistent bitmap cache enumeration PDU's */ diff --git a/xwin.c b/xwin.c index 9452349..6282e98 100644 --- a/xwin.c +++ b/xwin.c @@ -2670,11 +2670,11 @@ xwin_process_events(void) break; case MapNotify: if (!g_seamless_active) - rdp_send_client_window_status(1); + rdp_send_suppress_output_pdu(ALLOW_DISPLAY_UPDATES); break; case UnmapNotify: if (!g_seamless_active) - rdp_send_client_window_status(0); + rdp_send_suppress_output_pdu(SUPPRESS_DISPLAY_UPDATES); break; case ConfigureNotify: #ifdef HAVE_XRANDR