summaryrefslogtreecommitdiffstats
path: root/freerdp1
diff options
context:
space:
mode:
Diffstat (limited to 'freerdp1')
-rw-r--r--freerdp1/xrdp-freerdp.c91
1 files changed, 71 insertions, 20 deletions
diff --git a/freerdp1/xrdp-freerdp.c b/freerdp1/xrdp-freerdp.c
index 4dfa9648..5c218724 100644
--- a/freerdp1/xrdp-freerdp.c
+++ b/freerdp1/xrdp-freerdp.c
@@ -87,34 +87,41 @@ lxrdp_connect(struct mod* mod)
switch (connectErrorCode)
{
case PREECONNECTERROR:
- snprintf(buf, 128, "The error code from connect is PREECONNECTERROR");
+ snprintf(buf, 128, "The error code from connect is "
+ "PREECONNECTERROR");
break;
case UNDEFINEDCONNECTERROR:
- snprintf(buf, 128, "The error code from connect is UNDEFINEDCONNECTERROR");
+ snprintf(buf, 128, "The error code from connect is "
+ "UNDEFINEDCONNECTERROR");
break;
case POSTCONNECTERROR:
- snprintf(buf, 128, "The error code from connect is POSTCONNECTERROR");
+ snprintf(buf, 128, "The error code from connect is "
+ "POSTCONNECTERROR");
break;
case DNSERROR:
snprintf(buf, 128, "The DNS system generated an error");
break;
case DNSNAMENOTFOUND:
- snprintf(buf, 128, "The DNS system could not find the specified name");
+ snprintf(buf, 128, "The DNS system could not find the "
+ "specified name");
break;
case CONNECTERROR:
snprintf(buf, 128, "A general connect error was returned");
break;
case MCSCONNECTINITIALERROR:
- snprintf(buf, 128, "The error code from connect is MCSCONNECTINITIALERROR");
+ snprintf(buf, 128, "The error code from connect is "
+ "MCSCONNECTINITIALERROR");
break;
case TLSCONNECTERROR:
snprintf(buf, 128, "Error in TLS handshake");
break;
case AUTHENTICATIONERROR:
- snprintf(buf, 128, "Authentication error check your password and username");
+ snprintf(buf, 128, "Authentication error check your password "
+ "and username");
break;
default:
- snprintf(buf, 128, "Unhandled Errorcode from connect : %d", connectErrorCode);
+ snprintf(buf, 128, "Unhandled Errorcode from connect : %d",
+ connectErrorCode);
break;
}
}
@@ -214,9 +221,48 @@ lxrdp_event(struct mod* mod, int msg, long param1, long param2,
case 110:
break;
case 200:
- /* Currently there are no (?) invalidate API in freeRDP that can receive this request*/
- LLOGLN(0, ("Invalidate request sent from client - Ignored"));
- break ;
+ LLOGLN(10, ("Invalidate request sent from client"));
+ RECTANGLE_16 *rectangle = (RECTANGLE_16 *) g_malloc(sizeof(RECTANGLE_16), 0);
+ /* The parameters are coded as follows param1 = MAKELONG(y, x), param2 =MAKELONG(h, w)
+ * #define MAKELONG(lo, hi) ((((hi) & 0xffff) << 16) | ((lo) & 0xffff))
+ */
+ rectangle->left = (param1 >> 16) & 0xffff;
+ rectangle->top = param1 & 0xffff;
+ rectangle->right = (param2 >> 16) & 0xffff + rectangle->left - 1;
+ rectangle->bottom = param2 & 0xffff + rectangle->top - 1;
+ if (mod->inst->settings->refresh_rect)
+ {
+ if (mod->inst->update != NULL)
+ {
+ if (mod->inst->update->RefreshRect != NULL)
+ {
+ if (mod->inst->context != NULL)
+ {
+ LLOGLN(0, ("update rectangle left: %d top: %d bottom: %d right: %d",
+ rectangle->left, rectangle->top, rectangle->bottom, rectangle->right));
+ mod->inst->update->RefreshRect(mod->inst->context, 1, rectangle);
+ }
+ else
+ {
+ LLOGLN(0, ("Invalidate request -The context is null"));
+ }
+ }
+ else
+ {
+ LLOGLN(0, ("Invalidate request - RefreshRect is Null"));
+ }
+ }
+ else
+ {
+ LLOGLN(0, ("Invalidate request -the update pointer is null"));
+ }
+ }
+ else
+ {
+ LLOGLN(0, ("Invalidate request - warning - update rectangle is disabled"));
+ }
+ g_free(rectangle);
+ break;
case 0x5555:
chanid = LOWORD(param1);
flags = HIWORD(param1);
@@ -727,13 +773,13 @@ lfreerdp_upsidedown(uint8* destination, CACHE_BITMAP_V2_ORDER* cache_bitmap_v2_o
tui8* src;
tui8* dst;
int line_bytes;
- int j ;
- if(destination==NULL)
+ int j;
+
+ if (destination == NULL)
{
- LLOGLN(0, ("lfreerdp_upsidedown : destination pointer is NULL !!!"));
- return ;
+ LLOGLN(0, ("lfreerdp_upsidedown: destination pointer is NULL !!!"));
+ return;
}
-
line_bytes = server_Bpp * cache_bitmap_v2_order->bitmapWidth;
src = cache_bitmap_v2_order->bitmapDataStream;
dst = destination + ((cache_bitmap_v2_order->bitmapHeight) * line_bytes);
@@ -804,11 +850,10 @@ lfreerdp_cache_bitmapV2(rdpContext* context,
server_bpp, server_bpp);
}
else
- {
- /* Uncompressed bitmaps are upside down */
- lfreerdp_upsidedown(dst_data, cache_bitmap_v2_order,server_Bpp);
+ {
+ /* Uncompressed bitmaps are upside down */
+ lfreerdp_upsidedown(dst_data, cache_bitmap_v2_order, server_Bpp);
LLOGLN(10, ("lfreerdp_cache_bitmapV2: upside down progressed"));
- /* old: g_memcpy(dst_data, cache_bitmap_v2_order->bitmapDataStream,width * height * server_Bpp);*/
}
dst_data1 = convert_bitmap(server_bpp, client_bpp, dst_data,
width, height, mod->colormap);
@@ -1334,7 +1379,13 @@ mod_exit(struct mod* mod)
{
return 0;
}
-
+ if(mod->inst == NULL)
+ {
+ LLOGLN(0, ("mod_exit - null pointer for inst:"));
+ g_free(mod);
+ return 0 ;
+ }
+ freerdp_disconnect(mod->inst);
if ((mod->vmaj == 1) && (mod->vmin == 0) && (mod->vrev == 1))
{
/* this version has a bug with double free in freerdp_free */