From d3652a72512dfb31001d3f16444178193a489a44 Mon Sep 17 00:00:00 2001 From: Nicolas Graziano Date: Tue, 11 Oct 2011 23:53:50 +0200 Subject: [PATCH 1/3] Indicate its FIRST and LAST PDU for pesistent_key_list. If first is not indicate, Windows XP reply with ERRINFO_PERSISTENT_KEY_PDU_TOO_MANY_CACHE_KEYS. --- libfreerdp-core/activation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libfreerdp-core/activation.c b/libfreerdp-core/activation.c index 1eb528b02..155f0a1b5 100644 --- a/libfreerdp-core/activation.c +++ b/libfreerdp-core/activation.c @@ -165,7 +165,7 @@ void rdp_write_client_persistent_key_list_pdu(STREAM* s, rdpSettings* settings) stream_write_uint16(s, 0); /* totalEntriesCache2 (2 bytes) */ stream_write_uint16(s, 0); /* totalEntriesCache3 (2 bytes) */ stream_write_uint16(s, 0); /* totalEntriesCache4 (2 bytes) */ - stream_write_uint8(s, PERSIST_LAST_PDU); /* bBitMask (1 byte) */ + stream_write_uint8(s, PERSIST_FIRST_PDU | PERSIST_LAST_PDU); /* bBitMask (1 byte) */ stream_write_uint8(s, 0); /* pad1 (1 byte) */ stream_write_uint16(s, 0); /* pad3 (2 bytes) */ From d08e82c1710280cef7d7e683268dc956aa4022e7 Mon Sep 17 00:00:00 2001 From: Nicolas Graziano Date: Wed, 12 Oct 2011 02:19:14 +0200 Subject: [PATCH 2/3] Correct creation of offscreen bitmap. data is null in xf_bitmap_new when called from xf_gdi_create_offscreen_bitmap. --- client/X11/xf_gdi.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/client/X11/xf_gdi.c b/client/X11/xf_gdi.c index 9ee5d9e91..25424f2e6 100644 --- a/client/X11/xf_gdi.c +++ b/client/X11/xf_gdi.c @@ -202,16 +202,17 @@ Pixmap xf_bitmap_new(xfInfo* xfi, int width, int height, int bpp, uint8* data) bitmap = XCreatePixmap(xfi->display, xfi->drawable, width, height, xfi->depth); - cdata = freerdp_image_convert(data, NULL, width, height, bpp, xfi->bpp, xfi->clrconv); + if(data != NULL) + { + cdata = freerdp_image_convert(data, NULL, width, height, bpp, xfi->bpp, xfi->clrconv); + image = XCreateImage(xfi->display, xfi->visual, xfi->depth, + ZPixmap, 0, (char*) cdata, width, height, xfi->scanline_pad, 0); - image = XCreateImage(xfi->display, xfi->visual, xfi->depth, - ZPixmap, 0, (char*) cdata, width, height, xfi->scanline_pad, 0); - - XPutImage(xfi->display, bitmap, xfi->gc, image, 0, 0, 0, 0, width, height); - XFree(image); - - if (cdata != data) - xfree(cdata); + XPutImage(xfi->display, bitmap, xfi->gc, image, 0, 0, 0, 0, width, height); + XFree(image); + if (cdata != data) + xfree(cdata); + } return bitmap; } From 2f06da5dae25f9758f37777d07c28409e29f5d08 Mon Sep 17 00:00:00 2001 From: Nicolas Graziano Date: Wed, 12 Oct 2011 02:21:35 +0200 Subject: [PATCH 3/3] In memblt when index is 255 get from offscreen. See http://msdn.microsoft.com/en-us/library/cc241608(v=prot.10).aspx --- client/X11/xf_gdi.c | 7 ++++++- libfreerdp-gdi/gdi.c | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/client/X11/xf_gdi.c b/client/X11/xf_gdi.c index 25424f2e6..28d6a91f7 100644 --- a/client/X11/xf_gdi.c +++ b/client/X11/xf_gdi.c @@ -617,7 +617,12 @@ void xf_gdi_memblt(rdpUpdate* update, MEMBLT_ORDER* memblt) xfInfo* xfi = GET_XFI(update); xf_set_rop3(xfi, gdi_rop3_code(memblt->bRop)); - bitmap_v2_get(xfi->cache->bitmap_v2, memblt->cacheId, memblt->cacheIndex, (void**) &extra); + + if(memblt->cacheId == 255) + extra = offscreen_get(xfi->cache->offscreen, memblt->cacheIndex); + else + bitmap_v2_get(xfi->cache->bitmap_v2, memblt->cacheId, memblt->cacheIndex, (void**) &extra); + bitmap = (Pixmap) extra; if (extra == NULL) diff --git a/libfreerdp-gdi/gdi.c b/libfreerdp-gdi/gdi.c index 001c04c04..835000617 100644 --- a/libfreerdp-gdi/gdi.c +++ b/libfreerdp-gdi/gdi.c @@ -651,7 +651,11 @@ void gdi_memblt(rdpUpdate* update, MEMBLT_ORDER* memblt) GDI_IMAGE* gdi_bmp; GDI* gdi = GET_GDI(update); - bitmap_v2_get(gdi->cache->bitmap_v2, memblt->cacheId, memblt->cacheIndex, (void**) &extra); + if(memblt->cacheId == 255) + extra = offscreen_get(gdi->cache->offscreen, memblt->cacheIndex); + else + bitmap_v2_get(gdi->cache->bitmap_v2, memblt->cacheId, memblt->cacheIndex, (void**) &extra); + gdi_bmp = (GDI_IMAGE*) extra; if (extra == NULL)