|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
/**
|
|
|
|
|
* xrdp: A Remote Desktop Protocol server.
|
|
|
|
|
*
|
|
|
|
|
* Copyright (C) Jay Sorg 2012-2013
|
|
|
|
|
* Copyright (C) Jay Sorg 2012-2014
|
|
|
|
|
* Copyright (C) Idan Freiberg 2013-2014
|
|
|
|
|
*
|
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
@ -52,6 +52,7 @@ xrdp_fastpath_reset(struct xrdp_fastpath *self)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
int APP_CC
|
|
|
|
|
xrdp_fastpath_recv(struct xrdp_fastpath *self, struct stream *s)
|
|
|
|
@ -59,8 +60,10 @@ xrdp_fastpath_recv(struct xrdp_fastpath *self, struct stream *s)
|
|
|
|
|
int fp_hdr;
|
|
|
|
|
int len = 0; /* unused */
|
|
|
|
|
int byte;
|
|
|
|
|
DEBUG((" in xrdp_fastpath_recv"));
|
|
|
|
|
char *holdp;
|
|
|
|
|
|
|
|
|
|
DEBUG((" in xrdp_fastpath_recv"));
|
|
|
|
|
holdp = s->p;
|
|
|
|
|
if (!s_check_rem(s, 2))
|
|
|
|
|
{
|
|
|
|
|
return 1;
|
|
|
|
@ -88,11 +91,11 @@ xrdp_fastpath_recv(struct xrdp_fastpath *self, struct stream *s)
|
|
|
|
|
{
|
|
|
|
|
len = byte;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
s->next_packet = holdp + len;
|
|
|
|
|
DEBUG((" out xrdp_fastpath_recv"));
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
int APP_CC
|
|
|
|
|
xrdp_fastpath_init(struct xrdp_fastpath *self)
|
|
|
|
@ -283,10 +286,12 @@ xrdp_fastpath_process_EVENT_SCANCODE(struct xrdp_fastpath *self, int eventFlags,
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/* FASTPATH_INPUT_EVENT_MOUSE */
|
|
|
|
|
int APP_CC
|
|
|
|
|
xrdp_fastpath_process_EVENT_MOUSE(struct xrdp_fastpath *self, int eventFlags, struct stream *s)
|
|
|
|
|
xrdp_fastpath_process_EVENT_MOUSE(struct xrdp_fastpath *self, int eventFlags,
|
|
|
|
|
struct stream *s)
|
|
|
|
|
{
|
|
|
|
|
int pointerFlags;
|
|
|
|
|
int xPos;
|
|
|
|
@ -308,15 +313,17 @@ xrdp_fastpath_process_EVENT_MOUSE(struct xrdp_fastpath *self, int eventFlags, st
|
|
|
|
|
RDP_INPUT_MOUSE - 0x8001
|
|
|
|
|
RDP_INPUT_MOUSEX - 0x8002 */
|
|
|
|
|
/* call to xrdp_wm.c : callback */
|
|
|
|
|
self->session->callback(self->session->id, RDP_INPUT_MOUSE, xPos, yPos,
|
|
|
|
|
pointerFlags, 0);
|
|
|
|
|
self->session->callback(self->session->id, RDP_INPUT_MOUSE,
|
|
|
|
|
xPos, yPos, pointerFlags, 0);
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/* FASTPATH_INPUT_EVENT_MOUSEX */
|
|
|
|
|
int APP_CC
|
|
|
|
|
xrdp_fastpath_process_EVENT_MOUSEX(struct xrdp_fastpath *self, int eventFlags, struct stream *s)
|
|
|
|
|
xrdp_fastpath_process_EVENT_MOUSEX(struct xrdp_fastpath *self,
|
|
|
|
|
int eventFlags, struct stream *s)
|
|
|
|
|
{
|
|
|
|
|
int pointerFlags;
|
|
|
|
|
int xPos;
|
|
|
|
@ -338,11 +345,12 @@ xrdp_fastpath_process_EVENT_MOUSEX(struct xrdp_fastpath *self, int eventFlags, s
|
|
|
|
|
RDP_INPUT_MOUSE - 0x8001
|
|
|
|
|
RDP_INPUT_MOUSEX - 0x8002 */
|
|
|
|
|
/* call to xrdp_wm.c : callback */
|
|
|
|
|
self->session->callback(self->session->id, RDP_INPUT_MOUSEX, xPos, yPos,
|
|
|
|
|
pointerFlags, 0);
|
|
|
|
|
self->session->callback(self->session->id, RDP_INPUT_MOUSEX,
|
|
|
|
|
xPos, yPos, pointerFlags, 0);
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/* FASTPATH_INPUT_EVENT_SYNC */
|
|
|
|
|
int APP_CC
|
|
|
|
@ -361,15 +369,17 @@ xrdp_fastpath_process_EVENT_SYNC(struct xrdp_fastpath *self, int eventCode, int
|
|
|
|
|
RDP_INPUT_MOUSE - 0x8001
|
|
|
|
|
RDP_INPUT_MOUSEX - 0x8002 */
|
|
|
|
|
/* call to xrdp_wm.c : callback */
|
|
|
|
|
self->session->callback(self->session->id, RDP_INPUT_SYNCHRONIZE, eventCode, 0,
|
|
|
|
|
eventFlags, 0);
|
|
|
|
|
self->session->callback(self->session->id, RDP_INPUT_SYNCHRONIZE,
|
|
|
|
|
eventCode, 0, eventFlags, 0);
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/* FASTPATH_INPUT_EVENT_UNICODE */
|
|
|
|
|
int APP_CC
|
|
|
|
|
xrdp_fastpath_process_EVENT_UNICODE(struct xrdp_fastpath *self, int eventFlags, struct stream *s)
|
|
|
|
|
xrdp_fastpath_process_EVENT_UNICODE(struct xrdp_fastpath *self,
|
|
|
|
|
int eventFlags, struct stream *s)
|
|
|
|
|
{
|
|
|
|
|
if (!s_check_rem(s, 2))
|
|
|
|
|
{
|
|
|
|
@ -378,6 +388,7 @@ xrdp_fastpath_process_EVENT_UNICODE(struct xrdp_fastpath *self, int eventFlags,
|
|
|
|
|
in_uint8s(s, 2);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/* FASTPATH_INPUT_EVENT */
|
|
|
|
|
int APP_CC
|
|
|
|
@ -389,7 +400,8 @@ xrdp_fastpath_process_input_event(struct xrdp_fastpath *self, struct stream *s)
|
|
|
|
|
int eventFlags;
|
|
|
|
|
|
|
|
|
|
// process fastpath input events
|
|
|
|
|
for (i = 0 ; i < self->numEvents ; i++) {
|
|
|
|
|
for (i = 0; i < self->numEvents; i++)
|
|
|
|
|
{
|
|
|
|
|
if (!s_check_rem(s, 1))
|
|
|
|
|
{
|
|
|
|
|
return 1;
|
|
|
|
@ -439,8 +451,6 @@ xrdp_fastpath_process_input_event(struct xrdp_fastpath *self, struct stream *s)
|
|
|
|
|
g_writeln("xrdp_fastpath_process_input_event: unknown eventCode %d", eventCode);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|