diff --git a/include/freerdp/update.h b/include/freerdp/update.h index b2e1a4c8e..9970f6fd1 100644 --- a/include/freerdp/update.h +++ b/include/freerdp/update.h @@ -253,6 +253,11 @@ struct rdp_update rdpBounds currentBounds; rdpBounds previousBounds; CRITICAL_SECTION mux; + + /* if autoCalculateBitmapData is set to TRUE, the server automatically + * fills BITMAP_DATA struct members: flags, cbCompMainBodySize and cbCompFirstRowSize. + */ + BOOL autoCalculateBitmapData; }; #endif /* FREERDP_UPDATE_H */ diff --git a/libfreerdp/core/update.c b/libfreerdp/core/update.c index 9d904c64a..a21fcfeb4 100644 --- a/libfreerdp/core/update.c +++ b/libfreerdp/core/update.c @@ -148,16 +148,19 @@ static BOOL update_write_bitmap_data(rdpUpdate* update, wStream* s, if (!Stream_EnsureRemainingCapacity(s, 64 + bitmapData->bitmapLength)) return FALSE; - bitmapData->flags = 0; - bitmapData->cbCompFirstRowSize = 0; - - if (bitmapData->compressed) - bitmapData->flags |= BITMAP_COMPRESSION; - - if (update->context->settings->NoBitmapCompressionHeader) + if (update->autoCalculateBitmapData) { - bitmapData->flags |= NO_BITMAP_COMPRESSION_HDR; - bitmapData->cbCompMainBodySize = bitmapData->bitmapLength; + bitmapData->flags = 0; + bitmapData->cbCompFirstRowSize = 0; + + if (bitmapData->compressed) + bitmapData->flags |= BITMAP_COMPRESSION; + + if (update->context->settings->NoBitmapCompressionHeader) + { + bitmapData->flags |= NO_BITMAP_COMPRESSION_HDR; + bitmapData->cbCompMainBodySize = bitmapData->bitmapLength; + } } Stream_Write_UINT16(s, bitmapData->destLeft); @@ -2190,6 +2193,7 @@ rdpUpdate* update_new(rdpRdp* rdp) deleteList->cIndices = 0; update->SuppressOutput = update_send_suppress_output; update->initialState = TRUE; + update->autoCalculateBitmapData = TRUE; update->queue = MessageQueue_New(&cb); if (!update->queue) diff --git a/server/proxy/pf_client.c b/server/proxy/pf_client.c index df464d819..b2daf90cf 100644 --- a/server/proxy/pf_client.c +++ b/server/proxy/pf_client.c @@ -98,6 +98,8 @@ static BOOL pf_client_pre_connect(freerdp* instance) * Only override it if you plan to implement custom order * callbacks or deactiveate certain features. */ + ZeroMemory(instance->settings->OrderSupport, 32); + /** * Register the channel listeners. * They are required to set up / tear down channels if they are loaded. diff --git a/server/proxy/pf_server.c b/server/proxy/pf_server.c index d85e6f123..261123aab 100644 --- a/server/proxy/pf_server.c +++ b/server/proxy/pf_server.c @@ -241,6 +241,9 @@ static DWORD WINAPI pf_server_handle_client(LPVOID arg) goto out_free_peer; } + + ZeroMemory(client->settings->OrderSupport, 32); + client->update->autoCalculateBitmapData = FALSE; pdata->ps = ps; /* keep configuration in proxyData */ pdata->config = client->ContextExtra;