summaryrefslogtreecommitdiffstats
path: root/libxrdp
diff options
context:
space:
mode:
authorjsorg71 <jsorg71>2005-08-18 02:49:35 +0000
committerjsorg71 <jsorg71>2005-08-18 02:49:35 +0000
commit5e69f15cd7897a36aa6f79822e523b2dc7204e32 (patch)
tree81250becad8248a3bcce1aea049ffd5bf83955d5 /libxrdp
parent9d2ce459daf384586ad7f9f24a8847eafe84108e (diff)
downloadxrdp-proprietary-5e69f15cd7897a36aa6f79822e523b2dc7204e32.tar.gz
xrdp-proprietary-5e69f15cd7897a36aa6f79822e523b2dc7204e32.zip
harvest and pass on hostname and keylayout of client
Diffstat (limited to 'libxrdp')
-rw-r--r--libxrdp/libxrdpinc.h3
-rw-r--r--libxrdp/xrdp_sec.c39
2 files changed, 42 insertions, 0 deletions
diff --git a/libxrdp/libxrdpinc.h b/libxrdp/libxrdpinc.h
index 32c46cef..626b7bbd 100644
--- a/libxrdp/libxrdpinc.h
+++ b/libxrdp/libxrdpinc.h
@@ -41,6 +41,9 @@ struct xrdp_client_info
int op2; /* use smaller bitmap header in bitmap cache */
int desktop_cache;
int use_compact_packets; /* rdp5 smaller packets */
+ char hostname[32];
+ int build;
+ int keylayout;
};
struct xrdp_brush
diff --git a/libxrdp/xrdp_sec.c b/libxrdp/xrdp_sec.c
index 0616b656..a1cf27bc 100644
--- a/libxrdp/xrdp_sec.c
+++ b/libxrdp/xrdp_sec.c
@@ -577,6 +577,44 @@ xrdp_sec_out_mcs_data(struct xrdp_sec* self)
}
/*****************************************************************************/
+/* process the mcs client data we received from the mcs layer */
+static void APP_CC
+xrdp_sec_in_mcs_data(struct xrdp_sec* self)
+{
+ struct stream* s;
+ struct xrdp_client_info* client_info;
+ int index;
+ char c;
+
+ client_info = &self->rdp_layer->client_info;
+ s = &self->client_mcs_data;
+ /* get hostname, its unicode */
+ s->p = s->data;
+ in_uint8s(s, 47);
+ g_memset(client_info->hostname, 0, 32);
+ c = 1;
+ index = 0;
+ while (index < 16 && c != 0)
+ {
+ in_uint8(s, c);
+ in_uint8s(s, 1);
+ client_info->hostname[index] = c;
+ index++;
+ }
+ /* get build */
+ s->p = s->data;
+ in_uint8s(s, 43);
+ in_uint32_le(s, client_info->build);
+ /* get keylayout */
+ s->p = s->data;
+ in_uint8s(s, 39);
+ in_uint32_le(s, client_info->keylayout);
+// g_printf("%s %d %x\n", client_info->hostname, client_info->build,
+// client_info->keylayout);
+ s->p = s->data;
+}
+
+/*****************************************************************************/
int APP_CC
xrdp_sec_incoming(struct xrdp_sec* self)
{
@@ -595,6 +633,7 @@ xrdp_sec_incoming(struct xrdp_sec* self)
self->server_mcs_data.end - self->server_mcs_data.data);
#endif
DEBUG(("out xrdp_sec_incoming\n\r"));
+ xrdp_sec_in_mcs_data(self);
return 0;
}