diff options
Diffstat (limited to 'libxrdp/xrdp_fastpath.c')
-rw-r--r-- | libxrdp/xrdp_fastpath.c | 57 |
1 files changed, 38 insertions, 19 deletions
diff --git a/libxrdp/xrdp_fastpath.c b/libxrdp/xrdp_fastpath.c index 6a4eb78e..33e9c9d0 100644 --- a/libxrdp/xrdp_fastpath.c +++ b/libxrdp/xrdp_fastpath.c @@ -97,7 +97,7 @@ xrdp_fastpath_recv(struct xrdp_fastpath *self, struct stream *s) } /*****************************************************************************/ -/* no fragmenation */ +/* no fragmentation */ int APP_CC xrdp_fastpath_init(struct xrdp_fastpath *self, struct stream *s) { @@ -113,18 +113,6 @@ xrdp_fastpath_init(struct xrdp_fastpath *self, struct stream *s) } /*****************************************************************************/ -/* no fragmenation */ -int APP_CC -xrdp_fastpath_send(struct xrdp_fastpath *self, struct stream *s) -{ - if (trans_force_write_s(self->trans, s) != 0) - { - return 1; - } - return 0; -} - -/*****************************************************************************/ static int APP_CC xrdp_fastpath_session_callback(struct xrdp_fastpath *self, int msg, long param1, long param2, @@ -145,6 +133,19 @@ xrdp_fastpath_session_callback(struct xrdp_fastpath *self, int msg, } /*****************************************************************************/ +/* no fragmentation */ +int APP_CC +xrdp_fastpath_send(struct xrdp_fastpath *self, struct stream *s) +{ + if (trans_write_copy_s(self->trans, s) != 0) + { + return 1; + } + xrdp_fastpath_session_callback(self, 0x5556, 0, 0, 0, 0); + return 0; +} + +/*****************************************************************************/ /* FASTPATH_INPUT_EVENT_SCANCODE */ static int APP_CC xrdp_fastpath_process_EVENT_SCANCODE(struct xrdp_fastpath *self, @@ -264,12 +265,30 @@ static int APP_CC xrdp_fastpath_process_EVENT_UNICODE(struct xrdp_fastpath *self, int eventFlags, struct stream *s) { - if (!s_check_rem(s, 2)) - { - return 1; - } - in_uint8s(s, 2); - return 0; + int flags; + int code; + + flags = 0; + if (!s_check_rem(s, 2)) + { + return 1; + } + in_uint16_le(s, code); /* unicode (2 byte) */ + if (eventFlags & FASTPATH_INPUT_KBDFLAGS_RELEASE) + { + flags |= KBD_FLAG_UP; + } + else + { + flags |= KBD_FLAG_DOWN; + } + if (eventFlags & FASTPATH_INPUT_KBDFLAGS_EXTENDED) + { + flags |= KBD_FLAG_EXT; + } + xrdp_fastpath_session_callback(self, RDP_INPUT_UNICODE, + code, 0, flags, 0); + return 0; } /*****************************************************************************/ |