176 |
{ |
{ |
177 |
MCS_DATA data; |
MCS_DATA data; |
178 |
|
|
179 |
return (iso_recv(conn)) && mcs_io_data(&conn->in, &data, request); |
if (!iso_recv(conn) || !mcs_io_data(&conn->in, &data, request)) |
180 |
|
return False; |
181 |
|
|
182 |
|
#ifdef MCS_DEBUG |
183 |
|
fprintf(stderr, "MCS packet\n"); |
184 |
|
dump_data(conn->in.data+conn->in.offset, conn->in.end-conn->in.offset); |
185 |
|
#endif |
186 |
|
|
187 |
|
conn->in.rdp_offset = conn->in.offset; |
188 |
|
return True; |
189 |
} |
} |
190 |
|
|
191 |
/* Initialise a DOMAIN_PARAMS structure */ |
/* Initialise a DOMAIN_PARAMS structure */ |
252 |
BOOL res; |
BOOL res; |
253 |
|
|
254 |
/* Read/write tag */ |
/* Read/write tag */ |
255 |
if (islong) { |
if (islong) |
256 |
|
{ |
257 |
word_tag = tagval; |
word_tag = tagval; |
258 |
res = msb_io_uint16(s, &word_tag); |
res = msb_io_uint16(s, &word_tag); |
259 |
tag = word_tag; |
tag = word_tag; |
260 |
} else { |
} |
261 |
|
else |
262 |
|
{ |
263 |
byte_tag = tagval; |
byte_tag = tagval; |
264 |
res = prs_io_uint8(s, &byte_tag); |
res = prs_io_uint8(s, &byte_tag); |
265 |
tag = byte_tag; |
tag = byte_tag; |
266 |
} |
} |
267 |
|
|
268 |
if (!res || (tag != tagval)) { |
if (!res || (tag != tagval)) |
269 |
|
{ |
270 |
fprintf(stderr, "Invalid ASN.1 tag\n"); |
fprintf(stderr, "Invalid ASN.1 tag\n"); |
271 |
return False; |
return False; |
272 |
} |
} |
537 |
{ |
{ |
538 |
uint8 opcode = (request ? 25 : 26) << 2; |
uint8 opcode = (request ? 25 : 26) << 2; |
539 |
uint8 pkt_opcode = opcode; |
uint8 pkt_opcode = opcode; |
540 |
|
uint8 byte1, byte2; |
541 |
BOOL res; |
BOOL res; |
542 |
|
|
543 |
res = prs_io_uint8(s, &pkt_opcode); |
res = prs_io_uint8(s, &pkt_opcode); |
552 |
res = res ? msb_io_uint16(s, &dt->userid) : False; |
res = res ? msb_io_uint16(s, &dt->userid) : False; |
553 |
res = res ? msb_io_uint16(s, &dt->chanid) : False; |
res = res ? msb_io_uint16(s, &dt->chanid) : False; |
554 |
res = res ? prs_io_uint8 (s, &dt->flags ) : False; |
res = res ? prs_io_uint8 (s, &dt->flags ) : False; |
555 |
res = res ? msb_io_uint16(s, &dt->length) : False; |
|
556 |
|
if (s->marshall) |
557 |
|
{ |
558 |
|
res = res ? msb_io_uint16(s, &dt->length) : False; |
559 |
|
} |
560 |
|
else |
561 |
|
{ |
562 |
|
res = res ? prs_io_uint8(s, &byte1) : False; |
563 |
|
if (byte1 & 0x80) |
564 |
|
{ |
565 |
|
res = res ? prs_io_uint8(s, &byte2) : False; |
566 |
|
dt->length = ((byte1 & ~0x80) << 8) + byte2; |
567 |
|
} |
568 |
|
else dt->length = byte1; |
569 |
|
} |
570 |
|
|
571 |
return res; |
return res; |
572 |
} |
} |
573 |
|
|