60 |
|
|
61 |
/* Receive an RDP packet */ |
/* Receive an RDP packet */ |
62 |
static STREAM |
static STREAM |
63 |
rdp_recv(uint8 *type) |
rdp_recv(uint8 * type) |
64 |
{ |
{ |
65 |
static STREAM rdp_s; |
static STREAM rdp_s; |
66 |
uint16 length, pdu_type; |
uint16 length, pdu_type; |
155 |
int len_password = 2 * strlen(password); |
int len_password = 2 * strlen(password); |
156 |
int len_program = 2 * strlen(program); |
int len_program = 2 * strlen(program); |
157 |
int len_directory = 2 * strlen(directory); |
int len_directory = 2 * strlen(directory); |
158 |
uint32 sec_flags = encryption ? (SEC_LOGON_INFO | SEC_ENCRYPT) |
uint32 sec_flags = encryption ? (SEC_LOGON_INFO | SEC_ENCRYPT) : SEC_LOGON_INFO; |
|
: SEC_LOGON_INFO; |
|
159 |
STREAM s; |
STREAM s; |
160 |
|
|
161 |
s = sec_init(sec_flags, 18 + len_domain + len_user + len_password |
s = sec_init(sec_flags, 18 + len_domain + len_user + len_password |
211 |
|
|
212 |
/* Send a single input event */ |
/* Send a single input event */ |
213 |
void |
void |
214 |
rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags, |
rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags, uint16 param1, uint16 param2) |
|
uint16 param1, uint16 param2) |
|
215 |
{ |
{ |
216 |
STREAM s; |
STREAM s; |
217 |
|
|
298 |
order_caps[0] = 1; /* dest blt */ |
order_caps[0] = 1; /* dest blt */ |
299 |
order_caps[1] = 1; /* pat blt */ |
order_caps[1] = 1; /* pat blt */ |
300 |
order_caps[2] = 1; /* screen blt */ |
order_caps[2] = 1; /* screen blt */ |
301 |
|
order_caps[3] = 1; /* required for memblt? */ |
302 |
order_caps[8] = 1; /* line */ |
order_caps[8] = 1; /* line */ |
303 |
order_caps[9] = 1; /* line */ |
order_caps[9] = 1; /* line */ |
304 |
order_caps[10] = 1; /* rect */ |
order_caps[10] = 1; /* rect */ |
441 |
RDP_CAPLEN_GENERAL + RDP_CAPLEN_BITMAP + RDP_CAPLEN_ORDER + |
RDP_CAPLEN_GENERAL + RDP_CAPLEN_BITMAP + RDP_CAPLEN_ORDER + |
442 |
RDP_CAPLEN_BMPCACHE + RDP_CAPLEN_COLCACHE + |
RDP_CAPLEN_BMPCACHE + RDP_CAPLEN_COLCACHE + |
443 |
RDP_CAPLEN_ACTIVATE + RDP_CAPLEN_CONTROL + |
RDP_CAPLEN_ACTIVATE + RDP_CAPLEN_CONTROL + |
444 |
RDP_CAPLEN_POINTER + RDP_CAPLEN_SHARE + RDP_CAPLEN_UNKNOWN |
RDP_CAPLEN_POINTER + RDP_CAPLEN_SHARE + RDP_CAPLEN_UNKNOWN + 4 /* w2k fix, why? */ ; |
|
+ 4 /* w2k fix, why? */; |
|
445 |
|
|
446 |
s = rdp_init(14 + caplen + sizeof(RDP_SOURCE)); |
s = rdp_init(14 + caplen + sizeof(RDP_SOURCE)); |
447 |
|
|
524 |
in_uint16_le(s, datalen); |
in_uint16_le(s, datalen); |
525 |
in_uint8p(s, data, datalen); |
in_uint8p(s, data, datalen); |
526 |
in_uint8p(s, mask, masklen); |
in_uint8p(s, mask, masklen); |
527 |
cursor = ui_create_cursor(x, y, width, height, mask, |
cursor = ui_create_cursor(x, y, width, height, mask, data); |
|
data); |
|
528 |
ui_set_cursor(cursor); |
ui_set_cursor(cursor); |
529 |
cache_put_cursor(cache_idx, cursor); |
cache_put_cursor(cache_idx, cursor); |
530 |
break; |
break; |
575 |
bmpdata = xmalloc(width * height); |
bmpdata = xmalloc(width * height); |
576 |
for (y = 0; y < height; y++) |
for (y = 0; y < height; y++) |
577 |
{ |
{ |
578 |
in_uint8a(s, |
in_uint8a(s, &bmpdata[(height - y - 1) * width], width); |
|
&bmpdata[(height - y - 1) * width], |
|
|
width); |
|
579 |
} |
} |
580 |
ui_paint_bitmap(left, top, cx, cy, width, height, |
ui_paint_bitmap(left, top, cx, cy, width, height, bmpdata); |
|
bmpdata); |
|
581 |
xfree(bmpdata); |
xfree(bmpdata); |
582 |
continue; |
continue; |
583 |
} |
} |
590 |
bmpdata = xmalloc(width * height); |
bmpdata = xmalloc(width * height); |
591 |
if (bitmap_decompress(bmpdata, width, height, data, size)) |
if (bitmap_decompress(bmpdata, width, height, data, size)) |
592 |
{ |
{ |
593 |
ui_paint_bitmap(left, top, cx, cy, width, height, |
ui_paint_bitmap(left, top, cx, cy, width, height, bmpdata); |
|
bmpdata); |
|
594 |
} |
} |
595 |
|
|
596 |
xfree(bmpdata); |
xfree(bmpdata); |
609 |
in_uint16_le(s, map.ncolours); |
in_uint16_le(s, map.ncolours); |
610 |
in_uint8s(s, 2); /* pad */ |
in_uint8s(s, 2); /* pad */ |
611 |
in_uint8p(s, colours, (map.ncolours * 3)); |
in_uint8p(s, colours, (map.ncolours * 3)); |
612 |
map.colours = (COLOURENTRY *)colours; |
map.colours = (COLOURENTRY *) colours; |
613 |
|
|
614 |
hmap = ui_create_colourmap(&map); |
hmap = ui_create_colourmap(&map); |
615 |
ui_set_colourmap(hmap); |
ui_set_colourmap(hmap); |
715 |
if (!sec_connect(server)) |
if (!sec_connect(server)) |
716 |
return False; |
return False; |
717 |
|
|
718 |
rdp_send_logon_info(flags, domain, username, password, |
rdp_send_logon_info(flags, domain, username, password, command, directory); |
|
command, directory); |
|
719 |
return True; |
return True; |
720 |
} |
} |
721 |
|
|