diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2012-11-10 16:43:55 -0800 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2012-11-10 16:43:55 -0800 |
commit | 49c4ee8c8c12e05c9895e9b59894bf57bb2bbdc9 (patch) | |
tree | 8eff7595036fe9e868e0afae869cd9b3d3546ff7 /xrdpapi/simple.c | |
parent | d9765c0783032c1c043620d0bbc489b3a7294403 (diff) | |
parent | 0d3a2c7207e80cd2bf9a3dedb23d20b218b2e75b (diff) | |
download | xrdp-proprietary-49c4ee8c8c12e05c9895e9b59894bf57bb2bbdc9.tar.gz xrdp-proprietary-49c4ee8c8c12e05c9895e9b59894bf57bb2bbdc9.zip |
Merge branch 'master' of github.com:FreeRDP/xrdp
Diffstat (limited to 'xrdpapi/simple.c')
-rw-r--r-- | xrdpapi/simple.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/xrdpapi/simple.c b/xrdpapi/simple.c index e6f5bd16..afe1a22c 100644 --- a/xrdpapi/simple.c +++ b/xrdpapi/simple.c @@ -101,6 +101,7 @@ run_echo_test() /* open a virtual channel named ECHO */ channel = WTSVirtualChannelOpenEx(WTS_CURRENT_SESSION, "ECHO", WTS_CHANNEL_OPTION_DYNAMIC_PRI_LOW); + if (channel == NULL) { printf("### WTSVirtualChannelOpenEx() failed!\n"); @@ -117,6 +118,7 @@ run_echo_test() /* write data to virtual channel */ count = (bytes_left > 1700) ? 1700 : bytes_left; rv = WTSVirtualChannelWrite(channel, wr_ptr, count, &bytes_written); + if ((rv == 0) || (bytes_written == 0)) { printf("### WTSVirtualChannelWrite() failed\n"); @@ -129,6 +131,7 @@ run_echo_test() { /* read back the echo */ rv = WTSVirtualChannelRead(channel, 5000, in_buf, count, &bytes_read); + if ((rv == 0) || (bytes_read == 0)) { printf("### WTSVirtualChannelRead() failed\n"); @@ -145,6 +148,7 @@ run_echo_test() return -1; } } + count -= bytes_read; } @@ -153,26 +157,27 @@ run_echo_test() printf("### pkt %d passed echo test\n", pkt_count++); } - WTSVirtualChannelClose(channel); - return 0; + WTSVirtualChannelClose(channel); + return 0; } int run_tsmf_test() { - void *channel; + void *channel; printf("this test not yet implemented!\n"); return 1; /* open virtual channel */ channel = WTSVirtualChannelOpenEx(WTS_CURRENT_SESSION, "TSMF", WTS_CHANNEL_OPTION_DYNAMIC_PRI_LOW); + if (channel == NULL) { printf("### WTSVirtualChannelOpenEx() failed!\n"); return 1; } - WTSVirtualChannelClose(channel); - return 0; + WTSVirtualChannelClose(channel); + return 0; } |