64 This->next_packet = rdp_s->
p;
68 rdp_s->
p =
This->next_packet;
75 This->next_packet += 8;
81 *
type = pdu_type & 0xf;
84 DEBUG((
"RDP packet #%d, (type %x)\n", ++
This->rdp.packetno, *
type));
137 size_t ibl =
strlen(
string), obl =
len + 2;
143 if (
This->rdp.iconv_works)
150 warning(
"rdp_out_unistr: iconv_open[%s -> %s] fail %d\n",
157 if (
iconv(iconv_h, (ICONV_CONST
char **) &
pin, &
i, &pout, &o) ==
162 warning(
"rdp_out_unistr: iconv(1) fail, errno %d\n",
errno);
169 pout = (
char *)
s->p;
172 if (
iconv(iconv_h, (ICONV_CONST
char **) &
pin, &ibl, &pout, &obl) == (
size_t) - 1)
176 warning(
"rdp_out_unistr: iconv(2) fail, errno %d\n",
errno);
197 s->p[
i++] = (
c >> 0) & 0xFF;
198 s->p[
i++] = (
c >> 8) & 0xFF;
213 size_t ibl = uni_len, obl = uni_len;
214 char *
pin = (
char *)
s->p, *pout =
string;
217 if (
This->rdp.iconv_works)
223 warning(
"rdp_in_unistr: iconv_open[%s -> %s] fail %d\n",
231 if (
iconv(iconv_h, (ICONV_CONST
char **) &
pin, &ibl, &pout, &obl) == (
size_t) - 1)
235 warning(
"rdp_in_unistr: iconv fail, errno %d\n",
errno);
252 while (
i < uni_len / 2)
275 int len_dll = 2 * (
int)
wcslen(
L"C:\\WINNT\\System32\\mstscax.dll");
282 if (!
This->use_rdp5 || 1 ==
This->server_rdp_version)
284 DEBUG_RDP5((
"Sending RDP4-style Logon packet\n"));
286 s =
sec_init(
This, sec_flags, 18 + len_domain + len_user + len_password
287 + len_program + len_directory + 10);
309 DEBUG_RDP5((
"Sending RDP5-style Logon packet\n"));
318 (0 < len_domain ? len_domain : 2) +
321 (0 < len_program ? len_program : 2) + (0 < len_directory ? len_directory : 2) + 2 +
334 DEBUG_RDP5((
"Called sec_init with packetlen %d\n", packetlen));
376 if (0 < len_directory)
537 if (num_keys -
offset <= 169)
635 uint8 order_caps[32];
637 memset(order_caps, 0, 32);
641 order_caps[3] = (
This->bitmap_cache ? 1 : 0);
646 order_caps[11] = (
This->desktop_save ? 1 : 0);
649 order_caps[20] = (
This->polygon_ellipse_orders ? 1 : 0);
650 order_caps[21] = (
This->polygon_ellipse_orders ? 1 : 0);
652 order_caps[25] = (
This->polygon_ellipse_orders ? 1 : 0);
653 order_caps[26] = (
This->polygon_ellipse_orders ? 1 : 0);
681 Bpp = (
This->server_depth + 7) / 8;
776 0x01, 0x00, 0x00, 0x00, 0x09, 0x04, 0x00, 0x00,
777 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
778 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
779 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
780 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
781 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
782 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
783 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
784 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
785 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
786 0x00, 0x00, 0x00, 0x00
794 0xFE, 0x00, 0x04, 0x00, 0xFE, 0x00, 0x04, 0x00,
795 0xFE, 0x00, 0x08, 0x00, 0xFE, 0x00, 0x08, 0x00,
796 0xFE, 0x00, 0x10, 0x00, 0xFE, 0x00, 0x20, 0x00,
797 0xFE, 0x00, 0x40, 0x00, 0xFE, 0x00, 0x80, 0x00,
798 0xFE, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x08,
799 0x00, 0x01, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00
812#define RDP5_FLAG 0x0030
824 0x58 + 0x08 + 0x08 + 0x34 +
897 warning(
"Remote desktop does not support colour depth %d; falling back to %d\n",
903 warning(
"Remote desktop changed from %dx%d to %dx%d.\n",
This->width,
This->height,
917 uint16 ncapsets, capset_type, capset_length;
924 for (
n = 0;
n < ncapsets;
n++)
932 next =
s->p + capset_length - 4;
954 uint16 len_src_descriptor, len_combined_caps;
961 DEBUG((
"DEMAND_ACTIVE(id=0x%x)\n",
This->rdp_shareid));
1032 uint16 system_pointer_type;
1035 switch (system_pointer_type)
1042 unimpl(
"System pointer message 0x%x\n", system_pointer_type);
1056 switch (message_type)
1078 unimpl(
"Pointer message 0x%x\n", message_type);
1094 for (
i = 0;
i < num_updates;
i++)
1103 Bpp = (
bpp + 7) / 8;
1110 DEBUG((
"BITMAP_UPDATE(l=%d,t=%d,r=%d,b=%d,w=%d,h=%d,Bpp=%d,cmp=%d)\n",
1183 DEBUG((
"PALETTE(c=%d)\n",
map.ncolours));
1185 for (
i = 0;
i <
map.ncolours;
i++)
1208 switch (update_type)
1229 unimpl(
"update %d\n", update_type);
1240 DEBUG((
"Received disconnect PDU\n"));
1247 uint8 data_pdu_type;
1268 error(
"error decompressed packet size exceeds max\n");
1270 error(
"error while decompressing packet\n");
1279 This->disconnect_reason = 262;
1285 memcpy((
ns->data), (
unsigned char *) (
This->mppc_dict.hist + roff), rlen);
1288 ns->end = (
ns->data +
ns->size);
1290 ns->rdp_hdr =
ns->p;
1295 switch (data_pdu_type)
1302 DEBUG((
"Received Control PDU\n"));
1306 DEBUG((
"Received Sync PDU\n"));
1318 DEBUG((
"Received Logon PDU\n"));
1334 unimpl(
"data PDU %d\n", data_pdu_type);
1451 DEBUG((
"RDP_PDU_DEACTIVATE\n"));
1467 cont =
This->next_packet <
s->end;
1501 This->rdp_shareid = 0;
ACPI_SIZE strlen(const char *String)
BOOL event_redirect(RDPCLIENT *This, uint32 flags, uint32 server_len, wchar_t *server, uint32 cookie_len, char *cookie, uint32 username_len, wchar_t *username, uint32 domain_len, wchar_t *domain, uint32 password_len, wchar_t *password)
void event_logon(RDPCLIENT *This)
RD_BOOL bitmap_decompress(uint8 *output, int width, int height, uint8 *input, int size, int Bpp)
RD_HCURSOR cache_get_cursor(uint16 cache_idx)
void cache_put_cursor(uint16 cache_idx, RD_HCURSOR cursor)
#define RDP_CAPSET_BMPCACHE2
#define BMPCACHE2_FLAG_PERSIST
#define RDP_CAPSET_BITMAP
#define RDP_CAPLEN_BITMAP
#define BMPCACHE2_NUM_PSTCELLS
#define RDP_CAPLEN_CONTROL
#define RDP_CAPLEN_COLCACHE
#define RDP_CAPSET_ACTIVATE
#define RDP_CAPSET_CONTROL
#define RDP_CAPLEN_BMPCACHE2
#define RDP_MPPC_DICT_SIZE
#define RDP_MPPC_COMPRESSED
#define RDP_CAPSET_COLCACHE
#define BMPCACHE2_C0_CELLS
#define RDP_CAPLEN_POINTER
@ RDP_CTL_REQUEST_CONTROL
#define RDP_CAPLEN_GENERAL
#define RDP_CAPLEN_ACTIVATE
#define RDP_CAPSET_BMPCACHE
#define BMPCACHE2_C1_CELLS
#define RDP_CAPLEN_BMPCACHE
@ RDP_DATA_PDU_CLIENT_WINDOW_STATUS
@ RDP_DATA_PDU_SYNCHRONISE
@ RDP_DATA_PDU_DISCONNECT
#define RDP_CAPSET_POINTER
#define RDP_CAPSET_GENERAL
#define BMPCACHE2_C2_CELLS
int mppc_expand(uint8 *data, uint32 clen, uint8 ctype, uint32 *roff, uint32 *rlen)
void process_orders(STREAM s, uint16 num_orders)
void reset_order_state(void)
#define out_uint32_le(s, v)
#define s_pop_layer(s, h)
#define s_push_layer(s, h, n)
#define in_uint16_le(s, v)
#define out_uint16_be(s, v)
#define in_uint8p(s, v, n)
#define in_uint8a(s, v, n)
#define out_uint16_le(s, v)
#define out_uint8p(s, v, n)
#define in_uint32_le(s, v)
#define out_uint8a(s, v, n)
RD_BOOL pstcache_init(uint8 cache_id)
void ui_set_cursor(RD_HCURSOR cursor)
RD_HCURSOR ui_create_cursor(unsigned int x, unsigned int y, int width, int height, uint8 *andmask, uint8 *xormask, int bpp)
char * tcp_get_address(void)
void rdp5_process(STREAM s)
void ui_set_null_cursor(void)
void ui_paint_bitmap(int x, int y, int cx, int cy, int width, int height, uint8 *data)
void sec_send(STREAM s, uint32 flags)
void ui_set_colourmap(RD_HCOLOURMAP map)
RD_BOOL sec_connect(char *server, char *username, char *domain, char *password, RD_BOOL reconnect)
void unimpl(char *format,...)
void sec_reset_state(void)
void ui_resize_window(void)
void sec_disconnect(void)
void hexdump(unsigned char *p, unsigned int len)
void ui_begin_update(void)
STREAM sec_recv(uint8 *rdpver)
void ui_move_pointer(int x, int y)
STREAM sec_init(uint32 flags, int maxlen)
int pstcache_enumerate(uint8 id, HASH_KEY *keylist)
RD_HCOLOURMAP ui_create_colourmap(COLOURMAP *colours)
static void rdp_out_bmpcache_caps(STREAM s)
static void rdp_send_control(uint16 action)
void process_bitmap_updates(STREAM s)
static void rdp_process_bitmap_caps(STREAM s)
static void process_demand_active(STREAM s)
static void rdp_send_logon_info(uint32 flags, char *domain, char *user, char *password, char *program, char *directory)
static void rdp_out_unknown_caps(STREAM s, uint16 id, uint16 length, uint8 *caps)
void process_cached_pointer_pdu(STREAM s)
void rdp_disconnect(void)
static void rdp_out_activate_caps(STREAM s)
static void rdp_enum_bmpcache2(void)
static void rdp_out_bitmap_caps(STREAM s)
static STREAM rdp_init_data(int maxlen)
static void rdp_out_order_caps(STREAM s)
void rdp_send_client_window_status(int status)
void process_palette(STREAM s)
void rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags, uint16 param1, uint16 param2)
void process_system_pointer_pdu(STREAM s)
RD_BOOL rdp_connect(char *server, uint32 flags, char *domain, char *password, char *command, char *directory, RD_BOOL reconnect)
static void process_update_pdu(STREAM s)
static void rdp_out_control_caps(STREAM s)
void process_disconnect_pdu(STREAM s, uint32 *ext_disc_reason)
static void rdp_out_general_caps(STREAM s)
static void rdp_send_fonts(uint16 seq)
static void rdp_send_confirm_active(void)
void rdp_in_unistr(STREAM s, int in_len, char **string, uint32 *str_size)
static void rdp_out_pointer_caps(STREAM s)
static void rdp_out_share_caps(STREAM s)
RD_BOOL rdp_loop(RD_BOOL *deactivated, uint32 *ext_disc_reason)
static STREAM rdp_recv(uint8 *type)
static void rdp_out_bmpcache2_caps(STREAM s)
void rdp_reset_state(void)
void process_colour_pointer_pdu(STREAM s)
static RD_BOOL process_data_pdu(STREAM s, uint32 *ext_disc_reason)
void rdp_out_unistr(STREAM s, char *string, int len)
static void rdp_process_general_caps(STREAM s)
static void rdp_process_server_caps(STREAM s, uint16 length)
static void rdp_send_synchronise(void)
void rdp_main_loop(RD_BOOL *deactivated, uint32 *ext_disc_reason)
static RD_BOOL process_redirect_pdu(STREAM s, RD_BOOL enhanced_redirect)
static void rdp_out_colcache_caps(STREAM s)
static void process_pointer_pdu(STREAM s)
static void rdp_send_data(STREAM s, uint8 data_pdu_type)
void user(int argc, const char *argv[])
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
GLint GLint GLsizei GLsizei GLsizei depth
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei GLenum type
GLint GLint GLint GLint GLint GLint y
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
GLdouble GLdouble GLdouble GLdouble top
GLuint GLsizei GLsizei * length
GLenum GLuint GLsizei bufsize
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
int const JOCTET unsigned int datalen
int iconv_close(iconv_t cd)
iconv_t iconv_open(const char *tocode, const char *fromcode)
size_t iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
#define memcpy(s1, s2, n)
BOOL sec_reconnect(RDPCLIENT *This, char *server, wchar_t *hostname, char *cookie)
BOOL rdp_reconnect(RDPCLIENT *This, char *server, uint32 flags, wchar_t *username, wchar_t *domain, wchar_t *password, wchar_t *command, wchar_t *directory, wchar_t *hostname, char *cookie)
_Out_opt_ int _Out_opt_ int * cy
static unsigned __int64 next
_CRTIMP struct tm *__cdecl gmtime(const time_t *_Time)
_CRTIMP time_t __cdecl mktime(struct tm *_Tm)
_CRTIMP struct tm *__cdecl localtime(const time_t *_Time)
int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)
static rfbScreenInfoPtr server