diff options
| author | jsorg71 <jsorg71> | 2004-09-11 21:27:39 +0000 |
|---|---|---|
| committer | jsorg71 <jsorg71> | 2004-09-11 21:27:39 +0000 |
| commit | e856dc67abedd0a38b766d2f0ecdde9a75424e27 (patch) | |
| tree | bad2c717659514642a73407dddb98248e4924b73 /xrdp/xrdp_mcs.c | |
| parent | 6560bcc78bd78a8d63dedea622702fc7368d23ad (diff) | |
| download | xrdp-proprietary-e856dc67abedd0a38b766d2f0ecdde9a75424e27.tar.gz xrdp-proprietary-e856dc67abedd0a38b766d2f0ecdde9a75424e27.zip | |
major work and login screen
Diffstat (limited to 'xrdp/xrdp_mcs.c')
| -rw-r--r-- | xrdp/xrdp_mcs.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/xrdp/xrdp_mcs.c b/xrdp/xrdp_mcs.c index 4cc24b89..0d26bb3c 100644 --- a/xrdp/xrdp_mcs.c +++ b/xrdp/xrdp_mcs.c @@ -41,6 +41,8 @@ struct xrdp_mcs* xrdp_mcs_create(struct xrdp_sec* owner) /*****************************************************************************/ void xrdp_mcs_delete(struct xrdp_mcs* self) { + if (self == 0) + return; xrdp_iso_delete(self->iso_layer); g_free(self); } @@ -64,7 +66,7 @@ int xrdp_mcs_send_cjcf(struct xrdp_mcs* self, int chanid) /*****************************************************************************/ /* returns error */ -int xrdp_mcs_recv(struct xrdp_mcs* self) +int xrdp_mcs_recv(struct xrdp_mcs* self, int* chan) { int appid; int opcode; @@ -91,7 +93,9 @@ int xrdp_mcs_recv(struct xrdp_mcs* self) DEBUG((" out xrdp_mcs_recv err got 0x%x need MCS_SDRQ\n\r", appid)); return 1; } - in_uint8s(self->in_s, 5); + in_uint8s(self->in_s, 2); + in_uint16_be(self->in_s, *chan); + in_uint8s(self->in_s, 1); in_uint8(self->in_s, len); if (len & 0x80) in_uint8s(self->in_s, 1); @@ -407,6 +411,7 @@ int xrdp_mcs_send(struct xrdp_mcs* self) { int len; + DEBUG((" in xrdp_mcs_send\n\r")); s_pop_layer(self->out_s, mcs_hdr); len = (self->out_s->end - self->out_s->p) - 8; len = len | 0x8000; @@ -417,5 +422,27 @@ int xrdp_mcs_send(struct xrdp_mcs* self) out_uint16_be(self->out_s, len); if (xrdp_iso_send(self->iso_layer) != 0) return 1; + DEBUG((" out xrdp_mcs_send\n\r")); + return 0; +} + +/*****************************************************************************/ +/* returns error */ +int xrdp_mcs_disconnect(struct xrdp_mcs* self) +{ + int len; + + xrdp_mcs_init(self, 100); + s_mark_end(self->out_s); + s_pop_layer(self->out_s, mcs_hdr); + len = (self->out_s->end - self->out_s->p) - 8; + len = len | 0x8000; + out_uint8(self->out_s, MCS_DPUM << 2); + out_uint16_be(self->out_s, self->userid); + out_uint16_be(self->out_s, MCS_GLOBAL_CHANNEL); + out_uint8(self->out_s, 0x70); + out_uint16_be(self->out_s, len); + if (xrdp_iso_send(self->iso_layer) != 0) + return 1; return 0; } |
