summaryrefslogtreecommitdiffstats
path: root/xrdpapi
diff options
context:
space:
mode:
Diffstat (limited to 'xrdpapi')
-rw-r--r--xrdpapi/simple.c11
-rw-r--r--xrdpapi/xrdpapi.c8
-rw-r--r--xrdpapi/xrdpapi.h6
3 files changed, 21 insertions, 4 deletions
diff --git a/xrdpapi/simple.c b/xrdpapi/simple.c
index 7c7ff576..a2c0f875 100644
--- a/xrdpapi/simple.c
+++ b/xrdpapi/simple.c
@@ -16,20 +16,25 @@ int main()
{
// Initialize the data for send/receive
+ void* hFile;
char* data;
char* data1;
data = (char*)malloc(DSIZE);
data1 = (char*)malloc(DSIZE);
+ int ret;
+ void* vcFileHandlePtr = NULL;
memset(data, 0xca, DSIZE);
memset(data1, 0, DSIZE);
+ unsigned int written = 0;
// Open the skel channel in current session
- void* channel = WTSVirtualChannelOpenEx(WTS_CURRENT_SESSION, "skel", 0);
+ //void* channel = WTSVirtualChannelOpenEx(WTS_CURRENT_SESSION, "skel", 0);
+ void* channel = WTSVirtualChannelOpenEx(WTS_CURRENT_SESSION, "TSMF", WTS_CHANNEL_OPTION_DYNAMIC);
+ ret = WTSVirtualChannelQuery(channel, WTSVirtualFileHandle, vcFileHandlePtr, &written);
- unsigned int written = 0;
// Write the data to the channel
- int ret = WTSVirtualChannelWrite(channel, data, DSIZE, &written);
+ ret = WTSVirtualChannelWrite(channel, data, DSIZE, &written);
if (!ret)
{
diff --git a/xrdpapi/xrdpapi.c b/xrdpapi/xrdpapi.c
index 6c4eced0..694b3800 100644
--- a/xrdpapi/xrdpapi.c
+++ b/xrdpapi/xrdpapi.c
@@ -45,6 +45,7 @@ struct wts_obj
char name[8];
char dname[128];
int display_num;
+ int flags;
};
/*****************************************************************************/
@@ -158,6 +159,10 @@ send_init(struct wts_obj* wts)
memset(initmsg, 0, 64);
strncpy(initmsg, wts->name, 8);
+ initmsg[16] = (wts->flags >> 0) & 0xff;
+ initmsg[17] = (wts->flags >> 8) & 0xff;
+ initmsg[18] = (wts->flags >> 16) & 0xff;
+ initmsg[19] = (wts->flags >> 24) & 0xff;
LLOGLN(10, ("send_init: sending %s", initmsg));
if (!can_send(wts->fd, 500))
{
@@ -191,6 +196,7 @@ WTSVirtualChannelOpenEx(unsigned int SessionId,
wts = (struct wts_obj*)malloc(sizeof(struct wts_obj));
memset(wts, 0, sizeof(struct wts_obj));
wts->fd = -1;
+ wts->flags = flags;
display_text = getenv("DISPLAY");
if (display_text != 0)
{
@@ -363,7 +369,7 @@ WTSVirtualChannelQuery(void* hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualClass,
*ppBuffer = malloc(4);
memcpy(*ppBuffer, &(wts->fd), 4);
}
- return 0;
+ return 1;
}
/*****************************************************************************/
diff --git a/xrdpapi/xrdpapi.h b/xrdpapi/xrdpapi.h
index c39c4f1b..65b6db42 100644
--- a/xrdpapi/xrdpapi.h
+++ b/xrdpapi/xrdpapi.h
@@ -30,6 +30,12 @@ extern "C" {
#define WTS_CURRENT_SERVER_HANDLE 0
#define WTS_CURRENT_SESSION 0xffffffff
+#define WTS_CHANNEL_OPTION_DYNAMIC 0x00000001
+#define WTS_CHANNEL_OPTION_DYNAMIC_PRI_LOW 0x00000000
+#define WTS_CHANNEL_OPTION_DYNAMIC_PRI_MED 0x00000002
+#define WTS_CHANNEL_OPTION_DYNAMIC_PRI_HIGH 0x00000004
+#define WTS_CHANNEL_OPTION_DYNAMIC_PRI_REAL 0x00000006
+#define WTS_CHANNEL_OPTION_DYNAMIC_PRI_COMPRESS 0x00000008
typedef enum _WTS_VIRTUAL_CLASS
{