From 6b7777409ebd046db92799c30fedaa46bd8cfc2c Mon Sep 17 00:00:00 2001 From: Nicolas GRAZIANO Date: Sat, 8 Oct 2011 15:42:50 +0200 Subject: [PATCH 1/2] Make wfreerdp work with 16 bpp color from server. --- client/Windows/wf_gdi.c | 6 +++--- client/Windows/wfreerdp.c | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/client/Windows/wf_gdi.c b/client/Windows/wf_gdi.c index f66817e1f..879b8efc4 100644 --- a/client/Windows/wf_gdi.c +++ b/client/Windows/wf_gdi.c @@ -172,7 +172,7 @@ void wf_gdi_bitmap_update(rdpUpdate* update, BITMAP_UPDATE* bitmap) { bmp = &bitmap->bitmaps[i]; - wf_bmp = wf_image_new(wfi, bmp->width, bmp->height, wfi->dstBpp, bmp->dstData); + wf_bmp = wf_image_new(wfi, bmp->width, bmp->height, wfi->srcBpp, bmp->dstData); BitBlt(wfi->primary->hdc, bmp->left, bmp->top, bmp->right - bmp->left + 1, @@ -241,7 +241,7 @@ void wf_gdi_opaque_rect(rdpUpdate* update, OPAQUE_RECT_ORDER* opaque_rect) uint32 brush_color; wfInfo* wfi = GET_WFI(update); - brush_color = freerdp_color_convert(opaque_rect->color, wfi->dstBpp, 24, wfi->clrconv); + brush_color = freerdp_color_convert(opaque_rect->color, wfi->srcBpp, 24, wfi->clrconv); rect.left = opaque_rect->nLeftRect; rect.top = opaque_rect->nTopRect; @@ -368,7 +368,7 @@ void wf_gdi_cache_bitmap_v2(rdpUpdate* update, CACHE_BITMAP_V2_ORDER* cache_bitm wfInfo* wfi = GET_WFI(update); bitmap_data = cache_bitmap_v2->bitmap_data; - bitmap = wf_image_new(wfi, bitmap_data->width, bitmap_data->height, wfi->dstBpp, bitmap_data->dstData); + bitmap = wf_image_new(wfi, bitmap_data->width, bitmap_data->height, wfi->srcBpp, bitmap_data->dstData); bitmap_v2_put(wfi->cache->bitmap_v2, cache_bitmap_v2->cacheId, cache_bitmap_v2->cacheIndex, bitmap_data, (void*) bitmap); diff --git a/client/Windows/wfreerdp.c b/client/Windows/wfreerdp.c index 21c780210..ab2f87dd4 100644 --- a/client/Windows/wfreerdp.c +++ b/client/Windows/wfreerdp.c @@ -223,6 +223,7 @@ boolean wf_post_connect(freerdp* instance) else { wf_gdi_register_update_callbacks(instance->update); + wfi->srcBpp = instance->settings->color_depth; wfi->primary = wf_image_new(wfi, width, height, wfi->dstBpp, NULL); wfi->hdc = gdi_GetDC(); From 0622ab87cf5a05b48a8a492dfbf28c4eda4c8e54 Mon Sep 17 00:00:00 2001 From: Nicolas GRAZIANO Date: Sat, 8 Oct 2011 18:39:35 +0200 Subject: [PATCH 2/2] When connecting to windows XP, the server do not set Blob type for license error message. So I made the exception more general. --- libfreerdp-core/license.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libfreerdp-core/license.c b/libfreerdp-core/license.c index 5279ceaa2..54517a487 100644 --- a/libfreerdp-core/license.c +++ b/libfreerdp-core/license.c @@ -445,10 +445,10 @@ void license_read_binary_blob(STREAM* s, LICENSE_BLOB* blob) stream_read_uint16(s, blob->length); /* wBlobLen (2 bytes) */ /* - * Server can choose to not send a certificate by setting len to 0. + * Server can choose to not send data by setting len to 0. * If so, it may not bother to set the type, so shortcut the warning */ - if (blob->type == BB_CERTIFICATE_BLOB && blob->length == 0) + if (blob->type != BB_ANY_BLOB && blob->length == 0) return; if (blob->type != wBlobType && blob->type != BB_ANY_BLOB)