diff --git a/include/freerdp/altsec.h b/include/freerdp/altsec.h index 816e9a7cd..50b0ed4df 100644 --- a/include/freerdp/altsec.h +++ b/include/freerdp/altsec.h @@ -164,18 +164,18 @@ struct _DRAW_GDIPLUS_CACHE_END_ORDER }; typedef struct _DRAW_GDIPLUS_CACHE_END_ORDER DRAW_GDIPLUS_CACHE_END_ORDER; -typedef void (*pCreateOffscreenBitmap)(rdpUpdate* update, CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap); -typedef void (*pSwitchSurface)(rdpUpdate* update, SWITCH_SURFACE_ORDER* switch_surface); -typedef void (*pCreateNineGridBitmap)(rdpUpdate* update, CREATE_NINE_GRID_BITMAP_ORDER* create_nine_grid_bitmap); -typedef void (*pFrameMarker)(rdpUpdate* update, FRAME_MARKER_ORDER* frame_marker); -typedef void (*pStreamBitmapFirst)(rdpUpdate* update, STREAM_BITMAP_FIRST_ORDER* stream_bitmap_first); -typedef void (*pStreamBitmapNext)(rdpUpdate* update, STREAM_BITMAP_FIRST_ORDER* stream_bitmap_next); -typedef void (*pDrawGdiPlusFirst)(rdpUpdate* update, DRAW_GDIPLUS_FIRST_ORDER* draw_gdiplus_first); -typedef void (*pDrawGdiPlusNext)(rdpUpdate* update, DRAW_GDIPLUS_NEXT_ORDER* draw_gdiplus_next); -typedef void (*pDrawGdiPlusEnd)(rdpUpdate* update, DRAW_GDIPLUS_END_ORDER* draw_gdiplus_end); -typedef void (*pDrawGdiPlusCacheFirst)(rdpUpdate* update, DRAW_GDIPLUS_CACHE_FIRST_ORDER* draw_gdiplus_cache_first); -typedef void (*pDrawGdiPlusCacheNext)(rdpUpdate* update, DRAW_GDIPLUS_CACHE_NEXT_ORDER* draw_gdiplus_cache_next); -typedef void (*pDrawGdiPlusCacheEnd)(rdpUpdate* update, DRAW_GDIPLUS_CACHE_END_ORDER* draw_gdiplus_cache_end); +typedef void (*pCreateOffscreenBitmap)(rdpContext* context, CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap); +typedef void (*pSwitchSurface)(rdpContext* context, SWITCH_SURFACE_ORDER* switch_surface); +typedef void (*pCreateNineGridBitmap)(rdpContext* context, CREATE_NINE_GRID_BITMAP_ORDER* create_nine_grid_bitmap); +typedef void (*pFrameMarker)(rdpContext* context, FRAME_MARKER_ORDER* frame_marker); +typedef void (*pStreamBitmapFirst)(rdpContext* context, STREAM_BITMAP_FIRST_ORDER* stream_bitmap_first); +typedef void (*pStreamBitmapNext)(rdpContext* context, STREAM_BITMAP_FIRST_ORDER* stream_bitmap_next); +typedef void (*pDrawGdiPlusFirst)(rdpContext* context, DRAW_GDIPLUS_FIRST_ORDER* draw_gdiplus_first); +typedef void (*pDrawGdiPlusNext)(rdpContext* context, DRAW_GDIPLUS_NEXT_ORDER* draw_gdiplus_next); +typedef void (*pDrawGdiPlusEnd)(rdpContext* context, DRAW_GDIPLUS_END_ORDER* draw_gdiplus_end); +typedef void (*pDrawGdiPlusCacheFirst)(rdpContext* context, DRAW_GDIPLUS_CACHE_FIRST_ORDER* draw_gdiplus_cache_first); +typedef void (*pDrawGdiPlusCacheNext)(rdpContext* context, DRAW_GDIPLUS_CACHE_NEXT_ORDER* draw_gdiplus_cache_next); +typedef void (*pDrawGdiPlusCacheEnd)(rdpContext* context, DRAW_GDIPLUS_CACHE_END_ORDER* draw_gdiplus_cache_end); struct rdp_altsec_update { diff --git a/include/freerdp/update.h b/include/freerdp/update.h index 55d3862ba..e9714a66f 100644 --- a/include/freerdp/update.h +++ b/include/freerdp/update.h @@ -149,19 +149,7 @@ struct rdp_update rdpPointerUpdate* pointer; /* 32 */ rdpPrimaryUpdate* primary; /* 33 */ rdpSecondaryUpdate* secondary; /* 34 */ - - pCreateOffscreenBitmap CreateOffscreenBitmap; - pSwitchSurface SwitchSurface; - pCreateNineGridBitmap CreateNineGridBitmap; - pFrameMarker FrameMarker; - pStreamBitmapFirst StreamBitmapFirst; - pStreamBitmapNext StreamBitmapNext; - pDrawGdiPlusFirst DrawGdiPlusFirst; - pDrawGdiPlusNext DrawGdiPlusNext; - pDrawGdiPlusEnd DrawGdiPlusEnd; - pDrawGdiPlusCacheFirst DrawGdiPlusCacheFirst; - pDrawGdiPlusCacheNext DrawGdiPlusCacheNext; - pDrawGdiPlusCacheEnd DrawGdiPlusCacheEnd; + rdpAltSecUpdate* altsec; /* 35 */ pWindowCreate WindowCreate; pWindowUpdate WindowUpdate; @@ -190,19 +178,6 @@ struct rdp_update PALETTE_UPDATE palette_update; PLAY_SOUND_UPDATE play_sound; - CREATE_OFFSCREEN_BITMAP_ORDER create_offscreen_bitmap; - SWITCH_SURFACE_ORDER switch_surface; - CREATE_NINE_GRID_BITMAP_ORDER create_nine_grid_bitmap; - FRAME_MARKER_ORDER frame_marker; - STREAM_BITMAP_FIRST_ORDER stream_bitmap_first; - STREAM_BITMAP_FIRST_ORDER stream_bitmap_next; - DRAW_GDIPLUS_CACHE_FIRST_ORDER draw_gdiplus_cache_first; - DRAW_GDIPLUS_CACHE_NEXT_ORDER draw_gdiplus_cache_next; - DRAW_GDIPLUS_CACHE_END_ORDER draw_gdiplus_cache_end; - DRAW_GDIPLUS_FIRST_ORDER draw_gdiplus_first; - DRAW_GDIPLUS_NEXT_ORDER draw_gdiplus_next; - DRAW_GDIPLUS_END_ORDER draw_gdiplus_end; - WINDOW_ORDER_INFO orderInfo; WINDOW_STATE_ORDER window_state; WINDOW_ICON_ORDER window_icon; diff --git a/libfreerdp-cache/offscreen.c b/libfreerdp-cache/offscreen.c index 500849478..4f28e119e 100644 --- a/libfreerdp-cache/offscreen.c +++ b/libfreerdp-cache/offscreen.c @@ -22,25 +22,25 @@ #include -void update_gdi_create_offscreen_bitmap(rdpUpdate* update, CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap) +void update_gdi_create_offscreen_bitmap(rdpContext* context, CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap) { int i; uint16 index; rdpBitmap* bitmap; - rdpCache* cache = update->context->cache; + rdpCache* cache = context->cache; - bitmap = Bitmap_Alloc(update->context); + bitmap = Bitmap_Alloc(context); bitmap->width = create_offscreen_bitmap->cx; bitmap->height = create_offscreen_bitmap->cy; - bitmap->New(update->context, bitmap); + bitmap->New(context, bitmap); offscreen_cache_delete(cache->offscreen, create_offscreen_bitmap->id); offscreen_cache_put(cache->offscreen, create_offscreen_bitmap->id, bitmap); if(cache->offscreen->currentSurface == create_offscreen_bitmap->id) - Bitmap_SetSurface(update->context, bitmap, false); + Bitmap_SetSurface(context, bitmap, false); for (i = 0; i < create_offscreen_bitmap->deleteList.cIndices; i++) { @@ -49,19 +49,19 @@ void update_gdi_create_offscreen_bitmap(rdpUpdate* update, CREATE_OFFSCREEN_BITM } } -void update_gdi_switch_surface(rdpUpdate* update, SWITCH_SURFACE_ORDER* switch_surface) +void update_gdi_switch_surface(rdpContext* context, SWITCH_SURFACE_ORDER* switch_surface) { - rdpCache* cache = update->context->cache; + rdpCache* cache = context->cache; if (switch_surface->bitmapId == SCREEN_BITMAP_SURFACE) { - Bitmap_SetSurface(update->context, NULL, true); + Bitmap_SetSurface(context, NULL, true); } else { rdpBitmap* bitmap; bitmap = offscreen_cache_get(cache->offscreen, switch_surface->bitmapId); - Bitmap_SetSurface(update->context, bitmap, false); + Bitmap_SetSurface(context, bitmap, false); } cache->offscreen->currentSurface = switch_surface->bitmapId; @@ -120,8 +120,8 @@ void offscreen_cache_delete(rdpOffscreenCache* offscreen, uint16 index) void offscreen_cache_register_callbacks(rdpUpdate* update) { - update->CreateOffscreenBitmap = update_gdi_create_offscreen_bitmap; - update->SwitchSurface = update_gdi_switch_surface; + update->altsec->CreateOffscreenBitmap = update_gdi_create_offscreen_bitmap; + update->altsec->SwitchSurface = update_gdi_switch_surface; } rdpOffscreenCache* offscreen_cache_new(rdpSettings* settings) diff --git a/libfreerdp-core/freerdp.c b/libfreerdp-core/freerdp.c index 84a91ce33..bfaaf63af 100644 --- a/libfreerdp-core/freerdp.c +++ b/libfreerdp-core/freerdp.c @@ -148,6 +148,7 @@ void freerdp_context_new(freerdp* instance) instance->update->pointer->context = instance->context; instance->update->primary->context = instance->context; instance->update->secondary->context = instance->context; + instance->update->altsec->context = instance->context; instance->input->context = instance->context; input_register_client_callbacks(rdp->input); diff --git a/libfreerdp-core/orders.c b/libfreerdp-core/orders.c index 27c58fc03..5f0ca0bed 100644 --- a/libfreerdp-core/orders.c +++ b/libfreerdp-core/orders.c @@ -1892,6 +1892,8 @@ void update_recv_secondary_order(rdpUpdate* update, STREAM* s, uint8 flags) void update_recv_altsec_order(rdpUpdate* update, STREAM* s, uint8 flags) { uint8 orderType; + rdpContext* context = update->context; + rdpAltSecUpdate* altsec = update->altsec; orderType = flags >>= 2; /* orderType is in higher 6 bits of flags field */ @@ -1905,63 +1907,63 @@ void update_recv_altsec_order(rdpUpdate* update, STREAM* s, uint8 flags) switch (orderType) { case ORDER_TYPE_CREATE_OFFSCREEN_BITMAP: - update_read_create_offscreen_bitmap_order(s, &(update->create_offscreen_bitmap)); - IFCALL(update->CreateOffscreenBitmap, update, &(update->create_offscreen_bitmap)); + update_read_create_offscreen_bitmap_order(s, &(altsec->create_offscreen_bitmap)); + IFCALL(altsec->CreateOffscreenBitmap, context, &(altsec->create_offscreen_bitmap)); break; case ORDER_TYPE_SWITCH_SURFACE: - update_read_switch_surface_order(s, &(update->switch_surface)); - IFCALL(update->SwitchSurface, update, &(update->switch_surface)); + update_read_switch_surface_order(s, &(altsec->switch_surface)); + IFCALL(altsec->SwitchSurface, context, &(altsec->switch_surface)); break; case ORDER_TYPE_CREATE_NINE_GRID_BITMAP: - update_read_create_nine_grid_bitmap_order(s, &(update->create_nine_grid_bitmap)); - IFCALL(update->CreateNineGridBitmap, update, &(update->create_nine_grid_bitmap)); + update_read_create_nine_grid_bitmap_order(s, &(altsec->create_nine_grid_bitmap)); + IFCALL(altsec->CreateNineGridBitmap, context, &(altsec->create_nine_grid_bitmap)); break; case ORDER_TYPE_FRAME_MARKER: - update_read_frame_marker_order(s, &(update->frame_marker)); - IFCALL(update->FrameMarker, update, &(update->frame_marker)); + update_read_frame_marker_order(s, &(altsec->frame_marker)); + IFCALL(altsec->FrameMarker, context, &(altsec->frame_marker)); break; case ORDER_TYPE_STREAM_BITMAP_FIRST: - update_read_stream_bitmap_first_order(s, &(update->stream_bitmap_first)); - IFCALL(update->StreamBitmapFirst, update, &(update->stream_bitmap_first)); + update_read_stream_bitmap_first_order(s, &(altsec->stream_bitmap_first)); + IFCALL(altsec->StreamBitmapFirst, context, &(altsec->stream_bitmap_first)); break; case ORDER_TYPE_STREAM_BITMAP_NEXT: - update_read_stream_bitmap_next_order(s, &(update->stream_bitmap_next)); - IFCALL(update->StreamBitmapNext, update, &(update->stream_bitmap_next)); + update_read_stream_bitmap_next_order(s, &(altsec->stream_bitmap_next)); + IFCALL(altsec->StreamBitmapNext, context, &(altsec->stream_bitmap_next)); break; case ORDER_TYPE_GDIPLUS_FIRST: - update_read_draw_gdiplus_first_order(s, &(update->draw_gdiplus_first)); - IFCALL(update->DrawGdiPlusFirst, update, &(update->draw_gdiplus_first)); + update_read_draw_gdiplus_first_order(s, &(altsec->draw_gdiplus_first)); + IFCALL(altsec->DrawGdiPlusFirst, context, &(altsec->draw_gdiplus_first)); break; case ORDER_TYPE_GDIPLUS_NEXT: - update_read_draw_gdiplus_next_order(s, &(update->draw_gdiplus_next)); - IFCALL(update->DrawGdiPlusNext, update, &(update->draw_gdiplus_next)); + update_read_draw_gdiplus_next_order(s, &(altsec->draw_gdiplus_next)); + IFCALL(altsec->DrawGdiPlusNext, context, &(altsec->draw_gdiplus_next)); break; case ORDER_TYPE_GDIPLUS_END: - update_read_draw_gdiplus_end_order(s, &(update->draw_gdiplus_end)); - IFCALL(update->DrawGdiPlusEnd, update, &(update->draw_gdiplus_end)); + update_read_draw_gdiplus_end_order(s, &(altsec->draw_gdiplus_end)); + IFCALL(altsec->DrawGdiPlusEnd, context, &(altsec->draw_gdiplus_end)); break; case ORDER_TYPE_GDIPLUS_CACHE_FIRST: - update_read_draw_gdiplus_cache_first_order(s, &(update->draw_gdiplus_cache_first)); - IFCALL(update->DrawGdiPlusCacheFirst, update, &(update->draw_gdiplus_cache_first)); + update_read_draw_gdiplus_cache_first_order(s, &(altsec->draw_gdiplus_cache_first)); + IFCALL(altsec->DrawGdiPlusCacheFirst, context, &(altsec->draw_gdiplus_cache_first)); break; case ORDER_TYPE_GDIPLUS_CACHE_NEXT: - update_read_draw_gdiplus_cache_next_order(s, &(update->draw_gdiplus_cache_next)); - IFCALL(update->DrawGdiPlusCacheNext, update, &(update->draw_gdiplus_cache_next)); + update_read_draw_gdiplus_cache_next_order(s, &(altsec->draw_gdiplus_cache_next)); + IFCALL(altsec->DrawGdiPlusCacheNext, context, &(altsec->draw_gdiplus_cache_next)); break; case ORDER_TYPE_GDIPLUS_CACHE_END: - update_read_draw_gdiplus_cache_end_order(s, &(update->draw_gdiplus_cache_end)); - IFCALL(update->DrawGdiPlusCacheEnd, update, &(update->draw_gdiplus_cache_end)); + update_read_draw_gdiplus_cache_end_order(s, &(altsec->draw_gdiplus_cache_end)); + IFCALL(altsec->DrawGdiPlusCacheEnd, context, &(altsec->draw_gdiplus_cache_end)); break; case ORDER_TYPE_WINDOW: diff --git a/libfreerdp-core/update.c b/libfreerdp-core/update.c index 2541c70a7..604892372 100644 --- a/libfreerdp-core/update.c +++ b/libfreerdp-core/update.c @@ -301,6 +301,7 @@ void update_recv(rdpUpdate* update, STREAM* s) void update_reset_state(rdpUpdate* update) { rdpPrimaryUpdate* primary = update->primary; + rdpAltSecUpdate* altsec = update->altsec; memset(&primary->order_info, 0, sizeof(ORDER_INFO)); memset(&primary->dstblt, 0, sizeof(DSTBLT_ORDER)); @@ -327,8 +328,8 @@ void update_reset_state(rdpUpdate* update) memset(&primary->ellipse_cb, 0, sizeof(ELLIPSE_CB_ORDER)); primary->order_info.orderType = ORDER_TYPE_PATBLT; - update->switch_surface.bitmapId = SCREEN_BITMAP_SURFACE; - IFCALL(update->SwitchSurface, update, &(update->switch_surface)); + altsec->switch_surface.bitmapId = SCREEN_BITMAP_SURFACE; + IFCALL(altsec->SwitchSurface, update->context, &(altsec->switch_surface)); } static void update_begin_paint(rdpContext* context) @@ -453,6 +454,7 @@ rdpUpdate* update_new(rdpRdp* rdp) update->pointer = xnew(rdpPointerUpdate); update->primary = xnew(rdpPrimaryUpdate); update->secondary = xnew(rdpSecondaryUpdate); + update->altsec = xnew(rdpAltSecUpdate); } return update;