summaryrefslogtreecommitdiffstats
path: root/sesman
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2012-08-08 22:21:32 -0700
committerJay Sorg <jay.sorg@gmail.com>2012-08-08 22:21:32 -0700
commit7539d7271eb6ae2504f8a5e17a837aa453bc8355 (patch)
tree2347cd2d14a172050c406de1d2900ff494cfcd57 /sesman
parentf43e0eb68f78f5f279f1963224f8e7a2b97c4a4e (diff)
downloadxrdp-proprietary-7539d7271eb6ae2504f8a5e17a837aa453bc8355.tar.gz
xrdp-proprietary-7539d7271eb6ae2504f8a5e17a837aa453bc8355.zip
chansrv: work on dynamic channels
Diffstat (limited to 'sesman')
-rw-r--r--sesman/chansrv/chansrv.c25
-rw-r--r--sesman/chansrv/chansrv.h19
2 files changed, 37 insertions, 7 deletions
diff --git a/sesman/chansrv/chansrv.c b/sesman/chansrv/chansrv.c
index 365b285c..7c74bb4f 100644
--- a/sesman/chansrv/chansrv.c
+++ b/sesman/chansrv/chansrv.c
@@ -65,6 +65,7 @@ struct xrdp_api_data
{
int chan_id;
char header[64];
+ int flags;
};
/*****************************************************************************/
@@ -535,16 +536,26 @@ my_api_trans_conn_in(struct trans* trans, struct trans* new_trans)
g_memcpy(ad->header, s->data, 64);
+ ad->flags = GGET_UINT32(ad->header, 16);
+
found = 0;
- for (index = 0; index < g_num_chan_items; index++)
+ if (ad->flags | 1) /* WTS_CHANNEL_OPTION_DYNAMIC */
+ {
+ /* TODO */
+ found = 0;
+ }
+ else
{
- LOG(10, (" %s %s", ad->header, g_chan_items[index].name));
- if (g_strcasecmp(ad->header, g_chan_items[index].name) == 0)
+ for (index = 0; index < g_num_chan_items; index++)
{
- LOG(10, ("my_api_trans_conn_in: found it at %d", index));
- ad->chan_id = g_chan_items[index].id;
- found = 1;
- break;
+ LOG(10, (" %s %s", ad->header, g_chan_items[index].name));
+ if (g_strcasecmp(ad->header, g_chan_items[index].name) == 0)
+ {
+ LOG(10, ("my_api_trans_conn_in: found it at %d", index));
+ ad->chan_id = g_chan_items[index].id;
+ found = 1;
+ break;
+ }
}
}
LOG(10, ("my_api_trans_conn_in: found %d", found));
diff --git a/sesman/chansrv/chansrv.h b/sesman/chansrv/chansrv.h
index 7a84ec94..a7a0f3e7 100644
--- a/sesman/chansrv/chansrv.h
+++ b/sesman/chansrv/chansrv.h
@@ -54,4 +54,23 @@ main_cleanup(void);
#define LOGM(_args)
#endif
+#ifndef GSET_UINT8
+#define GSET_UINT8(_ptr, _offset, _data) \
+ *((unsigned char*) (((unsigned char*)(_ptr)) + (_offset))) = (unsigned char)(_data)
+#define GGET_UINT8(_ptr, _offset) \
+ (*((unsigned char*) (((unsigned char*)(_ptr)) + (_offset))))
+#define GSET_UINT16(_ptr, _offset, _data) \
+ GSET_UINT8(_ptr, _offset, _data); \
+ GSET_UINT8(_ptr, (_offset) + 1, (_data) >> 8)
+#define GGET_UINT16(_ptr, _offset) \
+ (GGET_UINT8(_ptr, _offset)) | \
+ ((GGET_UINT8(_ptr, (_offset) + 1)) << 8)
+#define GSET_UINT32(_ptr, _offset, _data) \
+ GSET_UINT16(_ptr, _offset, _data); \
+ GSET_UINT16(_ptr, (_offset) + 2, (_data) >> 16)
+#define GGET_UINT32(_ptr, _offset) \
+ (GGET_UINT16(_ptr, _offset)) | \
+ ((GGET_UINT16(_ptr, (_offset) + 2)) << 16)
+#endif
+
#endif