From 997ecbd11262165ee55f9205d01ee69251af1ab8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc-Andr=C3=A9=20Moreau?= Date: Tue, 20 Sep 2011 17:01:38 -0400 Subject: [PATCH] libfreerdp-core: fix orders state reset on deactivate all pdu --- include/freerdp/update.h | 4 ++++ libfreerdp-core/connection.c | 4 +--- libfreerdp-core/update.c | 8 ++++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/include/freerdp/update.h b/include/freerdp/update.h index c58bd35..0d87dac 100644 --- a/include/freerdp/update.h +++ b/include/freerdp/update.h @@ -1188,6 +1188,8 @@ struct rdp_update pcSurfaceBits SurfaceBits; pcSurfaceCommand SurfaceCommand; + void* state_start; + BITMAP_UPDATE bitmap_update; PALETTE_UPDATE palette_update; PLAY_SOUND_UPDATE play_sound; @@ -1250,6 +1252,8 @@ struct rdp_update MONITORED_DESKTOP_ORDER monitored_desktop; SURFACE_BITS_COMMAND surface_bits_command; + + void* state_end; }; #endif /* __UPDATE_API_H */ diff --git a/libfreerdp-core/connection.c b/libfreerdp-core/connection.c index 511b466..4b3a44b 100644 --- a/libfreerdp-core/connection.c +++ b/libfreerdp-core/connection.c @@ -383,10 +383,7 @@ boolean rdp_client_connect_demand_active(rdpRdp* rdp, STREAM* s) return False; rdp->state = CONNECTION_STATE_ACTIVE; - update_reset_state(rdp->update); - rdp->update->switch_surface.bitmapId = SCREEN_BITMAP_SURFACE; - IFCALL(rdp->update->SwitchSurface, rdp->update, &(rdp->update->switch_surface)); return True; } @@ -555,6 +552,7 @@ boolean rdp_server_accept_confirm_active(rdpRdp* rdp, STREAM* s) return True; rdp->state = CONNECTION_STATE_ACTIVE; + update_reset_state(rdp->update); if (!rdp_send_server_synchronize_pdu(rdp)) return False; diff --git a/libfreerdp-core/update.c b/libfreerdp-core/update.c index 8e3fa91..a2bf924 100644 --- a/libfreerdp-core/update.c +++ b/libfreerdp-core/update.c @@ -323,13 +323,17 @@ void update_recv(rdpUpdate* update, STREAM* s) void update_reset_state(rdpUpdate* update) { - memset(&update->order_info, 0, sizeof(ORDER_INFO)); + update->state_start = &update->state_start; + update->state_end = &update->state_end; + memset(update->state_start, 0, update->state_end - update->state_start); update->order_info.orderType = ORDER_TYPE_PATBLT; + update->switch_surface.bitmapId = SCREEN_BITMAP_SURFACE; + IFCALL(update->SwitchSurface, update, &(update->switch_surface)); } static void update_begin_paint(rdpUpdate* update) { - update_reset_state(update); + } static void update_end_paint(rdpUpdate* update) -- 2.7.4