21 |
#include "rdesktop.h" |
#include "rdesktop.h" |
22 |
|
|
23 |
extern uint16 g_mcs_userid; |
extern uint16 g_mcs_userid; |
24 |
extern char username[16]; |
extern char g_username[16]; |
25 |
extern BOOL bitmap_compression; |
extern BOOL g_bitmap_compression; |
26 |
extern BOOL orders; |
extern BOOL g_orders; |
27 |
extern BOOL encryption; |
extern BOOL g_encryption; |
28 |
extern BOOL desktop_save; |
extern BOOL desktop_save; |
29 |
extern BOOL use_rdp5; |
extern BOOL use_rdp5; |
30 |
extern uint16 server_rdp_version; |
extern uint16 server_rdp_version; |
84 |
{ |
{ |
85 |
STREAM s; |
STREAM s; |
86 |
|
|
87 |
s = sec_init(encryption ? SEC_ENCRYPT : 0, maxlen + 18); |
s = sec_init(g_encryption ? SEC_ENCRYPT : 0, maxlen + 18); |
88 |
s_push_layer(s, rdp_hdr, 18); |
s_push_layer(s, rdp_hdr, 18); |
89 |
|
|
90 |
return s; |
return s; |
111 |
out_uint8(s, 0); /* compress_type */ |
out_uint8(s, 0); /* compress_type */ |
112 |
out_uint16(s, 0); /* compress_len */ |
out_uint16(s, 0); /* compress_len */ |
113 |
|
|
114 |
sec_send(s, encryption ? SEC_ENCRYPT : 0); |
sec_send(s, g_encryption ? SEC_ENCRYPT : 0); |
115 |
} |
} |
116 |
|
|
117 |
/* Output a string in Unicode */ |
/* Output a string in Unicode */ |
144 |
int len_ip = 2 * strlen("127.0.0.1"); |
int len_ip = 2 * strlen("127.0.0.1"); |
145 |
int len_dll = 2 * strlen("C:\\WINNT\\System32\\mstscax.dll"); |
int len_dll = 2 * strlen("C:\\WINNT\\System32\\mstscax.dll"); |
146 |
int packetlen = 0; |
int packetlen = 0; |
147 |
uint32 sec_flags = encryption ? (SEC_LOGON_INFO | SEC_ENCRYPT) : SEC_LOGON_INFO; |
uint32 sec_flags = g_encryption ? (SEC_LOGON_INFO | SEC_ENCRYPT) : SEC_LOGON_INFO; |
148 |
STREAM s; |
STREAM s; |
149 |
|
|
150 |
if (!use_rdp5 || 1 == server_rdp_version) |
if (!use_rdp5 || 1 == server_rdp_version) |
387 |
out_uint16_le(s, 600); /* Desktop height */ |
out_uint16_le(s, 600); /* Desktop height */ |
388 |
out_uint16(s, 0); /* Pad */ |
out_uint16(s, 0); /* Pad */ |
389 |
out_uint16(s, 0); /* Allow resize */ |
out_uint16(s, 0); /* Allow resize */ |
390 |
out_uint16_le(s, bitmap_compression ? 1 : 0); /* Support compression */ |
out_uint16_le(s, g_bitmap_compression ? 1 : 0); /* Support compression */ |
391 |
out_uint16(s, 0); /* Unknown */ |
out_uint16(s, 0); /* Unknown */ |
392 |
out_uint16_le(s, 1); /* Unknown */ |
out_uint16_le(s, 1); /* Unknown */ |
393 |
out_uint16(s, 0); /* Pad */ |
out_uint16(s, 0); /* Pad */ |
546 |
rdp_send_confirm_active(void) |
rdp_send_confirm_active(void) |
547 |
{ |
{ |
548 |
STREAM s; |
STREAM s; |
549 |
uint32 sec_flags = encryption ? (RDP5_FLAG | SEC_ENCRYPT) : RDP5_FLAG; |
uint32 sec_flags = g_encryption ? (RDP5_FLAG | SEC_ENCRYPT) : RDP5_FLAG; |
550 |
uint16 caplen = |
uint16 caplen = |
551 |
RDP_CAPLEN_GENERAL + RDP_CAPLEN_BITMAP + RDP_CAPLEN_ORDER + |
RDP_CAPLEN_GENERAL + RDP_CAPLEN_BITMAP + RDP_CAPLEN_ORDER + |
552 |
RDP_CAPLEN_BMPCACHE + RDP_CAPLEN_COLCACHE + |
RDP_CAPLEN_BMPCACHE + RDP_CAPLEN_COLCACHE + |
898 |
rdp_connect(char *server, uint32 flags, char *domain, char *password, |
rdp_connect(char *server, uint32 flags, char *domain, char *password, |
899 |
char *command, char *directory) |
char *command, char *directory) |
900 |
{ |
{ |
901 |
if (!sec_connect(server, username)) |
if (!sec_connect(server, g_username)) |
902 |
return False; |
return False; |
903 |
|
|
904 |
rdp_send_logon_info(flags, domain, username, password, command, directory); |
rdp_send_logon_info(flags, domain, g_username, password, command, directory); |
905 |
return True; |
return True; |
906 |
} |
} |
907 |
|
|