work on suppress

This commit is contained in:
Jay Sorg 2019-04-07 17:56:05 -07:00
parent 9e9cada4ec
commit 21f90e3ca2
7 changed files with 81 additions and 8 deletions

View File

@ -1218,8 +1218,6 @@ xrdp_rdp_process_suppress(struct xrdp_rdp *self, struct stream *s)
int top; int top;
int right; int right;
int bottom; int bottom;
int cx;
int cy;
if (!s_check_rem(s, 1)) if (!s_check_rem(s, 1))
{ {
@ -1234,6 +1232,11 @@ xrdp_rdp_process_suppress(struct xrdp_rdp *self, struct stream *s)
self->client_info.suppress_output = 1; self->client_info.suppress_output = 1;
g_writeln("xrdp_rdp_process_suppress: suppress_output %d", g_writeln("xrdp_rdp_process_suppress: suppress_output %d",
self->client_info.suppress_output); self->client_info.suppress_output);
if (self->session->callback != 0)
{
self->session->callback(self->session->id, 0x5559, 1,
0, 0, 0);
}
break; break;
case 1: /* ALLOW_DISPLAY_UPDATES */ case 1: /* ALLOW_DISPLAY_UPDATES */
self->client_info.suppress_output = 0; self->client_info.suppress_output = 0;
@ -1250,12 +1253,11 @@ xrdp_rdp_process_suppress(struct xrdp_rdp *self, struct stream *s)
"left %d top %d right %d bottom %d", "left %d top %d right %d bottom %d",
self->client_info.suppress_output, self->client_info.suppress_output,
left, top, right, bottom); left, top, right, bottom);
cx = right - left;
cy = bottom - top;
if (self->session->callback != 0) if (self->session->callback != 0)
{ {
self->session->callback(self->session->id, 0x4444, self->session->callback(self->session->id, 0x5559, 0,
left, top, cx, cy); MAKELONG(left, top),
MAKELONG(right, bottom), 0);
} }
break; break;
} }

View File

@ -371,6 +371,9 @@ xrdp_bitmap_compress(char* in_data, int width, int height,
/* xrdp_mm.c */ /* xrdp_mm.c */
int int
xrdp_mm_drdynvc_up(struct xrdp_mm* self); xrdp_mm_drdynvc_up(struct xrdp_mm* self);
int
xrdp_mm_suppress_output(struct xrdp_mm* self, int suppress,
int left, int top, int right, int bottom);
struct xrdp_mm* struct xrdp_mm*
xrdp_mm_create(struct xrdp_wm* owner); xrdp_mm_create(struct xrdp_wm* owner);
void void

View File

@ -999,6 +999,25 @@ xrdp_mm_drdynvc_up(struct xrdp_mm* self)
return 0; return 0;
} }
/******************************************************************************/
int
xrdp_mm_suppress_output(struct xrdp_mm* self, int suppress,
int left, int top, int right, int bottom)
{
LLOGLN(0, ("xrdp_mm_suppress_output: suppress %d "
"left %d top %d right %d bottom %d",
suppress, left, top, right, bottom));
if (self->mod != NULL)
{
if (self->mod->mod_suppress_output != NULL)
{
self->mod->mod_suppress_output(self->mod, suppress,
left, top, right, bottom);
}
}
return 0;
}
/*****************************************************************************/ /*****************************************************************************/
/* open response from client going to channel server */ /* open response from client going to channel server */
static int static int

View File

@ -48,7 +48,9 @@ struct xrdp_mod
tbus* write_objs, int* wcount, int* timeout); tbus* write_objs, int* wcount, int* timeout);
int (*mod_check_wait_objs)(struct xrdp_mod* v); int (*mod_check_wait_objs)(struct xrdp_mod* v);
int (*mod_frame_ack)(struct xrdp_mod* v, int flags, int frame_id); int (*mod_frame_ack)(struct xrdp_mod* v, int flags, int frame_id);
tintptr mod_dumby[100 - 10]; /* align, 100 minus the number of mod int (*mod_suppress_output)(struct xrdp_mod* v, int suppress,
int left, int top, int right, int bottom);
tintptr mod_dumby[100 - 11]; /* align, 100 minus the number of mod
functions above */ functions above */
/* server functions */ /* server functions */
int (*server_begin_update)(struct xrdp_mod* v); int (*server_begin_update)(struct xrdp_mod* v);

View File

@ -1916,6 +1916,11 @@ callback(intptr_t id, int msg, intptr_t param1, intptr_t param2,
case 0x5558: case 0x5558:
xrdp_mm_drdynvc_up(wm->mm); xrdp_mm_drdynvc_up(wm->mm);
break; break;
case 0x5559:
xrdp_mm_suppress_output(wm->mm, param1,
LOWORD(param2), HIWORD(param2),
LOWORD(param3), HIWORD(param3));
break;
} }
return rv; return rv;
} }

View File

@ -1143,6 +1143,33 @@ send_paint_rect_ex_ack(struct mod *mod, int flags, int frame_id)
return 0; return 0;
} }
/******************************************************************************/
/* return error */
static int
send_suppress_output(struct mod *mod, int suppress,
int left, int top, int right, int bottom)
{
int len;
struct stream *s;
make_stream(s);
init_stream(s, 8192);
s_push_layer(s, iso_hdr, 4);
out_uint16_le(s, 108);
out_uint32_le(s, suppress);
out_uint32_le(s, left);
out_uint32_le(s, top);
out_uint32_le(s, right);
out_uint32_le(s, bottom);
s_mark_end(s);
len = (int)(s->end - s->data);
s_pop_layer(s, iso_hdr);
out_uint32_le(s, len);
lib_send_copy(mod, s);
free_stream(s);
return 0;
}
/******************************************************************************/ /******************************************************************************/
/* return error */ /* return error */
static int static int
@ -1556,6 +1583,18 @@ lib_mod_frame_ack(struct mod *amod, int flags, int frame_id)
return 0; return 0;
} }
/******************************************************************************/
/* return error */
int
lib_mod_suppress_output(struct mod *amod, int suppress,
int left, int top, int right, int bottom)
{
LLOGLN(10, ("lib_mod_suppress_output: suppress 0x%8.8x left %d top %d "
"right %d bottom %d", suppress, left, top, right, bottom));
send_suppress_output(amod, suppress, left, top, right, bottom);
return 0;
}
/******************************************************************************/ /******************************************************************************/
tintptr EXPORT_CC tintptr EXPORT_CC
mod_init(void) mod_init(void)
@ -1575,6 +1614,7 @@ mod_init(void)
mod->mod_get_wait_objs = lib_mod_get_wait_objs; mod->mod_get_wait_objs = lib_mod_get_wait_objs;
mod->mod_check_wait_objs = lib_mod_check_wait_objs; mod->mod_check_wait_objs = lib_mod_check_wait_objs;
mod->mod_frame_ack = lib_mod_frame_ack; mod->mod_frame_ack = lib_mod_frame_ack;
mod->mod_suppress_output = lib_mod_suppress_output;
return (tintptr) mod; return (tintptr) mod;
} }

View File

@ -45,7 +45,9 @@ struct mod
tbus* write_objs, int* wcount, int* timeout); tbus* write_objs, int* wcount, int* timeout);
int (*mod_check_wait_objs)(struct mod* v); int (*mod_check_wait_objs)(struct mod* v);
int (*mod_frame_ack)(struct mod* v, int flags, int frame_id); int (*mod_frame_ack)(struct mod* v, int flags, int frame_id);
tintptr mod_dumby[100 - 10]; /* align, 100 minus the number of mod int (*mod_suppress_output)(struct mod* v, int suppress,
int left, int top, int right, int bottom);
tintptr mod_dumby[100 - 11]; /* align, 100 minus the number of mod
functions above */ functions above */
/* server functions */ /* server functions */
int (*server_begin_update)(struct mod* v); int (*server_begin_update)(struct mod* v);