ReactOS 0.4.15-dev-6662-g1b3eed5
proto.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

RD_BOOL bitmap_decompress (uint8 *output, int width, int height, uint8 *input, int size, int Bpp)
 
void cache_rebuild_bmpcache_linked_list (uint8 id, sint16 *idx, int count)
 
void cache_bump_bitmap (uint8 id, uint16 idx, int bump)
 
void cache_evict_bitmap (uint8 id)
 
RD_HBITMAP cache_get_bitmap (uint8 id, uint16 idx)
 
void cache_put_bitmap (uint8 id, uint16 idx, RD_HBITMAP bitmap)
 
void cache_save_state (void)
 
FONTGLYPHcache_get_font (uint8 font, uint16 character)
 
void cache_put_font (uint8 font, uint16 character, uint16 offset, uint16 baseline, uint16 width, uint16 height, RD_HGLYPH pixmap)
 
DATABLOBcache_get_text (uint8 cache_id)
 
void cache_put_text (uint8 cache_id, void *data, int length)
 
uint8cache_get_desktop (uint32 offset, int cx, int cy, int bytes_per_pixel)
 
void cache_put_desktop (uint32 offset, int cx, int cy, int scanline, int bytes_per_pixel, uint8 *data)
 
RD_HCURSOR cache_get_cursor (uint16 cache_idx)
 
void cache_put_cursor (uint16 cache_idx, RD_HCURSOR cursor)
 
BRUSHDATAcache_get_brush_data (uint8 colour_code, uint8 idx)
 
void cache_put_brush_data (uint8 colour_code, uint8 idx, BRUSHDATA *brush_data)
 
VCHANNELchannel_register (char *name, uint32 flags, void(*callback)(STREAM))
 
STREAM channel_init (VCHANNEL *channel, uint32 length)
 
void channel_send (STREAM s, VCHANNEL *channel)
 
void channel_process (STREAM s, uint16 mcs_channel)
 
void cliprdr_send_simple_native_format_announce (uint32 format)
 
void cliprdr_send_native_format_announce (uint8 *formats_data, uint32 formats_data_length)
 
void cliprdr_send_data_request (uint32 format)
 
void cliprdr_send_data (uint8 *data, uint32 length)
 
void cliprdr_set_mode (const char *optarg)
 
RD_BOOL cliprdr_init (void)
 
int ctrl_init (const char *user, const char *domain, const char *host)
 
void ctrl_cleanup ()
 
RD_BOOL ctrl_is_slave ()
 
int ctrl_send_command (const char *cmd, const char *args)
 
void ctrl_add_fds (int *n, fd_set *rfds)
 
void ctrl_check_fds (fd_set *rfds, fd_set *wfds)
 
int disk_enum_devices (uint32 *id, char *optarg)
 
RD_NTSTATUS disk_query_information (RD_NTHANDLE handle, uint32 info_class, STREAM out)
 
RD_NTSTATUS disk_set_information (RD_NTHANDLE handle, uint32 info_class, STREAM in, STREAM out)
 
RD_NTSTATUS disk_check_notify (RD_NTHANDLE handle)
 
RD_NTSTATUS disk_create_notify (RD_NTHANDLE handle, uint32 info_class)
 
RD_NTSTATUS disk_query_volume_information (RD_NTHANDLE handle, uint32 info_class, STREAM out)
 
RD_NTSTATUS disk_query_directory (RD_NTHANDLE handle, uint32 info_class, char *pattern, STREAM out)
 
int mppc_expand (uint8 *data, uint32 clen, uint8 ctype, uint32 *roff, uint32 *rlen)
 
int get_current_workarea (uint32 *x, uint32 *y, uint32 *width, uint32 *height)
 
void ewmh_init (void)
 
STREAM iso_init (int length)
 
void iso_send (STREAM s)
 
STREAM iso_recv (uint8 *rdpver)
 
RD_BOOL iso_connect (char *server, char *username, char *domain, char *password, RD_BOOL reconnect, uint32 *selected_protocol)
 
void iso_disconnect (void)
 
void iso_reset_state (void)
 
RD_BOOL cssp_connect (char *server, char *user, char *domain, char *password, STREAM s)
 
void licence_process (STREAM s)
 
STREAM mcs_init (int length)
 
void mcs_send_to_channel (STREAM s, uint16 channel)
 
void mcs_send (STREAM s)
 
STREAM mcs_recv (uint16 *channel, uint8 *rdpver)
 
RD_BOOL mcs_connect_start (char *server, char *username, char *domain, char *password, RD_BOOL reconnect, uint32 *selected_protocol)
 
RD_BOOL mcs_connect_finalize (STREAM s)
 
void mcs_disconnect (void)
 
void mcs_reset_state (void)
 
void process_orders (STREAM s, uint16 num_orders)
 
void reset_order_state (void)
 
int parallel_enum_devices (uint32 *id, char *optarg)
 
int printer_enum_devices (uint32 *id, char *optarg)
 
int printercache_load_blob (char *printer_name, uint8 **data)
 
void printercache_process (STREAM s)
 
void pstcache_touch_bitmap (uint8 cache_id, uint16 cache_idx, uint32 stamp)
 
RD_BOOL pstcache_load_bitmap (uint8 cache_id, uint16 cache_idx)
 
RD_BOOL pstcache_save_bitmap (uint8 cache_id, uint16 cache_idx, uint8 *key, uint8 width, uint8 height, uint16 length, uint8 *data)
 
int pstcache_enumerate (uint8 id, HASH_KEY *keylist)
 
RD_BOOL pstcache_init (uint8 cache_id)
 
int main (int argc, char *argv[])
 
void generate_random (uint8 *random)
 
voidxmalloc (int size)
 
void exit_if_null (void *ptr)
 
charxstrdup (const char *s)
 
voidxrealloc (void *oldmem, size_t size)
 
void xfree (void *mem)
 
void error (char *format,...)
 
void warning (char *format,...)
 
void unimpl (char *format,...)
 
void hexdump (unsigned char *p, unsigned int len)
 
charnext_arg (char *src, char needle)
 
void toupper_str (char *p)
 
RD_BOOL str_startswith (const char *s, const char *prefix)
 
RD_BOOL str_handle_lines (const char *input, char **rest, str_handle_lines_t linehandler, void *data)
 
RD_BOOL subprocess (char *const argv[], str_handle_lines_t linehandler, void *data)
 
charl_to_a (long N, int base)
 
int load_licence (unsigned char **data)
 
void save_licence (unsigned char *data, int length)
 
void rd_create_ui (void)
 
RD_BOOL rd_pstcache_mkdir (void)
 
int rd_open_file (char *filename)
 
void rd_close_file (int fd)
 
int rd_read_file (int fd, void *ptr, int len)
 
int rd_write_file (int fd, void *ptr, int len)
 
int rd_lseek_file (int fd, int offset)
 
RD_BOOL rd_lock_file (int fd, int start, int len)
 
void rdp5_process (STREAM s)
 
void rdp_out_unistr (STREAM s, char *string, int len)
 
void rdp_in_unistr (STREAM s, int in_len, char **string, uint32 *str_size)
 
void rdp_send_input (uint32 time, uint16 message_type, uint16 device_flags, uint16 param1, uint16 param2)
 
void rdp_send_client_window_status (int status)
 
void process_colour_pointer_pdu (STREAM s)
 
void process_new_pointer_pdu (STREAM s)
 
void process_cached_pointer_pdu (STREAM s)
 
void process_system_pointer_pdu (STREAM s)
 
void process_bitmap_updates (STREAM s)
 
void process_palette (STREAM s)
 
void process_disconnect_pdu (STREAM s, uint32 *ext_disc_reason)
 
void rdp_main_loop (RD_BOOL *deactivated, uint32 *ext_disc_reason)
 
RD_BOOL rdp_loop (RD_BOOL *deactivated, uint32 *ext_disc_reason)
 
RD_BOOL rdp_connect (char *server, uint32 flags, char *domain, char *password, char *command, char *directory, RD_BOOL reconnect)
 
void rdp_reset_state (void)
 
void rdp_disconnect (void)
 
int get_device_index (RD_NTHANDLE handle)
 
void convert_to_unix_filename (char *filename)
 
void rdpdr_send_completion (uint32 device, uint32 id, uint32 status, uint32 result, uint8 *buffer, uint32 length)
 
RD_BOOL rdpdr_init ()
 
void rdpdr_add_fds (int *n, fd_set *rfds, fd_set *wfds, struct timeval *tv, RD_BOOL *timeout)
 
struct async_iorequest * rdpdr_remove_iorequest (struct async_iorequest *prev, struct async_iorequest *iorq)
 
void rdpdr_check_fds (fd_set *rfds, fd_set *wfds, RD_BOOL timed_out)
 
RD_BOOL rdpdr_abort_io (uint32 fd, uint32 major, RD_NTSTATUS status)
 
void rdpsnd_record (const void *data, unsigned int size)
 
RD_BOOL rdpsnd_init (char *optarg)
 
void rdpsnd_show_help (void)
 
void rdpsnd_add_fds (int *n, fd_set *rfds, fd_set *wfds, struct timeval *tv)
 
void rdpsnd_check_fds (fd_set *rfds, fd_set *wfds)
 
struct audio_packetrdpsnd_queue_current_packet (void)
 
RD_BOOL rdpsnd_queue_empty (void)
 
void rdpsnd_queue_next (unsigned long completed_in_us)
 
int rdpsnd_queue_next_tick (void)
 
void rdpsnd_reset_state (void)
 
void sec_hash_to_string (char *out, int out_size, uint8 *in, int in_size)
 
void sec_hash_sha1_16 (uint8 *out, uint8 *in, uint8 *salt1)
 
void sec_hash_48 (uint8 *out, uint8 *in, uint8 *salt1, uint8 *salt2, uint8 salt)
 
void sec_hash_16 (uint8 *out, uint8 *in, uint8 *salt1, uint8 *salt2)
 
void buf_out_uint32 (uint8 *buffer, uint32 value)
 
void sec_sign (uint8 *signature, int siglen, uint8 *session_key, int keylen, uint8 *data, int datalen)
 
void sec_decrypt (uint8 *data, int length)
 
STREAM sec_init (uint32 flags, int maxlen)
 
void sec_send_to_channel (STREAM s, uint32 flags, uint16 channel)
 
void sec_send (STREAM s, uint32 flags)
 
void sec_process_mcs_data (STREAM s)
 
STREAM sec_recv (uint8 *rdpver)
 
RD_BOOL sec_connect (char *server, char *username, char *domain, char *password, RD_BOOL reconnect)
 
void sec_disconnect (void)
 
void sec_reset_state (void)
 
int serial_enum_devices (uint32 *id, char *optarg)
 
RD_BOOL serial_get_event (RD_NTHANDLE handle, uint32 *result)
 
RD_BOOL serial_get_timeout (RD_NTHANDLE handle, uint32 length, uint32 *timeout, uint32 *itv_timeout)
 
STREAM tcp_init (uint32 maxlen)
 
void tcp_send (STREAM s)
 
STREAM tcp_recv (STREAM s, uint32 length)
 
RD_BOOL tcp_connect (char *server)
 
void tcp_disconnect (void)
 
chartcp_get_address (void)
 
RD_BOOL tcp_is_connected (void)
 
void tcp_reset_state (void)
 
RD_BOOL tcp_tls_connect (void)
 
RD_BOOL tcp_tls_get_server_pubkey (STREAM s)
 
void tcp_run_ui (RD_BOOL run)
 
RD_BOOL ber_in_header (STREAM s, int *tagval, int *length)
 
void ber_out_header (STREAM s, int tagval, int length)
 
RD_BOOL ber_parse_header (STREAM s, int tagval, int *length)
 
void ber_out_integer (STREAM s, int value)
 
void ui_clip_format_announce (uint8 *data, uint32 length)
 
void ui_clip_handle_data (uint8 *data, uint32 length)
 
void ui_clip_request_failed (void)
 
void ui_clip_request_data (uint32 format)
 
void ui_clip_sync (void)
 
void ui_clip_set_mode (const char *optarg)
 
void xclip_init (void)
 
void xclip_deinit (void)
 
RD_BOOL xkeymap_from_locale (const char *locale)
 
FILExkeymap_open (const char *filename)
 
void xkeymap_init (void)
 
RD_BOOL handle_special_keys (uint32 keysym, unsigned int state, uint32 ev_time, RD_BOOL pressed)
 
key_translation xkeymap_translate_key (uint32 keysym, unsigned int keycode, unsigned int state)
 
void xkeymap_send_keys (uint32 keysym, unsigned int keycode, unsigned int state, uint32 ev_time, RD_BOOL pressed, uint8 nesting)
 
uint16 xkeymap_translate_button (unsigned int button)
 
charget_ksname (uint32 keysym)
 
void save_remote_modifiers (uint8 scancode)
 
void restore_remote_modifiers (uint32 ev_time, uint8 scancode)
 
void ensure_remote_modifiers (uint32 ev_time, key_translation tr)
 
unsigned int read_keyboard_state (void)
 
uint16 ui_get_numlock_state (unsigned int state)
 
void reset_modifier_keys (void)
 
void rdp_send_scancode (uint32 time, uint16 flags, uint8 scancode)
 
RD_BOOL get_key_state (unsigned int state, uint32 keysym)
 
RD_BOOL ui_init (void)
 
void ui_init_connection (void)
 
void ui_deinit (void)
 
RD_BOOL ui_create_window (void)
 
void ui_resize_window (void)
 
void ui_destroy_window (void)
 
RD_BOOL ui_have_window (void)
 
void xwin_toggle_fullscreen (void)
 
int ui_select (int rdp_socket)
 
void ui_move_pointer (int x, int y)
 
RD_HBITMAP ui_create_bitmap (int width, int height, uint8 *data)
 
void ui_paint_bitmap (int x, int y, int cx, int cy, int width, int height, uint8 *data)
 
void ui_destroy_bitmap (RD_HBITMAP bmp)
 
RD_HGLYPH ui_create_glyph (int width, int height, uint8 *data)
 
void ui_destroy_glyph (RD_HGLYPH glyph)
 
RD_HCURSOR ui_create_cursor (unsigned int x, unsigned int y, int width, int height, uint8 *andmask, uint8 *xormask, int bpp)
 
void ui_set_cursor (RD_HCURSOR cursor)
 
void ui_destroy_cursor (RD_HCURSOR cursor)
 
void ui_set_null_cursor (void)
 
RD_HCOLOURMAP ui_create_colourmap (COLOURMAP *colours)
 
void ui_destroy_colourmap (RD_HCOLOURMAP map)
 
void ui_set_colourmap (RD_HCOLOURMAP map)
 
void ui_set_clip (int x, int y, int cx, int cy)
 
void ui_reset_clip (void)
 
void ui_bell (void)
 
void ui_destblt (uint8 opcode, int x, int y, int cx, int cy)
 
void ui_patblt (uint8 opcode, int x, int y, int cx, int cy, BRUSH *brush, int bgcolour, int fgcolour)
 
void ui_screenblt (uint8 opcode, int x, int y, int cx, int cy, int srcx, int srcy)
 
void ui_memblt (uint8 opcode, int x, int y, int cx, int cy, RD_HBITMAP src, int srcx, int srcy)
 
void ui_triblt (uint8 opcode, int x, int y, int cx, int cy, RD_HBITMAP src, int srcx, int srcy, BRUSH *brush, int bgcolour, int fgcolour)
 
void ui_line (uint8 opcode, int startx, int starty, int endx, int endy, PEN *pen)
 
void ui_rect (int x, int y, int cx, int cy, int colour)
 
void ui_polygon (uint8 opcode, uint8 fillmode, RD_POINT *point, int npoints, BRUSH *brush, int bgcolour, int fgcolour)
 
void ui_polyline (uint8 opcode, RD_POINT *points, int npoints, PEN *pen)
 
void ui_ellipse (uint8 opcode, uint8 fillmode, int x, int y, int cx, int cy, BRUSH *brush, int bgcolour, int fgcolour)
 
void ui_draw_glyph (int mixmode, int x, int y, int cx, int cy, RD_HGLYPH glyph, int srcx, int srcy, int bgcolour, int fgcolour)
 
void ui_draw_text (uint8 font, uint8 flags, uint8 opcode, int mixmode, int x, int y, int clipx, int clipy, int clipcx, int clipcy, int boxx, int boxy, int boxcx, int boxcy, BRUSH *brush, int bgcolour, int fgcolour, uint8 *text, uint8 length)
 
void ui_desktop_save (uint32 offset, int x, int y, int cx, int cy)
 
void ui_desktop_restore (uint32 offset, int x, int y, int cx, int cy)
 
void ui_begin_update (void)
 
void ui_end_update (void)
 
void ui_seamless_begin (RD_BOOL hidden)
 
void ui_seamless_end ()
 
void ui_seamless_hide_desktop (void)
 
void ui_seamless_unhide_desktop (void)
 
void ui_seamless_toggle (void)
 
void ui_seamless_create_window (unsigned long id, unsigned long group, unsigned long parent, unsigned long flags)
 
void ui_seamless_destroy_window (unsigned long id, unsigned long flags)
 
void ui_seamless_destroy_group (unsigned long id, unsigned long flags)
 
void ui_seamless_seticon (unsigned long id, const char *format, int width, int height, int chunk, const char *data, int chunk_len)
 
void ui_seamless_delicon (unsigned long id, const char *format, int width, int height)
 
void ui_seamless_move_window (unsigned long id, int x, int y, int width, int height, unsigned long flags)
 
void ui_seamless_restack_window (unsigned long id, unsigned long behind, unsigned long flags)
 
void ui_seamless_settitle (unsigned long id, const char *title, unsigned long flags)
 
void ui_seamless_setstate (unsigned long id, unsigned int state, unsigned long flags)
 
void ui_seamless_syncbegin (unsigned long flags)
 
void ui_seamless_ack (unsigned int serial)
 
RD_BOOL lspci_init (void)
 
RD_BOOL seamless_init (void)
 
void seamless_reset_state (void)
 
unsigned int seamless_send_sync (void)
 
unsigned int seamless_send_state (unsigned long id, unsigned int state, unsigned long flags)
 
unsigned int seamless_send_position (unsigned long id, int x, int y, int width, int height, unsigned long flags)
 
void seamless_select_timeout (struct timeval *tv)
 
unsigned int seamless_send_zchange (unsigned long id, unsigned long below, unsigned long flags)
 
unsigned int seamless_send_focus (unsigned long id, unsigned long flags)
 
unsigned int seamless_send_destroy (unsigned long id)
 
unsigned int seamless_send_spawn (char *cmd)
 
unsigned int seamless_send_persistent (RD_BOOL)
 
void scard_lock (int lock)
 
void scard_unlock (int lock)
 
int scard_enum_devices (uint32 *id, char *optarg)
 
void scardSetInfo (uint32 epoch, uint32 device, uint32 id, uint32 bytes_out)
 
void scard_reset_state ()
 

Function Documentation

◆ ber_in_header()

RD_BOOL ber_in_header ( STREAM  s,
int tagval,
int length 
)

Definition at line 90 of file asn.c.

91{
92 in_uint8(s, *tagval);
93 in_uint8(s, *decoded_len);
94
95 if (*decoded_len < 0x80)
96 return True;
97 else if (*decoded_len == 0x81)
98 {
99 in_uint8(s, *decoded_len);
100 return True;
101 }
102 else if (*decoded_len == 0x82)
103 {
104 in_uint16_be(s, *decoded_len);
105 return True;
106 }
107
108 return False;
109}
#define in_uint8(s, v)
Definition: parse.h:88
#define in_uint16_be(s, v)
Definition: parse.h:75
#define False
Definition: types.h:25
#define True
Definition: types.h:24
GLdouble s
Definition: gl.h:2039

◆ ber_out_header()

void ber_out_header ( STREAM  s,
int  tagval,
int  length 
)

Definition at line 61 of file asn.c.

62{
63 if (tagval > 0xff)
64 {
65 out_uint16_be(s, tagval);
66 }
67 else
68 {
69 out_uint8(s, tagval);
70 }
71
72 if (length >= 0x80)
73 {
74 out_uint8(s, 0x82);
76 }
77 else
79}
#define out_uint8(s, v)
Definition: parse.h:92
#define out_uint16_be(s, v)
Definition: parse.h:77
GLuint GLsizei GLsizei * length
Definition: glext.h:6040

Referenced by ber_out_integer(), mcs_out_domain_params(), and mcs_send_connect_initial().

◆ ber_out_integer()

void ber_out_integer ( STREAM  s,
int  value 
)

Definition at line 83 of file asn.c.

84{
87}
void ber_out_header(STREAM s, int tagval, int length)
Definition: asn.c:61
#define BER_TAG_INTEGER
Definition: constants.h:78
Definition: pdh_main.c:94

Referenced by mcs_out_domain_params().

◆ ber_parse_header()

RD_BOOL ber_parse_header ( STREAM  s,
int  tagval,
int length 
)

Definition at line 25 of file asn.c.

26{
27 int tag, len;
28
29 if (tagval > 0xff)
30 {
32 }
33 else
34 {
35 in_uint8(s, tag);
36 }
37
38 if (tag != tagval)
39 {
40 error("expected tag %d, got %d\n", tagval, tag);
41 return False;
42 }
43
44 in_uint8(s, len);
45
46 if (len & 0x80)
47 {
48 len &= ~0x80;
49 *length = 0;
50 while (len--)
51 next_be(s, *length);
52 }
53 else
54 *length = len;
55
56 return s_check(s);
57}
#define s_check(s)
Definition: parse.h:42
#define next_be(s, v)
Definition: parse.h:97
GLenum GLsizei len
Definition: glext.h:6722
#define error(str)
Definition: mkdosfs.c:1605
Definition: ecma_167.h:138

Referenced by mcs_parse_domain_params(), and mcs_recv_connect_response().

◆ bitmap_decompress()

RD_BOOL bitmap_decompress ( uint8 output,
int  width,
int  height,
uint8 input,
int  size,
int  Bpp 
)

Definition at line 884 of file bitmap.c.

885{
886 RD_BOOL rv = False;
887
888 switch (Bpp)
889 {
890 case 1:
891 rv = bitmap_decompress1(output, width, height, input, size);
892 break;
893 case 2:
894 rv = bitmap_decompress2(output, width, height, input, size);
895 break;
896 case 3:
897 rv = bitmap_decompress3(output, width, height, input, size);
898 break;
899 case 4:
900 rv = bitmap_decompress4(output, width, height, input, size);
901 break;
902 default:
903 unimpl("Bpp %d\n", Bpp);
904 break;
905 }
906 return rv;
907}
static RD_BOOL bitmap_decompress1(uint8 *output, int width, int height, uint8 *input, int size)
Definition: bitmap.c:67
static RD_BOOL bitmap_decompress3(uint8 *output, int width, int height, uint8 *input, int size)
Definition: bitmap.c:464
static RD_BOOL bitmap_decompress4(uint8 *output, int width, int height, uint8 *input, int size)
Definition: bitmap.c:856
static RD_BOOL bitmap_decompress2(uint8 *output, int width, int height, uint8 *input, int size)
Definition: bitmap.c:265
void unimpl(char *format,...)
Definition: uimain.c:801
int RD_BOOL
Definition: types.h:21
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
GLsizeiptr size
Definition: glext.h:5919
GLenum GLenum GLenum input
Definition: glext.h:9031

◆ buf_out_uint32()

void buf_out_uint32 ( uint8 buffer,
uint32  value 
)

Definition at line 304 of file secure.c.

305{
306 buffer[0] = (value) & 0xff;
307 buffer[1] = (value >> 8) & 0xff;
308 buffer[2] = (value >> 16) & 0xff;
309 buffer[3] = (value >> 24) & 0xff;
310}
GLuint buffer
Definition: glext.h:5915

Referenced by cliprdr_send_data_request(), cliprdr_send_simple_native_format_announce(), and licence_generate_hwid().

◆ cache_bump_bitmap()

void cache_bump_bitmap ( uint8  id,
uint16  idx,
int  bump 
)

Definition at line 104 of file cache.c.

105{
106 int p_idx, n_idx, n;
107
108 if (!IS_PERSISTENT(id))
109 return;
110
111 if (g_bmpcache_mru[id] == idx)
112 return;
113
114 DEBUG_RDP5(("bump bitmap: id=%d, idx=%d, bump=%d\n", id, idx, bump));
115
116 n_idx = g_bmpcache[id][idx].next;
117 p_idx = g_bmpcache[id][idx].previous;
118
119 if (IS_SET(n_idx))
120 {
121 /* remove */
123 if (IS_SET(p_idx))
124 g_bmpcache[id][p_idx].next = n_idx;
125 else
126 g_bmpcache_lru[id] = n_idx;
127 if (IS_SET(n_idx))
128 g_bmpcache[id][n_idx].previous = p_idx;
129 else
130 g_bmpcache_mru[id] = p_idx;
131 }
132 else
133 {
134 p_idx = NOT_SET;
135 n_idx = g_bmpcache_lru[id];
136 }
137
138 if (bump >= 0)
139 {
140 for (n = 0; n < bump && IS_SET(n_idx); n++)
141 {
142 p_idx = n_idx;
143 n_idx = g_bmpcache[id][p_idx].next;
144 }
145 }
146 else
147 {
148 p_idx = g_bmpcache_mru[id];
149 n_idx = NOT_SET;
150 }
151
152 /* insert */
154 g_bmpcache[id][idx].previous = p_idx;
155 g_bmpcache[id][idx].next = n_idx;
156
157 if (p_idx >= 0)
158 g_bmpcache[id][p_idx].next = idx;
159 else
161
162 if (n_idx >= 0)
163 g_bmpcache[id][n_idx].previous = idx;
164 else
166}
#define IS_SET(idx)
Definition: cache.c:31
static struct bmpcache_entry g_bmpcache[3][0xa00]
Definition: cache.c:48
#define NOT_SET
Definition: cache.c:30
static int g_bmpcache_count[3]
Definition: cache.c:54
static int g_bmpcache_mru[3]
Definition: cache.c:52
static int g_bmpcache_lru[3]
Definition: cache.c:51
#define IS_PERSISTENT(id)
Definition: precomp.h:26
#define DEBUG_RDP5(args)
Definition: rdesktop.h:141
unsigned int idx
Definition: utils.c:41
GLdouble n
Definition: glext.h:7729
GLuint id
Definition: glext.h:5910

Referenced by cache_get_bitmap(), and cache_put_bitmap().

◆ cache_evict_bitmap()

void cache_evict_bitmap ( uint8  id)

Definition at line 170 of file cache.c.

171{
172 uint16 idx;
173 int n_idx;
174
175 if (!IS_PERSISTENT(id))
176 return;
177
179 n_idx = g_bmpcache[id][idx].next;
180 DEBUG_RDP5(("evict bitmap: id=%d idx=%d n_idx=%d bmp=%p\n", id, idx, n_idx,
181 g_bmpcache[id][idx].bitmap));
182
185 g_bmpcache[id][idx].bitmap = 0;
186
187 g_bmpcache_lru[id] = n_idx;
188 g_bmpcache[id][n_idx].previous = NOT_SET;
189
191}
void ui_destroy_bitmap(RD_HBITMAP bmp)
void pstcache_touch_bitmap(uint8 cache_id, uint16 cache_idx, uint32 stamp)
Definition: pstcache.c:39
unsigned short uint16
Definition: types.h:30
Definition: uimain.c:89

Referenced by cache_put_bitmap().

◆ cache_get_bitmap()

RD_HBITMAP cache_get_bitmap ( uint8  id,
uint16  idx 
)

Definition at line 195 of file cache.c.

196{
197 if ((id < NUM_ELEMENTS(g_bmpcache)) && (idx < NUM_ELEMENTS(g_bmpcache[0])))
198 {
200 {
201 if (IS_PERSISTENT(id))
203
204 return g_bmpcache[id][idx].bitmap;
205 }
206 }
207 else if ((id < NUM_ELEMENTS(g_volatile_bc)) && (idx == 0x7fff))
208 {
209 return g_volatile_bc[id];
210 }
211
212 error("get bitmap %d:%d\n", id, idx);
213 return NULL;
214}
#define BUMP_COUNT
Definition: cache.c:39
static RD_HBITMAP g_volatile_bc[3]
Definition: cache.c:49
void cache_bump_bitmap(uint8 id, uint16 idx, int bump)
Definition: cache.c:104
#define NUM_ELEMENTS(array)
Definition: cache.c:27
RD_BOOL pstcache_load_bitmap(uint8 cache_id, uint16 cache_idx)
Definition: pstcache.c:53
#define NULL
Definition: types.h:112

Referenced by process_memblt(), and process_triblt().

◆ cache_get_brush_data()

BRUSHDATA * cache_get_brush_data ( uint8  colour_code,
uint8  idx 
)

Definition at line 441 of file cache.c.

442{
443 colour_code = colour_code == 1 ? 0 : 1;
444 if (idx < NUM_ELEMENTS(g_brushcache[0]))
445 {
446 return &g_brushcache[colour_code][idx];
447 }
448 error("get brush %d %d\n", colour_code, idx);
449 return NULL;
450}
static BRUSHDATA g_brushcache[2][64]
Definition: cache.c:437

Referenced by setup_brush().

◆ cache_get_cursor()

RD_HCURSOR cache_get_cursor ( uint16  cache_idx)

Definition at line 400 of file cache.c.

401{
403
404 if (cache_idx < NUM_ELEMENTS(g_cursorcache))
405 {
406 cursor = g_cursorcache[cache_idx];
407 if (cursor != NULL)
408 return cursor;
409 }
410
411 error("get cursor %d\n", cache_idx);
412 return NULL;
413}
static RD_HCURSOR g_cursorcache[0x20]
Definition: cache.c:396
const char cursor[]
Definition: icontest.c:13

Referenced by process_cached_pointer_pdu().

◆ cache_get_desktop()

uint8 * cache_get_desktop ( uint32  offset,
int  cx,
int  cy,
int  bytes_per_pixel 
)

Definition at line 353 of file cache.c.

354{
355 int length = cx * cy * bytes_per_pixel;
356
357 if (offset > sizeof(g_deskcache))
358 offset = 0;
359
360 if ((offset + length) <= sizeof(g_deskcache))
361 {
362 return &g_deskcache[offset];
363 }
364
365 error("get desktop %d:%d\n", offset, length);
366 return NULL;
367}
static uint8 g_deskcache[0x38400 *4]
Definition: cache.c:349
GLintptr offset
Definition: glext.h:5920
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585

Referenced by RdpClientUI::Display_RestoreDesktop(), and ui_desktop_restore().

◆ cache_get_font()

FONTGLYPH * cache_get_font ( uint8  font,
uint16  character 
)

Definition at line 279 of file cache.c.

280{
281 FONTGLYPH *glyph;
282
283 if ((font < NUM_ELEMENTS(g_fontcache)) && (character < NUM_ELEMENTS(g_fontcache[0])))
284 {
285 glyph = &g_fontcache[font][character];
286 if (glyph->pixmap != NULL)
287 return glyph;
288 }
289
290 error("get font %d:%d\n", font, character);
291 return NULL;
292}
static FONTGLYPH g_fontcache[12][256]
Definition: cache.c:275
Definition: mk_font.cpp:20
RD_HBITMAP pixmap
Definition: types.h:116

Referenced by RdpClientUI::Display_DoGlyph().

◆ cache_get_text()

DATABLOB * cache_get_text ( uint8  cache_id)

Definition at line 325 of file cache.c.

326{
327 DATABLOB *text;
328
329 text = &g_textcache[cache_id];
330 return text;
331}
static DATABLOB g_textcache[256]
Definition: cache.c:321
const WCHAR * text
Definition: package.c:1799

Referenced by RdpClientUI::Display_DrawText(), and ui_draw_text().

◆ cache_put_bitmap()

void cache_put_bitmap ( uint8  id,
uint16  idx,
RD_HBITMAP  bitmap 
)

Definition at line 218 of file cache.c.

219{
220 RD_HBITMAP old;
221
222 if ((id < NUM_ELEMENTS(g_bmpcache)) && (idx < NUM_ELEMENTS(g_bmpcache[0])))
223 {
224 old = g_bmpcache[id][idx].bitmap;
225 if (old != NULL)
227 g_bmpcache[id][idx].bitmap = bitmap;
228
229 if (IS_PERSISTENT(id))
230 {
231 if (old == NULL)
232 g_bmpcache[id][idx].previous = g_bmpcache[id][idx].next = NOT_SET;
233
237 }
238 }
239 else if ((id < NUM_ELEMENTS(g_volatile_bc)) && (idx == 0x7fff))
240 {
241 old = g_volatile_bc[id];
242 if (old != NULL)
245 }
246 else
247 {
248 error("put bitmap %d:%d\n", id, idx);
249 }
250}
#define TO_TOP
Definition: cache.c:29
void cache_evict_bitmap(uint8 id)
Definition: cache.c:170
#define BMPCACHE2_C2_CELLS
Definition: constants.h:284

Referenced by process_bmpcache(), process_bmpcache2(), process_raw_bmpcache(), and pstcache_load_bitmap().

◆ cache_put_brush_data()

void cache_put_brush_data ( uint8  colour_code,
uint8  idx,
BRUSHDATA brush_data 
)

Definition at line 455 of file cache.c.

456{
457 BRUSHDATA *bd;
458
459 colour_code = colour_code == 1 ? 0 : 1;
460 if (idx < NUM_ELEMENTS(g_brushcache[0]))
461 {
462 bd = &g_brushcache[colour_code][idx];
463 if (bd->data != 0)
464 {
465 xfree(bd->data);
466 }
467 memcpy(bd, brush_data, sizeof(BRUSHDATA));
468 }
469 else
470 {
471 error("put brush %d %d\n", colour_code, idx);
472 }
473}
void xfree(void *mem)
Definition: uimain.c:758
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
uint8 * data
Definition: types.h:96

Referenced by process_brushcache().

◆ cache_put_cursor()

void cache_put_cursor ( uint16  cache_idx,
RD_HCURSOR  cursor 
)

Definition at line 417 of file cache.c.

418{
419 RD_HCURSOR old;
420
421 if (cache_idx < NUM_ELEMENTS(g_cursorcache))
422 {
423 old = g_cursorcache[cache_idx];
424 if (old != NULL)
426
427 g_cursorcache[cache_idx] = cursor;
428 }
429 else
430 {
431 error("put cursor %d\n", cache_idx);
432 }
433}
void ui_destroy_cursor(RD_HCURSOR cursor)

Referenced by process_colour_pointer_common(), and process_colour_pointer_pdu().

◆ cache_put_desktop()

void cache_put_desktop ( uint32  offset,
int  cx,
int  cy,
int  scanline,
int  bytes_per_pixel,
uint8 data 
)

Definition at line 371 of file cache.c.

372{
373 int length = cx * cy * bytes_per_pixel;
374
375 if (offset > sizeof(g_deskcache))
376 offset = 0;
377
378 if ((offset + length) <= sizeof(g_deskcache))
379 {
380 cx *= bytes_per_pixel;
381 while (cy--)
382 {
384 data += scanline;
385 offset += cx;
386 }
387 }
388 else
389 {
390 error("put desktop %d:%d\n", offset, length);
391 }
392}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

Referenced by RdpClientUI::Display_SaveDesktop(), and ui_desktop_save().

◆ cache_put_font()

void cache_put_font ( uint8  font,
uint16  character,
uint16  offset,
uint16  baseline,
uint16  width,
uint16  height,
RD_HGLYPH  pixmap 
)

Definition at line 296 of file cache.c.

298{
299 FONTGLYPH *glyph;
300
301 if ((font < NUM_ELEMENTS(g_fontcache)) && (character < NUM_ELEMENTS(g_fontcache[0])))
302 {
303 glyph = &g_fontcache[font][character];
304 if (glyph->pixmap != NULL)
305 ui_destroy_glyph(glyph->pixmap);
306
307 glyph->offset = offset;
308 glyph->baseline = baseline;
309 glyph->width = width;
310 glyph->height = height;
311 glyph->pixmap = pixmap;
312 }
313 else
314 {
315 error("put font %d:%d\n", font, character);
316 }
317}
void ui_destroy_glyph(RD_HGLYPH glyph)
Definition: qtewin.cpp:1424
uint16 width
Definition: types.h:114
sint16 baseline
Definition: types.h:113
uint16 height
Definition: types.h:115
sint16 offset
Definition: types.h:112

Referenced by process_fontcache().

◆ cache_put_text()

void cache_put_text ( uint8  cache_id,
void data,
int  length 
)

Definition at line 335 of file cache.c.

336{
337 DATABLOB *text;
338
339 text = &g_textcache[cache_id];
340 if (text->data != NULL)
341 xfree(text->data);
342 text->data = xmalloc(length);
343 text->size = length;
344 memcpy(text->data, data, length);
345}
void * xmalloc(int size)
Definition: uimain.c:747

Referenced by RdpClientUI::Display_DrawText(), and ui_draw_text().

◆ cache_rebuild_bmpcache_linked_list()

void cache_rebuild_bmpcache_linked_list ( uint8  id,
sint16 idx,
int  count 
)

Definition at line 58 of file cache.c.

59{
60 int n = count, c = 0;
61 sint16 n_idx;
62
63 /* find top, skip evicted bitmaps */
64 while (--n >= 0 && g_bmpcache[id][idx[n]].bitmap == NULL);
65 if (n < 0)
66 {
68 return;
69 }
70
72 g_bmpcache[id][idx[n]].next = NOT_SET;
73 n_idx = idx[n];
74 c++;
75
76 /* link list */
77 while (n >= 0)
78 {
79 /* skip evicted bitmaps */
80 while (--n >= 0 && g_bmpcache[id][idx[n]].bitmap == NULL);
81
82 if (n < 0)
83 break;
84
85 g_bmpcache[id][n_idx].previous = idx[n];
86 g_bmpcache[id][idx[n]].next = n_idx;
87 n_idx = idx[n];
88 c++;
89 }
90
91 g_bmpcache[id][n_idx].previous = NOT_SET;
92 g_bmpcache_lru[id] = n_idx;
93
94 if (c != g_bmpcache_count[id])
95 {
96 error("Oops. %d in bitmap cache linked list, %d in ui cache...\n", c,
99 }
100}
#define EX_SOFTWARE
Definition: rdesktop.h:70
signed short sint16
Definition: types.h:31
GLuint GLuint GLsizei count
Definition: gl.h:1545
const GLubyte * c
Definition: glext.h:8905
#define exit(n)
Definition: config.h:202

Referenced by pstcache_enumerate().

◆ cache_save_state()

void cache_save_state ( void  )

Definition at line 254 of file cache.c.

255{
256 uint32 id = 0, t = 0;
257 int idx;
258
259 for (id = 0; id < NUM_ELEMENTS(g_bmpcache); id++)
260 if (IS_PERSISTENT(id))
261 {
262 DEBUG_RDP5(("Saving cache state for bitmap cache %d...", id));
264 while (idx >= 0)
265 {
267 idx = g_bmpcache[id][idx].next;
268 }
269 DEBUG_RDP5((" %d stamps written.\n", t));
270 }
271}
unsigned int uint32
Definition: types.h:32
GLdouble GLdouble t
Definition: gl.h:2047

Referenced by main().

◆ channel_init()

STREAM channel_init ( VCHANNEL channel,
uint32  length 
)

Definition at line 69 of file channels.c.

70{
71 STREAM s;
72
74 s_push_layer(s, channel_hdr, 8);
75 return s;
76}
RD_BOOL g_encryption
Definition: uimain.c:40
#define SEC_ENCRYPT
Definition: constants.h:101
#define s_push_layer(s, h, n)
Definition: parse.h:39
STREAM sec_init(uint32 flags, int maxlen)
Definition: secure.c:419
Definition: parse.h:23

Referenced by cliprdr_send_packet(), lspci_send(), rdpdr_send_available(), rdpdr_send_clientcapabilty(), rdpdr_send_completion(), rdpdr_send_connect(), rdpdr_send_name(), rdpsnd_init_packet(), and seamless_send().

◆ channel_process()

void channel_process ( STREAM  s,
uint16  mcs_channel 
)

Definition at line 138 of file channels.c.

139{
141 uint32 thislength;
142 VCHANNEL *channel = NULL;
143 unsigned int i;
144 STREAM in;
145
146 for (i = 0; i < g_num_channels; i++)
147 {
148 channel = &g_channels[i];
149 if (channel->mcs_id == mcs_channel)
150 break;
151 }
152
153 if (i >= g_num_channels)
154 return;
155
159 {
160 /* single fragment - pass straight up */
161 channel->process(s);
162 }
163 else
164 {
165 /* add fragment to defragmentation buffer */
166 in = &channel->in;
168 {
169 if (length > in->size)
170 {
171 in->data = (uint8 *) xrealloc(in->data, length);
172 in->size = length;
173 }
174 in->p = in->data;
175 }
176
177 thislength = MIN(s->end - s->p, in->data + in->size - in->p);
178 memcpy(in->p, s->p, thislength);
179 in->p += thislength;
180
182 {
183 in->end = in->p;
184 in->p = in->data;
185 channel->process(in);
186 }
187 }
188}
#define CHANNEL_FLAG_LAST
Definition: channels.c:26
#define CHANNEL_FLAG_FIRST
Definition: channels.c:25
unsigned int g_num_channels
Definition: channels.c:33
VCHANNEL g_channels[MAX_CHANNELS]
Definition: channels.c:32
#define in_uint32_le(s, v)
Definition: parse.h:56
void * xrealloc(void *oldmem, size_t size)
Definition: uimain.c:736
#define MIN(x, y)
Definition: rdesktop.h:171
unsigned char uint8
Definition: types.h:28
GLuint in
Definition: glext.h:9616
GLbitfield flags
Definition: glext.h:7161
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
Definition: glfuncs.h:248
void(* process)(STREAM)
Definition: types.h:156
struct stream in
Definition: types.h:155
uint16 mcs_id
Definition: types.h:152

Referenced by sec_recv().

◆ channel_register()

VCHANNEL * channel_register ( char name,
uint32  flags,
void(*)(STREAM callback 
)

Definition at line 46 of file channels.c.

47{
48 VCHANNEL *channel;
49
51 return NULL;
52
54 {
55 error("Channel table full, increase MAX_CHANNELS\n");
56 return NULL;
57 }
58
59 channel = &g_channels[g_num_channels];
61 strncpy(channel->name, name, 8);
62 channel->flags = flags;
63 channel->process = callback;
65 return channel;
66}
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
Definition: utclib.c:427
RDP_VERSION g_rdp_version
Definition: uimain.c:74
#define MAX_CHANNELS
Definition: channels.c:23
#define MCS_GLOBAL_CHANNEL
Definition: constants.h:87
@ RDP_V5
Definition: types.h:44
static IPrintDialogCallback callback
Definition: printdlg.c:326
uint32 flags
Definition: types.h:154
char name[8]
Definition: types.h:153
Definition: name.c:39

Referenced by cliprdr_init(), lspci_init(), rdpdr_init(), rdpsnd_init(), and seamless_init().

◆ channel_send()

void channel_send ( STREAM  s,
VCHANNEL channel 
)

Definition at line 79 of file channels.c.

80{
82 uint32 thislength, remaining;
83 uint8 *data;
84
85#ifdef WITH_SCARD
87#endif
88
89 /* first fragment sent in-place */
90 s_pop_layer(s, channel_hdr);
91 length = s->end - s->p - 8;
92
93 DEBUG_CHANNEL(("channel_send, length = %d\n", length));
94
95 thislength = MIN(length, CHANNEL_CHUNK_LENGTH);
96/* Note: In the original clipboard implementation, this number was
97 1592, not 1600. However, I don't remember the reason and 1600 seems
98 to work so.. This applies only to *this* length, not the length of
99 continuation or ending packets. */
100 remaining = length - thislength;
102 if (channel->flags & CHANNEL_OPTION_SHOW_PROTOCOL)
104
107 data = s->end = s->p + thislength;
108 DEBUG_CHANNEL(("Sending %d bytes with FLAG_FIRST\n", thislength));
110
111 /* subsequent segments copied (otherwise would have to generate headers backwards) */
112 while (remaining > 0)
113 {
114 thislength = MIN(remaining, CHANNEL_CHUNK_LENGTH);
115 remaining -= thislength;
116 flags = (remaining == 0) ? CHANNEL_FLAG_LAST : 0;
117 if (channel->flags & CHANNEL_OPTION_SHOW_PROTOCOL)
119
120 DEBUG_CHANNEL(("Sending %d bytes with flags %d\n", thislength, flags));
121
122 s = sec_init(g_encryption ? SEC_ENCRYPT : 0, thislength + 8);
125 out_uint8p(s, data, thislength);
126 s_mark_end(s);
128
129 data += thislength;
130 }
131
132#ifdef WITH_SCARD
134#endif
135}
#define CHANNEL_CHUNK_LENGTH
Definition: channels.c:24
#define CHANNEL_FLAG_SHOW_PROTOCOL
Definition: channels.c:27
#define SCARD_LOCK_CHANNEL
Definition: constants.h:581
#define CHANNEL_OPTION_SHOW_PROTOCOL
Definition: constants.h:434
#define s_mark_end(s)
Definition: parse.h:41
#define out_uint32_le(s, v)
Definition: parse.h:59
#define s_pop_layer(s, h)
Definition: parse.h:40
#define out_uint8p(s, v, n)
Definition: parse.h:93
void scard_lock(int lock)
void sec_send_to_channel(STREAM s, uint32 flags, uint16 channel)
Definition: secure.c:436
void scard_unlock(int lock)
#define DEBUG_CHANNEL(args)
Definition: rdesktop.h:159

Referenced by cliprdr_send_packet(), lspci_send(), rdpdr_send_available(), rdpdr_send_clientcapabilty(), rdpdr_send_completion(), rdpdr_send_connect(), rdpdr_send_name(), rdpsnd_send(), and seamless_send().

◆ cliprdr_init()

RD_BOOL cliprdr_init ( void  )

Referenced by xclip_init().

◆ cliprdr_send_data()

void cliprdr_send_data ( uint8 data,
uint32  length 
)

◆ cliprdr_send_data_request()

void cliprdr_send_data_request ( uint32  format)

◆ cliprdr_send_native_format_announce()

void cliprdr_send_native_format_announce ( uint8 formats_data,
uint32  formats_data_length 
)

◆ cliprdr_send_simple_native_format_announce()

void cliprdr_send_simple_native_format_announce ( uint32  format)

◆ cliprdr_set_mode()

void cliprdr_set_mode ( const char optarg)

Referenced by main().

◆ convert_to_unix_filename()

void convert_to_unix_filename ( char filename)

Definition at line 78 of file rdpdr.c.

79{
80 char *p;
81
82 while ((p = strchr(filename, '\\')))
83 {
84 *p = '/';
85 }
86}
char * strchr(const char *String, int ch)
Definition: utclib.c:501
GLfloat GLfloat p
Definition: glext.h:8902
const char * filename
Definition: ioapi.h:137

Referenced by disk_set_information(), and rdpdr_process_irp().

◆ cssp_connect()

RD_BOOL cssp_connect ( char server,
char user,
char domain,
char password,
STREAM  s 
)

Referenced by iso_connect().

◆ ctrl_add_fds()

void ctrl_add_fds ( int n,
fd_set rfds 
)

◆ ctrl_check_fds()

void ctrl_check_fds ( fd_set rfds,
fd_set wfds 
)

◆ ctrl_cleanup()

void ctrl_cleanup ( )

◆ ctrl_init()

int ctrl_init ( const char user,
const char domain,
const char host 
)

◆ ctrl_is_slave()

RD_BOOL ctrl_is_slave ( )

◆ ctrl_send_command()

int ctrl_send_command ( const char cmd,
const char args 
)

◆ disk_check_notify()

RD_NTSTATUS disk_check_notify ( RD_NTHANDLE  handle)

Referenced by _rdpdr_check_fds().

◆ disk_create_notify()

RD_NTSTATUS disk_create_notify ( RD_NTHANDLE  handle,
uint32  info_class 
)

Referenced by rdpdr_process_irp().

◆ disk_enum_devices()

int disk_enum_devices ( uint32 id,
char optarg 
)

Referenced by main().

◆ disk_query_directory()

RD_NTSTATUS disk_query_directory ( RD_NTHANDLE  handle,
uint32  info_class,
char pattern,
STREAM  out 
)

Referenced by rdpdr_process_irp().

◆ disk_query_information()

RD_NTSTATUS disk_query_information ( RD_NTHANDLE  handle,
uint32  info_class,
STREAM  out 
)

Referenced by rdpdr_process_irp().

◆ disk_query_volume_information()

RD_NTSTATUS disk_query_volume_information ( RD_NTHANDLE  handle,
uint32  info_class,
STREAM  out 
)

Referenced by rdpdr_process_irp().

◆ disk_set_information()

RD_NTSTATUS disk_set_information ( RD_NTHANDLE  handle,
uint32  info_class,
STREAM  in,
STREAM  out 
)

Referenced by rdpdr_process_irp().

◆ ensure_remote_modifiers()

void ensure_remote_modifiers ( uint32  ev_time,
key_translation  tr 
)

Referenced by vncKey().

◆ error()

void error ( char format,
  ... 
)

Definition at line 817 of file uimain.c.

818{
819 va_list ap;
820 char text[512];
821 char text1[512];
822
823 sprintf(text1, "ERROR: ");
826 va_end(ap);
827 strcat(text1, text);
828 mi_error(text1);
829}
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
int __cdecl vsprintf(char *_Dest, const char *_Format, va_list _Args)
Definition: sprintf.c:733
#define sprintf(buf, format,...)
Definition: sprintf.c:55
void mi_error(char *msg)
Definition: win32.c:131
void int int ULONGLONG int va_list * ap
Definition: winesup.h:36

◆ ewmh_init()

void ewmh_init ( void  )

Referenced by ui_init().

◆ exit_if_null()

void exit_if_null ( void ptr)

◆ generate_random()

void generate_random ( uint8 random)

Definition at line 709 of file uimain.c.

710{
711 int i;
712
713 rand();
714 rand();
715 for (i = 0; i < 32; i++)
716 {
717 random[i] = rand(); /* higher bits are more random */
718 }
719}
_Check_return_ int __cdecl rand(void)
Definition: rand.c:10
#define random
Definition: rosdhcp.h:81

Referenced by sec_process_crypt_info().

◆ get_current_workarea()

int get_current_workarea ( uint32 x,
uint32 y,
uint32 width,
uint32 height 
)

Referenced by ui_init().

◆ get_device_index()

◆ get_key_state()

RD_BOOL get_key_state ( unsigned int  state,
uint32  keysym 
)

Definition at line 146 of file vnc.c.

147{
148 if (keysym >= FIRST_MODIFIER && keysym <= LAST_MODIFIER)
149 return keystate[keysym - FIRST_MODIFIER];
150 return 0;
151}
#define FIRST_MODIFIER
Definition: vnc.c:130
#define LAST_MODIFIER
Definition: vnc.c:131
static BOOL keystate[LAST_MODIFIER - FIRST_MODIFIER]
Definition: vnc.c:133

Referenced by handle_special_keys(), reset_modifier_keys(), and ui_get_numlock_state().

◆ get_ksname()

char * get_ksname ( uint32  keysym)

Definition at line 734 of file xkeymap.c.

735{
736 char *ksname = NULL;
737
738 if (keysym == NoSymbol)
739 ksname = "NoSymbol";
740 else if (!(ksname = XKeysymToString(keysym)))
741 ksname = "(no name)";
742
743 return ksname;
744}
const char * XKeysymToString(KeySym keysym)
Definition: x11stubs.c:1391
#define NoSymbol
Definition: x11stubs.h:10

Referenced by xkeymap_translate_key(), and xwin_process_events().

◆ handle_special_keys()

RD_BOOL handle_special_keys ( uint32  keysym,
unsigned int  state,
uint32  ev_time,
RD_BOOL  pressed 
)

Referenced by vncKey(), and xwin_process_events().

◆ hexdump()

void hexdump ( unsigned char p,
unsigned int  len 
)

Definition at line 234 of file shimdbg.c.

235{
236 unsigned char *line = p;
237 unsigned int i, thisline, offset = 0;
238
239 while (offset < len)
240 {
241 xprintf("%04x ", offset);
242 thisline = len - offset;
243 if (thisline > 16)
244 thisline = 16;
245
246 for (i = 0; i < thisline; i++)
247 xprintf("%02x ", line[i]);
248
249 for (; i < 16; i++)
250 xprintf(" ");
251
252 for (i = 0; i < thisline; i++)
253 xprintf("%c", (line[i] >= 0x20 && line[i] < 0x7f) ? line[i] : '.');
254
255 xprintf("\n");
256 offset += thisline;
257 line += thisline;
258 }
259}
void xprintf(const char *fmt,...)
Definition: shimdbg.c:16
Definition: parser.c:49

Referenced by lspci_process(), lspci_send(), rdp5_process(), rdp_recv(), rdpdr_process(), rdpsnd_process(), rdpsnd_send(), seamless_process(), seamless_send(), sec_recv(), sec_send_to_channel(), serial_device_control(), and serial_read().

◆ iso_connect()

RD_BOOL iso_connect ( char server,
char username,
char domain,
char password,
RD_BOOL  reconnect,
uint32 selected_protocol 
)

Definition at line 203 of file iso.c.

205{
206 STREAM s;
207 uint8 code;
208 uint32 neg_proto;
209
211
212 neg_proto = PROTOCOL_SSL;
213
214#ifdef WITH_CREDSSP
216 neg_proto |= PROTOCOL_HYBRID;
218 neg_proto |= PROTOCOL_HYBRID;
219 else
220 warning("Disables CredSSP due to missing smartcard information for SSO.\n");
221#endif
222
223 retry:
224 *selected_protocol = PROTOCOL_RDP;
225 code = 0;
226
227 if (!tcp_connect(server))
228 return False;
229
231
232 s = iso_recv_msg(&code, NULL);
233 if (s == NULL)
234 return False;
235
236 if (code != ISO_PDU_CC)
237 {
238 error("expected CC, got 0x%x\n", code);
240 return False;
241 }
242
243 if (g_rdp_version >= RDP_V5 && s_check_rem(s, 8))
244 {
245 /* handle RDP_NEG_REQ response */
246 const char *reason = NULL;
247
248 uint8 type = 0, flags = 0;
249 uint16 length = 0;
250 uint32 data = 0;
251
252 in_uint8(s, type);
253 in_uint8(s, flags);
255 in_uint32(s, data);
256
257 if (type == RDP_NEG_FAILURE)
258 {
259 RD_BOOL retry_without_neg = False;
260
261 switch (data)
262 {
264 reason = "SSL with user authentication required by server";
265 break;
267 reason = "SSL not allowed by server";
268 retry_without_neg = True;
269 break;
271 reason = "no valid authentication certificate on server";
272 retry_without_neg = True;
273 break;
275 reason = "inconsistent negotiation flags";
276 break;
278 reason = "SSL required by server";
279 break;
281 reason = "CredSSP required by server";
282 break;
283 default:
284 reason = "unknown reason";
285 }
286
288
289 if (retry_without_neg)
290 {
292 "Failed to negotiate protocol, retrying with plain RDP.\n");
294 goto retry;
295 }
296
297 fprintf(stderr, "Failed to connect, %s.\n", reason);
298 return False;
299 }
300
301 if (type != RDP_NEG_RSP)
302 {
304 error("Expected RDP_NEG_RSP, got type = 0x%x\n", type);
305 return False;
306 }
307
308 /* handle negotiation response */
309 if (data == PROTOCOL_SSL)
310 {
311#ifdef WITH_SSL
312 if (!tcp_tls_connect())
313 {
314 /* failed to connect using cssp, let retry with plain TLS */
316 neg_proto = PROTOCOL_RDP;
317 goto retry;
318 }
319 /* do not use encryption when using TLS */
321 fprintf(stderr, "Connection established using SSL.\n");
322#else /* WITH_SSL */
323 fprintf(stderr, "SSL not compiled in.\n");
324#endif /* WITH_SSL */
325 }
326#ifdef WITH_CREDSSP
327 else if (data == PROTOCOL_HYBRID)
328 {
330 {
331 /* failed to connect using cssp, let retry with plain TLS */
333 neg_proto = PROTOCOL_SSL;
334 goto retry;
335 }
336
337 /* do not use encryption when using TLS */
338 fprintf(stderr, "Connection established using CredSSP.\n");
340 }
341#endif
342 else if (data == PROTOCOL_RDP)
343 {
344 fprintf(stderr, "Connection established using plain RDP.\n");
345 }
346 else if (data != PROTOCOL_RDP)
347 {
349 error("Unexpected protocol in negotiation response, got data = 0x%x.\n",
350 data);
351 return False;
352 }
353 if (length || flags) {}
354
355 *selected_protocol = data;
356 }
357 return True;
358}
@ PROTOCOL_SSL
Definition: constants.h:47
@ PROTOCOL_HYBRID
Definition: constants.h:48
@ PROTOCOL_RDP
Definition: constants.h:46
@ RDP_NEG_FAILURE
Definition: constants.h:41
@ RDP_NEG_RSP
Definition: constants.h:40
@ SSL_CERT_NOT_ON_SERVER
Definition: constants.h:55
@ HYBRID_REQUIRED_BY_SERVER
Definition: constants.h:57
@ SSL_REQUIRED_BY_SERVER
Definition: constants.h:53
@ SSL_WITH_USER_AUTH_REQUIRED_BY_SERVER
Definition: constants.h:58
@ INCONSISTENT_FLAGS
Definition: constants.h:56
@ SSL_NOT_ALLOWED_BY_SERVER
Definition: constants.h:54
@ ISO_PDU_CC
Definition: constants.h:30
char * g_sc_csp_name
static STREAM iso_recv_msg(uint8 *code, uint8 *rdpver)
Definition: iso.c:101
static void iso_send_connection_request(char *username, uint32 neg_proto)
Definition: iso.c:60
RD_BOOL g_encryption
Definition: uimain.c:40
char * g_sc_reader_name
RD_BOOL g_use_password_as_pin
static RD_BOOL g_negotiate_rdp_protocol
Definition: iso.c:29
RDP_VERSION g_rdp_version
Definition: uimain.c:74
char * g_sc_container_name
char * g_sc_card_name
#define in_uint32(s, v)
Definition: parse.h:83
#define s_check_rem(s, n)
Definition: parse.h:43
#define in_uint16(s, v)
Definition: parse.h:82
void tcp_disconnect(void)
Definition: tcp.c:832
RD_BOOL tcp_tls_connect(void)
RD_BOOL tcp_connect(char *server)
Definition: tcp.c:717
RD_BOOL cssp_connect(char *server, char *user, char *domain, char *password, STREAM s)
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1904
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define stderr
Definition: stdio.h:100
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
static WCHAR password[]
Definition: url.c:33
static WCHAR username[]
Definition: url.c:32
#define warning(s)
Definition: debug.h:83
Definition: inflate.c:139
Definition: cookie.c:42
static rfbScreenInfoPtr server
Definition: vnc.c:74

Referenced by mcs_connect(), and mcs_connect_start().

◆ iso_disconnect()

void iso_disconnect ( void  )

Definition at line 362 of file iso.c.

363{
366}
@ ISO_PDU_DR
Definition: constants.h:31
static void iso_send_msg(uint8 code)
Definition: iso.c:39

Referenced by mcs_connect(), mcs_connect_finalize(), mcs_disconnect(), and mcs_reconnect().

◆ iso_init()

STREAM iso_init ( int  length)

Definition at line 150 of file iso.c.

151{
152 STREAM s;
153
154 s = tcp_init(length + 7);
155 s_push_layer(s, iso_hdr, 7);
156
157 return s;
158}
STREAM tcp_init(uint32 maxlen)
Definition: tcp.c:82

Referenced by mcs_init(), mcs_send_aurq(), mcs_send_cjrq(), mcs_send_connect_initial(), and mcs_send_edrq().

◆ iso_recv()

STREAM iso_recv ( uint8 rdpver)

Definition at line 182 of file iso.c.

183{
184 STREAM s;
185 uint8 code = 0;
186
187 s = iso_recv_msg(&code, rdpver);
188 if (s == NULL)
189 return NULL;
190 if (rdpver != NULL)
191 if (*rdpver != 3)
192 return s;
193 if (code != ISO_PDU_DT)
194 {
195 error("expected DT, got 0x%x\n", code);
196 return NULL;
197 }
198 return s;
199}
@ ISO_PDU_DT
Definition: constants.h:32

Referenced by mcs_recv(), mcs_recv_aucf(), mcs_recv_cjcf(), and mcs_recv_connect_response().

◆ iso_reset_state()

void iso_reset_state ( void  )

Definition at line 370 of file iso.c.

371{
374}
RD_BOOL g_encryption_initial
Definition: uimain.c:75
void tcp_reset_state(void)
Definition: tcp.c:894

Referenced by mcs_reset_state().

◆ iso_send()

void iso_send ( STREAM  s)

Definition at line 162 of file iso.c.

163{
165
166 s_pop_layer(s, iso_hdr);
167 length = s->end - s->p;
168
169 out_uint8(s, 3); /* version */
170 out_uint8(s, 0); /* reserved */
172
173 out_uint8(s, 2); /* hdrlen */
174 out_uint8(s, ISO_PDU_DT); /* code */
175 out_uint8(s, 0x80); /* eot */
176
177 tcp_send(s);
178}
void tcp_send(STREAM s)
Definition: tcp.c:270

Referenced by mcs_send_aurq(), mcs_send_cjrq(), mcs_send_connect_initial(), mcs_send_edrq(), and mcs_send_to_channel().

◆ l_to_a()

char * l_to_a ( long  N,
int  base 
)

Definition at line 1356 of file rdesktop.c.

1357{
1358 static char ret[LTOA_BUFSIZE];
1359
1360 char *head = ret, buf[LTOA_BUFSIZE], *tail = buf + sizeof(buf);
1361
1362 register int divrem;
1363
1364 if (base < 36 || 2 > base)
1365 base = 10;
1366
1367 if (N < 0)
1368 {
1369 *head++ = '-';
1370 N = -N;
1371 }
1372
1373 tail = buf + sizeof(buf);
1374 *--tail = 0;
1375
1376 do
1377 {
1378 divrem = N % base;
1379 *--tail = (divrem <= 9) ? divrem + '0' : divrem + 'a' - 10;
1380 N /= base;
1381 }
1382 while (N);
1383
1384 strcpy(head, tail);
1385 return ret;
1386}
#define N
Definition: crc32.c:57
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
struct outqueuenode * tail
Definition: adnsresfilter.c:66
struct outqueuenode * head
Definition: adnsresfilter.c:66
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define LTOA_BUFSIZE
Definition: rdesktop.c:1353
int ret

Referenced by printer_enum_devices().

◆ licence_process()

void licence_process ( STREAM  s)

Definition at line 378 of file licence.c.

379{
380 uint8 tag;
381
382 in_uint8(s, tag);
383 in_uint8s(s, 3); /* version, length */
384
385#if WITH_DEBUG
386 DEBUG(("Received licensing PDU (message type 0x%02x)\n", tag));
387#endif
388
389 switch (tag)
390 {
393 break;
394
397 break;
398
401 /* we can handle new and upgrades of licences the same way. */
403 break;
404
407 break;
408
409 default:
410 unimpl("licence tag 0x%02x\n", tag);
411 }
412}
#define LICENCE_TAG_ERROR_ALERT
Definition: constants.h:152
#define LICENCE_TAG_UPGRADE_LICENCE
Definition: constants.h:148
#define LICENCE_TAG_NEW_LICENCE
Definition: constants.h:147
#define LICENCE_TAG_REQUEST
Definition: constants.h:145
#define LICENCE_TAG_PLATFORM_CHALLANGE
Definition: constants.h:146
void licence_process_error_alert(STREAM s)
Definition: licence.c:324
static void licence_process_platform_challenge(STREAM s)
Definition: licence.c:253
static void licence_process_request(STREAM s)
Definition: licence.c:156
static void licence_process_new_license(STREAM s)
Definition: licence.c:288
#define in_uint8s(s, n)
Definition: parse.h:91
#define DEBUG(args)
Definition: rdesktop.h:129

Referenced by sec_recv().

◆ load_licence()

int load_licence ( unsigned char **  data)

◆ lspci_init()

RD_BOOL lspci_init ( void  )

Referenced by main().

◆ main()

int main ( int  argc,
char argv[] 
)

Definition at line 1685 of file atactl.cpp.

1689{
1690 //ULONG Flags = 0;
1691 intptr_t i;
1692 uintptr_t j;
1693 char a;
1694 int bus_id = -1;
1695 int dev_id = -1;
1696 int cmd = 0;
1697 int lock = -1;
1698 int b_dev=-1, d_dev=-1, l_dev=0;
1699 int mode=-1;
1700 int list_bb=0;
1701 int persistent_hide=0;
1702 int power_mode=StartStop_Power_NoChg;
1703
1704 printf("Console ATA control utility for Windows NT3.51/NT4/2000/XP/2003\n"
1705 "Version 0." UNIATA_VER_STR ", Copyright (c) Alexander A. Telyatnikov, 2003-2012\n"
1706 "Home site: http://alter.org.ua\n");
1707
1708 for(i=1; i<argc; i++) {
1709 if(!argv[i])
1710 continue;
1711 if((a = argv[i][0]) != '-') {
1712 for(j=0; (a = argv[i][j]); j++) {
1713 switch(a) {
1714 case 'a' :
1715 case 's' :
1716 case 'c' :
1717 j++;
1718 bus_id = ata_num_to_x_dev(argv[i][j]);
1719 break;
1720 case 'b' :
1721 j++;
1722 b_dev = ata_num_to_x_dev(argv[i][j]);
1723 break;
1724 case 'd' :
1725 j++;
1726 d_dev = ata_num_to_x_dev(argv[i][j]);
1727 break;
1728 case 'l' :
1729 j++;
1730 l_dev = ata_num_to_x_dev(argv[i][j]);
1731 break;
1732 case ':' :
1733 break;
1734 default:
1735 print_help();
1736 }
1737 }
1738 continue;
1739 }
1740 j=1;
1741 while(argv[i] && (a = argv[i][j]) && (a != ' ') && (a != '\t')) {
1742 switch(a) {
1743 case 'l' :
1744 if(cmd || lock>0) {
1745 print_help();
1746 }
1747 cmd = CMD_ATA_LIST;
1748 break;
1749 case 'x' :
1750 g_extended = 1;
1751 break;
1752 case 'a' :
1753 g_adapter_info = 1;
1754 break;
1755 case 'S' :
1756 persistent_hide = 1;
1757 case 's' :
1758 if(cmd || lock>0) {
1759 print_help();
1760 }
1761 cmd = CMD_ATA_FIND;
1762 d_dev = 0;
1763 break;
1764 case 'H' :
1765 persistent_hide = 1;
1766 case 'h' :
1767 if(cmd) {
1768 print_help();
1769 }
1770 cmd = CMD_ATA_HIDE;
1771 d_dev = 0;
1772 break;
1773 case 'm' :
1774 if(cmd) {
1775 print_help();
1776 }
1777 cmd = CMD_ATA_MODE;
1778 i++;
1779 if(!argv[i]) {
1780 print_help();
1781 }
1783 if(mode == -1) {
1784 i--;
1785 } else {
1786 j = strlen(argv[i])-1;
1787 }
1788 break;
1789 case 'r' :
1790 if(cmd) {
1791 print_help();
1792 }
1794 break;
1795 case 'b' :
1796 if(cmd) {
1797 print_help();
1798 }
1799 switch(argv[i][j+1]) {
1800 case 'l':
1801 list_bb = 1;
1802 break;
1803 case 'a':
1804 list_bb = 0;
1805 break;
1806 case 'r':
1807 list_bb = -1;
1808 break;
1809 default:
1810 j--;
1811 }
1812 j++;
1813 cmd = CMD_ATA_BBLK;
1814 break;
1815 case 'f' :
1816 if(cmd != CMD_ATA_BBLK) {
1817 print_help();
1818 }
1819 i++;
1820 if(!argv[i]) {
1821 print_help();
1822 }
1823 g_bb_list=argv[i];
1824 j = strlen(argv[i])-1;
1825 break;
1826 case 'p' :
1827 if(cmd && (cmd != CMD_ATA_FIND) && (cmd != CMD_ATA_HIDE)) {
1828 print_help();
1829 }
1830 switch(argv[i][j+1]) {
1831 case '0':
1832 case 'a':
1833 // do nothing
1834 break;
1835 case '1':
1836 case 'i':
1837 power_mode = StartStop_Power_Idle;
1838 break;
1839 case '2':
1840 case 's':
1841 power_mode = StartStop_Power_Standby;
1842 break;
1843 case '3':
1844 case 'p':
1845 power_mode = StartStop_Power_Sleep;
1846 break;
1847 default:
1848 j--;
1849 }
1850 j++;
1851 if(power_mode && !cmd) {
1853 }
1854 break;
1855 case 'D' :
1856 power_mode = StartStop_Power_Sleep;
1857 if(cmd && (cmd != CMD_ATA_HIDE)) {
1858 print_help();
1859 }
1860 case 'd' :
1861 if(cmd && (cmd != CMD_ATA_FIND) && (cmd != CMD_ATA_HIDE) && (cmd != CMD_ATA_POWER)) {
1862 print_help();
1863 }
1864 if(!cmd) {
1865 cmd = CMD_ATA_HIDE;
1866 }
1867 i++;
1868 if(!argv[i]) {
1869 print_help();
1870 }
1871 if(!sscanf(argv[i], "%d", &lock)) {
1873 i--;
1874 }
1875 j = strlen(argv[i])-1;
1876 break;
1877 case 'n' :
1878 if(cmd != CMD_ATA_BBLK) {
1879 print_help();
1880 }
1881 i++;
1882 if(!argv[i]) {
1883 print_help();
1884 }
1885 if(!strcmp(argv[i], "hex") ||
1886 !strcmp(argv[i], "16")) {
1887 gRadix = 16;
1888 } else
1889 if(!strcmp(argv[i], "dec") ||
1890 !strcmp(argv[i], "10")) {
1891 gRadix = 10;
1892 } else {
1893 print_help();
1894 }
1895 j = strlen(argv[i])-1;
1896 break;
1897 case '?' :
1898 default:
1899 print_help();
1900 }
1901 j++;
1902 }
1903 }
1904
1905 if(g_adapter_info && !cmd) {
1906 cmd = CMD_ATA_LIST;
1907 b_dev = 127;
1908 d_dev = 127;
1909 l_dev = 127;
1910 } else
1911 if((d_dev == -1) && (b_dev != -1)) {
1912 d_dev = 127;
1913 l_dev = 127;
1914 }
1915
1916 if((d_dev != -1) && (b_dev != -1)) {
1917 dev_id = (b_dev << 16) | (d_dev << 8) | l_dev;
1918 }
1919 if(cmd == CMD_ATA_LIST) {
1920 ata_list(bus_id, dev_id);
1921 } else
1922 if(cmd == CMD_ATA_MODE) {
1923 ata_mode(bus_id, dev_id, mode);
1924 } else
1925 if(cmd == CMD_ATA_RESET) {
1926 ata_reset(bus_id, dev_id);
1927 } else
1928 if(cmd == CMD_ATA_FIND) {
1929 ata_scan(bus_id, dev_id, lock, persistent_hide);
1930 } else
1931 if(cmd == CMD_ATA_HIDE) {
1932 ata_hide(bus_id, dev_id, lock, persistent_hide, power_mode);
1933 } else
1934 if(cmd == CMD_ATA_BBLK) {
1935 ata_bblk(bus_id, dev_id, list_bb);
1936 } else
1937 if(cmd == CMD_ATA_POWER) {
1938 ata_power_mode(bus_id, dev_id, power_mode);
1939 } else {
1940 print_help();
1941 }
1942 exit(0);
1943}
static int argc
Definition: ServiceArgs.c:12
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
BOOLEAN ata_scan(int bus_id, int dev_id, int lock, int unhide)
Definition: atactl.cpp:1249
int g_adapter_info
Definition: atactl.cpp:40
#define DEFAULT_REMOVAL_LOCK_TIMEOUT
Definition: atactl.cpp:18
int g_extended
Definition: atactl.cpp:39
BOOLEAN ata_list(int bus_id, int dev_id)
Definition: atactl.cpp:1064
BOOLEAN ata_power_mode(int bus_id, int dev_id, int power_mode)
Definition: atactl.cpp:1629
BOOLEAN ata_hide(int bus_id, int dev_id, int lock, int persistent_hide, int power_mode)
Definition: atactl.cpp:1191
#define CMD_ATA_RESET
Definition: atactl.cpp:134
BOOLEAN ata_bblk(int bus_id, int dev_id, int list_bb)
Definition: atactl.cpp:1348
BOOLEAN ata_reset(int bus_id, int dev_id)
Definition: atactl.cpp:1144
#define CMD_ATA_BBLK
Definition: atactl.cpp:135
void print_help()
Definition: atactl.cpp:52
int gRadix
Definition: atactl.cpp:42
#define CMD_ATA_POWER
Definition: atactl.cpp:136
#define CMD_ATA_MODE
Definition: atactl.cpp:133
#define CMD_ATA_HIDE
Definition: atactl.cpp:132
#define CMD_ATA_LIST
Definition: atactl.cpp:130
BOOLEAN ata_mode(int bus_id, int dev_id, int mode)
Definition: atactl.cpp:1097
int ata_num_to_x_dev(char a)
Definition: atactl.cpp:1675
#define CMD_ATA_FIND
Definition: atactl.cpp:131
char * g_bb_list
Definition: atactl.cpp:41
int ata_str_to_mode(char *str)
Definition: atactl.cpp:443
int intptr_t
Definition: crtdefs.h:304
unsigned int uintptr_t
Definition: crtdefs.h:321
#define StartStop_Power_NoChg
Definition: scsi.h:406
#define StartStop_Power_Sleep
Definition: scsi.h:409
#define StartStop_Power_Idle
Definition: scsi.h:407
#define StartStop_Power_Standby
Definition: scsi.h:408
#define printf
Definition: freeldr.h:94
GLenum mode
Definition: glext.h:6217
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
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
Definition: glfuncs.h:250
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
#define a
Definition: ke_i.h:78
#define argv
Definition: mplay32.c:18
Definition: ftp_var.h:139
rwlock_t lock
Definition: tcpcore.h:0
#define UNIATA_VER_STR
Definition: uniata_ver.h:1

◆ mcs_connect_finalize()

RD_BOOL mcs_connect_finalize ( STREAM  s)

Definition at line 318 of file mcs.c.

319{
320 unsigned int i;
321
322 mcs_send_connect_initial(mcs_data);
323 if (!mcs_recv_connect_response(mcs_data))
324 goto error;
325
327
330 goto error;
331
333
334 if (!mcs_recv_cjcf())
335 goto error;
336
338 if (!mcs_recv_cjcf())
339 goto error;
340
341 for (i = 0; i < g_num_channels; i++)
342 {
343 mcs_send_cjrq(g_channels[i].mcs_id);
344 if (!mcs_recv_cjcf())
345 goto error;
346 }
347 return True;
348
349 error:
351 return False;
352}
#define MCS_USERCHANNEL_BASE
Definition: constants.h:88
void iso_disconnect(void)
Definition: iso.c:362
static void mcs_send_cjrq(uint16 chanid)
Definition: mcs.c:192
static void mcs_send_edrq(void)
Definition: mcs.c:131
static RD_BOOL mcs_recv_aucf(uint16 *mcs_userid)
Definition: mcs.c:161
static void mcs_send_aurq(void)
Definition: mcs.c:147
static RD_BOOL mcs_recv_connect_response(STREAM mcs_data)
Definition: mcs.c:87
static RD_BOOL mcs_recv_cjcf(void)
Definition: mcs.c:210
unsigned int g_num_channels
Definition: channels.c:33
static void mcs_send_connect_initial(STREAM mcs_data)
Definition: mcs.c:57
uint16 g_mcs_userid
Definition: mcs.c:23
VCHANNEL g_channels[]
Definition: channels.c:32

Referenced by sec_connect().

◆ mcs_connect_start()

RD_BOOL mcs_connect_start ( char server,
char username,
char domain,
char password,
RD_BOOL  reconnect,
uint32 selected_protocol 
)

Definition at line 311 of file mcs.c.

313{
314 return iso_connect(server, username, domain, password, reconnect, selected_protocol);
315}
RD_BOOL iso_connect(char *server, char *username, char *domain, char *password, RD_BOOL reconnect, uint32 *selected_protocol)
Definition: iso.c:203

Referenced by sec_connect().

◆ mcs_disconnect()

void mcs_disconnect ( void  )

Definition at line 356 of file mcs.c.

357{
359}

Referenced by sec_disconnect().

◆ mcs_init()

STREAM mcs_init ( int  length)

Definition at line 242 of file mcs.c.

243{
244 STREAM s;
245
246 s = iso_init(length + 8);
247 s_push_layer(s, mcs_hdr, 8);
248
249 return s;
250}
STREAM iso_init(int length)
Definition: iso.c:150

Referenced by sec_init().

◆ mcs_recv()

STREAM mcs_recv ( uint16 channel,
uint8 rdpver 
)

Definition at line 280 of file mcs.c.

281{
282 uint8 opcode, appid, length;
283 STREAM s;
284
285 s = iso_recv(rdpver);
286 if (s == NULL)
287 return NULL;
288 if (rdpver != NULL)
289 if (*rdpver != 3)
290 return s;
291 in_uint8(s, opcode);
292 appid = opcode >> 2;
293 if (appid != MCS_SDIN)
294 {
295 if (appid != MCS_DPUM)
296 {
297 error("expected data, got %d\n", opcode);
298 }
299 return NULL;
300 }
301 in_uint8s(s, 2); /* userid */
302 in_uint16_be(s, *channel);
303 in_uint8s(s, 1); /* flags */
304 in_uint8(s, length);
305 if (length & 0x80)
306 in_uint8s(s, 1); /* second byte of length */
307 return s;
308}
@ MCS_SDIN
Definition: constants.h:71
@ MCS_DPUM
Definition: constants.h:65
STREAM iso_recv(uint8 *rdpver)
Definition: iso.c:182
char * appid
Definition: mkisofs.c:161

Referenced by sec_recv().

◆ mcs_reset_state()

void mcs_reset_state ( void  )

Definition at line 363 of file mcs.c.

364{
365 g_mcs_userid = 0;
367}
void iso_reset_state(void)
Definition: iso.c:370

Referenced by sec_reset_state().

◆ mcs_send()

void mcs_send ( STREAM  s)

Definition at line 273 of file mcs.c.

274{
276}
void mcs_send_to_channel(STREAM s, uint16 channel)
Definition: mcs.c:254

◆ mcs_send_to_channel()

void mcs_send_to_channel ( STREAM  s,
uint16  channel 
)

Definition at line 254 of file mcs.c.

255{
257
258 s_pop_layer(s, mcs_hdr);
259 length = s->end - s->p - 8;
260 length |= 0x8000;
261
262 out_uint8(s, (MCS_SDRQ << 2));
264 out_uint16_be(s, channel);
265 out_uint8(s, 0x70); /* flags */
267
268 iso_send(s);
269}
@ MCS_SDRQ
Definition: constants.h:70
void iso_send(STREAM s)
Definition: iso.c:162

Referenced by mcs_send(), and sec_send_to_channel().

◆ mppc_expand()

int mppc_expand ( uint8 data,
uint32  clen,
uint8  ctype,
uint32 roff,
uint32 rlen 
)

Definition at line 58 of file mppc.c.

59{
60 int k, walker_len = 0, walker;
61 uint32 i = 0;
62 int next_offset, match_off;
63 int match_len;
64 int old_offset, match_bits;
66
67 uint8 *dict = g_mppc_dict.hist;
68
69 if ((ctype & RDP_MPPC_COMPRESSED) == 0)
70 {
71 *roff = 0;
72 *rlen = clen;
73 return 0;
74 }
75
76 if ((ctype & RDP_MPPC_RESET) != 0)
77 {
78 g_mppc_dict.roff = 0;
79 }
80
81 if ((ctype & RDP_MPPC_FLUSH) != 0)
82 {
83 memset(dict, 0, RDP_MPPC_DICT_SIZE);
84 g_mppc_dict.roff = 0;
85 }
86
87 *roff = 0;
88 *rlen = 0;
89
90 walker = g_mppc_dict.roff;
91
92 next_offset = walker;
93 old_offset = next_offset;
94 *roff = old_offset;
95 if (clen == 0)
96 return 0;
97 clen += i;
98
99 do
100 {
101 if (walker_len == 0)
102 {
103 if (i >= clen)
104 break;
105 walker = data[i++] << 24;
106 walker_len = 8;
107 }
108 if (walker >= 0)
109 {
110 if (walker_len < 8)
111 {
112 if (i >= clen)
113 {
114 if (walker != 0)
115 return -1;
116 break;
117 }
118 walker |= (data[i++] & 0xff) << (24 - walker_len);
119 walker_len += 8;
120 }
121 if (next_offset >= RDP_MPPC_DICT_SIZE)
122 return -1;
123 dict[next_offset++] = (((uint32) walker) >> ((uint32) 24));
124 walker <<= 8;
125 walker_len -= 8;
126 continue;
127 }
128 walker <<= 1;
129 /* fetch next 8-bits */
130 if (--walker_len == 0)
131 {
132 if (i >= clen)
133 return -1;
134 walker = data[i++] << 24;
135 walker_len = 8;
136 }
137 /* literal decoding */
138 if (walker >= 0)
139 {
140 if (walker_len < 8)
141 {
142 if (i >= clen)
143 return -1;
144 walker |= (data[i++] & 0xff) << (24 - walker_len);
145 walker_len += 8;
146 }
147 if (next_offset >= RDP_MPPC_DICT_SIZE)
148 return -1;
149 dict[next_offset++] = (uint8) (walker >> 24 | 0x80);
150 walker <<= 8;
151 walker_len -= 8;
152 continue;
153 }
154
155 /* decode offset */
156 /* length pair */
157 walker <<= 1;
158 if (--walker_len < (big ? 3 : 2))
159 {
160 if (i >= clen)
161 return -1;
162 walker |= (data[i++] & 0xff) << (24 - walker_len);
163 walker_len += 8;
164 }
165
166 if (big)
167 {
168 /* offset decoding where offset len is:
169 -63: 11111 followed by the lower 6 bits of the value
170 64-319: 11110 followed by the lower 8 bits of the value ( value - 64 )
171 320-2367: 1110 followed by lower 11 bits of the value ( value - 320 )
172 2368-65535: 110 followed by lower 16 bits of the value ( value - 2368 )
173 */
174 switch (((uint32) walker) >> ((uint32) 29))
175 {
176 case 7: /* - 63 */
177 for (; walker_len < 9; walker_len += 8)
178 {
179 if (i >= clen)
180 return -1;
181 walker |= (data[i++] & 0xff) << (24 - walker_len);
182 }
183 walker <<= 3;
184 match_off = ((uint32) walker) >> ((uint32) 26);
185 walker <<= 6;
186 walker_len -= 9;
187 break;
188
189 case 6: /* 64 - 319 */
190 for (; walker_len < 11; walker_len += 8)
191 {
192 if (i >= clen)
193 return -1;
194 walker |= (data[i++] & 0xff) << (24 - walker_len);
195 }
196
197 walker <<= 3;
198 match_off = (((uint32) walker) >> ((uint32) 24)) + 64;
199 walker <<= 8;
200 walker_len -= 11;
201 break;
202
203 case 5:
204 case 4: /* 320 - 2367 */
205 for (; walker_len < 13; walker_len += 8)
206 {
207 if (i >= clen)
208 return -1;
209 walker |= (data[i++] & 0xff) << (24 - walker_len);
210 }
211
212 walker <<= 2;
213 match_off = (((uint32) walker) >> ((uint32) 21)) + 320;
214 walker <<= 11;
215 walker_len -= 13;
216 break;
217
218 default: /* 2368 - 65535 */
219 for (; walker_len < 17; walker_len += 8)
220 {
221 if (i >= clen)
222 return -1;
223 walker |= (data[i++] & 0xff) << (24 - walker_len);
224 }
225
226 walker <<= 1;
227 match_off = (((uint32) walker) >> ((uint32) 16)) + 2368;
228 walker <<= 16;
229 walker_len -= 17;
230 break;
231 }
232 }
233 else
234 {
235 /* offset decoding where offset len is:
236 -63: 1111 followed by the lower 6 bits of the value
237 64-319: 1110 followed by the lower 8 bits of the value ( value - 64 )
238 320-8191: 110 followed by the lower 13 bits of the value ( value - 320 )
239 */
240 switch (((uint32) walker) >> ((uint32) 30))
241 {
242 case 3: /* - 63 */
243 if (walker_len < 8)
244 {
245 if (i >= clen)
246 return -1;
247 walker |= (data[i++] & 0xff) << (24 - walker_len);
248 walker_len += 8;
249 }
250 walker <<= 2;
251 match_off = ((uint32) walker) >> ((uint32) 26);
252 walker <<= 6;
253 walker_len -= 8;
254 break;
255
256 case 2: /* 64 - 319 */
257 for (; walker_len < 10; walker_len += 8)
258 {
259 if (i >= clen)
260 return -1;
261 walker |= (data[i++] & 0xff) << (24 - walker_len);
262 }
263
264 walker <<= 2;
265 match_off = (((uint32) walker) >> ((uint32) 24)) + 64;
266 walker <<= 8;
267 walker_len -= 10;
268 break;
269
270 default: /* 320 - 8191 */
271 for (; walker_len < 14; walker_len += 8)
272 {
273 if (i >= clen)
274 return -1;
275 walker |= (data[i++] & 0xff) << (24 - walker_len);
276 }
277
278 match_off = (walker >> 18) + 320;
279 walker <<= 14;
280 walker_len -= 14;
281 break;
282 }
283 }
284 if (walker_len == 0)
285 {
286 if (i >= clen)
287 return -1;
288 walker = data[i++] << 24;
289 walker_len = 8;
290 }
291
292 /* decode length of match */
293 match_len = 0;
294 if (walker >= 0)
295 { /* special case - length of 3 is in bit 0 */
296 match_len = 3;
297 walker <<= 1;
298 walker_len--;
299 }
300 else
301 {
302 /* this is how it works len of:
303 4-7: 10 followed by 2 bits of the value
304 8-15: 110 followed by 3 bits of the value
305 16-31: 1110 followed by 4 bits of the value
306 32-63: .... and so forth
307 64-127:
308 128-255:
309 256-511:
310 512-1023:
311 1024-2047:
312 2048-4095:
313 4096-8191:
314
315 i.e. 4097 is encoded as: 111111111110 000000000001
316 meaning 4096 + 1...
317 */
318 match_bits = big ? 14 : 11; /* 11 or 14 bits of value at most */
319 do
320 {
321 walker <<= 1;
322 if (--walker_len == 0)
323 {
324 if (i >= clen)
325 return -1;
326 walker = data[i++] << 24;
327 walker_len = 8;
328 }
329 if (walker >= 0)
330 break;
331 if (--match_bits == 0)
332 {
333 return -1;
334 }
335 }
336 while (1);
337 match_len = (big ? 16 : 13) - match_bits;
338 walker <<= 1;
339 if (--walker_len < match_len)
340 {
341 for (; walker_len < match_len; walker_len += 8)
342 {
343 if (i >= clen)
344 {
345 return -1;
346 }
347 walker |= (data[i++] & 0xff) << (24 - walker_len);
348 }
349 }
350
351 match_bits = match_len;
352 match_len =
353 ((walker >> (32 - match_bits)) & (~(-1 << match_bits))) | (1 <<
354 match_bits);
355 walker <<= match_bits;
356 walker_len -= match_bits;
357 }
358 if (next_offset + match_len >= RDP_MPPC_DICT_SIZE)
359 {
360 return -1;
361 }
362 /* memory areas can overlap - meaning we can't use memXXX functions */
363 k = (next_offset - match_off) & (big ? 65535 : 8191);
364 do
365 {
366 dict[next_offset++] = dict[k++];
367 }
368 while (--match_len != 0);
369 }
370 while (1);
371
372 /* store history offset */
373 g_mppc_dict.roff = next_offset;
374
375 *roff = old_offset;
376 *rlen = next_offset - old_offset;
377
378 return 0;
379}
#define RDP_MPPC_RESET
Definition: constants.h:356
#define RDP_MPPC_DICT_SIZE
Definition: constants.h:358
#define RDP_MPPC_COMPRESSED
Definition: constants.h:355
#define RDP_MPPC_BIG
Definition: constants.h:354
#define RDP_MPPC_FLUSH
Definition: constants.h:357
RDPCOMP g_mppc_dict
Definition: mppc.c:55
Definition: _ctype.h:58
int k
Definition: mpi.c:3369
#define memset(x, y, z)
Definition: compat.h:39
uint32 roff
Definition: types.h:190
uint8 hist[RDP_MPPC_DICT_SIZE]
Definition: types.h:191

Referenced by process_data_pdu(), and rdp5_process().

◆ next_arg()

char * next_arg ( char src,
char  needle 
)

Definition at line 1174 of file rdesktop.c.

1175{
1176 char *nextval;
1177 char *p;
1178 char *mvp = 0;
1179
1180 /* EOS */
1181 if (*src == (char) 0x00)
1182 return 0;
1183
1184 p = src;
1185 /* skip escaped needles */
1186 while ((nextval = strchr(p, needle)))
1187 {
1188 mvp = nextval - 1;
1189 /* found backslashed needle */
1190 if (*mvp == '\\' && (mvp > src))
1191 {
1192 /* move string one to the left */
1193 while (*(mvp + 1) != (char) 0x00)
1194 {
1195 *mvp = *(mvp + 1);
1196 mvp++;
1197 }
1198 *mvp = (char) 0x00;
1199 p = nextval;
1200 }
1201 else
1202 {
1203 p = nextval + 1;
1204 break;
1205 }
1206
1207 }
1208
1209 /* more args available */
1210 if (nextval)
1211 {
1212 *nextval = (char) 0x00;
1213 return ++nextval;
1214 }
1215
1216 /* no more args after this, jump to EOS */
1217 nextval = src + strlen(src);
1218 return nextval;
1219}
unsigned char
Definition: typeof.h:29
GLenum src
Definition: glext.h:6340

Referenced by disk_enum_devices(), parallel_enum_devices(), printer_enum_devices(), serial_enum_devices(), service_mainA(), and service_mainW().

◆ parallel_enum_devices()

int parallel_enum_devices ( uint32 id,
char optarg 
)

Referenced by main().

◆ printer_enum_devices()

int printer_enum_devices ( uint32 id,
char optarg 
)

Referenced by main().

◆ printercache_load_blob()

int printercache_load_blob ( char printer_name,
uint8 **  data 
)

Definition at line 154 of file printercache.c.

155{
156 char *home, *path;
157 struct stat st;
158 int fd, length;
159
160 if (printer_name == NULL)
161 return 0;
162
163 *data = NULL;
164
165 home = getenv("HOME");
166 if (home == NULL)
167 return 0;
168
169 path = (char *) xmalloc(strlen(home) + sizeof("/.rdesktop/rdpdr/") + strlen(printer_name) +
170 sizeof("/AutoPrinterCacheData") + 1);
171 sprintf(path, "%s/.rdesktop/rdpdr/%s/AutoPrinterCacheData", home, printer_name);
172
173 fd = open(path, O_RDONLY);
174 if (fd == -1)
175 {
176 xfree(path);
177 return 0;
178 }
179
180 if (fstat(fd, &st))
181 {
182 xfree(path);
183 close(fd);
184 return 0;
185 }
186
187 *data = (uint8 *) xmalloc(st.st_size);
188 length = read(fd, *data, st.st_size);
189 close(fd);
190 xfree(path);
191 return length;
192}
#define read
Definition: acwin.h:96
#define O_RDONLY
Definition: acwin.h:108
#define open
Definition: acwin.h:95
#define close
Definition: acwin.h:98
#define fstat
Definition: acwin.h:100
_Check_return_ char *__cdecl getenv(_In_z_ const char *_VarName)
static int fd
Definition: io.c:51
Definition: tftpd.h:38
Definition: stat.h:55

Referenced by announcedata_size().

◆ printercache_process()

void printercache_process ( STREAM  s)

Referenced by rdpdr_process().

◆ process_bitmap_updates()

void process_bitmap_updates ( STREAM  s)

Definition at line 1224 of file rdp.c.

1225{
1226 uint16 num_updates;
1228 uint16 cx, cy, bpp, Bpp, compress, bufsize, size;
1229 uint8 *data, *bmpdata;
1230 int i;
1231
1232 in_uint16_le(s, num_updates);
1233
1234 for (i = 0; i < num_updates; i++)
1235 {
1237 in_uint16_le(s, top);
1242 in_uint16_le(s, bpp);
1243 Bpp = (bpp + 7) / 8;
1246
1247 cx = right - left + 1;
1248 cy = bottom - top + 1;
1249
1250 DEBUG(("BITMAP_UPDATE(l=%d,t=%d,r=%d,b=%d,w=%d,h=%d,Bpp=%d,cmp=%d)\n",
1251 left, top, right, bottom, width, height, Bpp, compress));
1252
1253 if (!compress)
1254 {
1255 int y;
1256 bmpdata = (uint8 *) xmalloc(width * height * Bpp);
1257 for (y = 0; y < height; y++)
1258 {
1259 in_uint8a(s, &bmpdata[(height - y - 1) * (width * Bpp)],
1260 width * Bpp);
1261 }
1262 ui_paint_bitmap(left, top, cx, cy, width, height, bmpdata);
1263 xfree(bmpdata);
1264 continue;
1265 }
1266
1267
1268 if (compress & 0x400)
1269 {
1270 size = bufsize;
1271 }
1272 else
1273 {
1274 in_uint8s(s, 2); /* pad */
1276 in_uint8s(s, 4); /* line_size, final_size */
1277 }
1278 in_uint8p(s, data, size);
1279 bmpdata = (uint8 *) xmalloc(width * height * Bpp);
1280 if (bitmap_decompress(bmpdata, width, height, data, size, Bpp))
1281 {
1282 ui_paint_bitmap(left, top, cx, cy, width, height, bmpdata);
1283 }
1284 else
1285 {
1286 DEBUG_RDP5(("Failed to decompress data\n"));
1287 }
1288
1289 xfree(bmpdata);
1290 }
1291}
RD_BOOL bitmap_decompress(uint8 *output, int width, int height, uint8 *input, int size, int Bpp)
Definition: bitmap.c:884
#define in_uint16_le(s, v)
Definition: parse.h:55
#define in_uint8p(s, v, n)
Definition: parse.h:89
#define in_uint8a(s, v, n)
Definition: parse.h:90
void ui_paint_bitmap(int x, int y, int cx, int cy, int width, int height, uint8 *data)
Definition: uimain.c:307
DWORD bpp
Definition: surface.c:185
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
GLdouble GLdouble right
Definition: glext.h:10859
GLint left
Definition: glext.h:7726
GLint GLint bottom
Definition: glext.h:7726
GLenum GLuint GLsizei bufsize
Definition: glext.h:7473
int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)
Definition: compress.c:68

Referenced by process_update_pdu(), and rdp5_process().

◆ process_cached_pointer_pdu()

void process_cached_pointer_pdu ( STREAM  s)

Definition at line 1156 of file rdp.c.

1157{
1158 uint16 cache_idx;
1159
1160 in_uint16_le(s, cache_idx);
1161 ui_set_cursor(cache_get_cursor(cache_idx));
1162}
RD_HCURSOR cache_get_cursor(uint16 cache_idx)
Definition: cache.c:400
void ui_set_cursor(RD_HCURSOR cursor)

Referenced by process_pointer_pdu(), and rdp5_process().

◆ process_colour_pointer_pdu()

void process_colour_pointer_pdu ( STREAM  s)

Definition at line 1139 of file rdp.c.

1140{
1142}
static void process_colour_pointer_common(STREAM s, int bpp)
Definition: rdp.c:1107

Referenced by process_pointer_pdu(), and rdp5_process().

◆ process_disconnect_pdu()

void process_disconnect_pdu ( STREAM  s,
uint32 ext_disc_reason 
)

Definition at line 1407 of file rdp.c.

1408{
1410
1411 DEBUG(("Received disconnect PDU\n"));
1412}
uint32 ext_disc_reason
Definition: svgawin.c:64

◆ process_new_pointer_pdu()

void process_new_pointer_pdu ( STREAM  s)

Definition at line 1146 of file rdp.c.

1147{
1148 int xor_bpp;
1149
1150 in_uint16_le(s, xor_bpp);
1152}

Referenced by process_pointer_pdu(), and rdp5_process().

◆ process_orders()

void process_orders ( STREAM  s,
uint16  num_orders 
)

Definition at line 1311 of file orders.c.

1312{
1314 uint32 present;
1315 uint8 order_flags;
1316 int size, processed = 0;
1317 RD_BOOL delta;
1318
1319 while (processed < num_orders)
1320 {
1321 in_uint8(s, order_flags);
1322
1323 if (!(order_flags & RDP_ORDER_STANDARD))
1324 {
1325 error("order parsing failed\n");
1326 break;
1327 }
1328
1329 if (order_flags & RDP_ORDER_SECONDARY)
1330 {
1332 }
1333 else
1334 {
1335 if (order_flags & RDP_ORDER_CHANGE)
1336 {
1337 in_uint8(s, os->order_type);
1338 }
1339
1340 switch (os->order_type)
1341 {
1342 case RDP_ORDER_TRIBLT:
1343 case RDP_ORDER_TEXT2:
1344 size = 3;
1345 break;
1346
1347 case RDP_ORDER_PATBLT:
1348 case RDP_ORDER_MEMBLT:
1349 case RDP_ORDER_LINE:
1350 case RDP_ORDER_POLYGON2:
1351 case RDP_ORDER_ELLIPSE2:
1352 size = 2;
1353 break;
1354
1355 default:
1356 size = 1;
1357 }
1358
1359 rdp_in_present(s, &present, order_flags, size);
1360
1361 if (order_flags & RDP_ORDER_BOUNDS)
1362 {
1363 if (!(order_flags & RDP_ORDER_LASTBOUNDS))
1364 rdp_parse_bounds(s, &os->bounds);
1365
1367 os->bounds.top,
1368 os->bounds.right -
1369 os->bounds.left + 1,
1370 os->bounds.bottom - os->bounds.top + 1);
1371 }
1372
1373 delta = order_flags & RDP_ORDER_DELTA;
1374
1375 switch (os->order_type)
1376 {
1377 case RDP_ORDER_DESTBLT:
1378 process_destblt(s, &os->destblt, present, delta);
1379 break;
1380
1381 case RDP_ORDER_PATBLT:
1382 process_patblt(s, &os->patblt, present, delta);
1383 break;
1384
1386 process_screenblt(s, &os->screenblt, present, delta);
1387 break;
1388
1389 case RDP_ORDER_LINE:
1390 process_line(s, &os->line, present, delta);
1391 break;
1392
1393 case RDP_ORDER_RECT:
1394 process_rect(s, &os->rect, present, delta);
1395 break;
1396
1397 case RDP_ORDER_DESKSAVE:
1398 process_desksave(s, &os->desksave, present, delta);
1399 break;
1400
1401 case RDP_ORDER_MEMBLT:
1402 process_memblt(s, &os->memblt, present, delta);
1403 break;
1404
1405 case RDP_ORDER_TRIBLT:
1406 process_triblt(s, &os->triblt, present, delta);
1407 break;
1408
1409 case RDP_ORDER_POLYGON:
1410 process_polygon(s, &os->polygon, present, delta);
1411 break;
1412
1413 case RDP_ORDER_POLYGON2:
1414 process_polygon2(s, &os->polygon2, present, delta);
1415 break;
1416
1417 case RDP_ORDER_POLYLINE:
1418 process_polyline(s, &os->polyline, present, delta);
1419 break;
1420
1421 case RDP_ORDER_ELLIPSE:
1422 process_ellipse(s, &os->ellipse, present, delta);
1423 break;
1424
1425 case RDP_ORDER_ELLIPSE2:
1426 process_ellipse2(s, &os->ellipse2, present, delta);
1427 break;
1428
1429 case RDP_ORDER_TEXT2:
1430 process_text2(s, &os->text2, present, delta);
1431 break;
1432
1433 default:
1434 unimpl("order %d\n", os->order_type);
1435 return;
1436 }
1437
1438 if (order_flags & RDP_ORDER_BOUNDS)
1439 ui_reset_clip();
1440 }
1441
1442 processed++;
1443 }
1444#if 0
1445 /* not true when RDP_COMPRESSION is set */
1446 if (s->p != g_next_packet)
1447 error("%d bytes remaining\n", (int) (g_next_packet - s->p));
1448#endif
1449
1450}
static void process_rect(STREAM s, RECT_ORDER *os, uint32 present, RD_BOOL delta)
Definition: orders.c:334
static void process_polygon2(STREAM s, POLYGON2_ORDER *os, uint32 present, RD_BOOL delta)
Definition: orders.c:597
static void process_desksave(STREAM s, DESKSAVE_ORDER *os, uint32 present, RD_BOOL delta)
Definition: orders.c:374
static void process_triblt(STREAM s, TRIBLT_ORDER *os, uint32 present, RD_BOOL delta)
Definition: orders.c:456
static void process_ellipse2(STREAM s, ELLIPSE2_ORDER *os, uint32 present, RD_BOOL delta)
Definition: orders.c:795
static void process_destblt(STREAM s, DESTBLT_ORDER *os, uint32 present, RD_BOOL delta)
Definition: orders.c:201
static void process_polygon(STREAM s, POLYGON_ORDER *os, uint32 present, RD_BOOL delta)
Definition: orders.c:518
uint8 * g_next_packet
Definition: rdp.c:45
static void process_ellipse(STREAM s, ELLIPSE_ORDER *os, uint32 present, RD_BOOL delta)
Definition: orders.c:763
static void rdp_in_present(STREAM s, uint32 *present, uint8 flags, int size)
Definition: orders.c:29
static RDP_ORDER_STATE g_order_state
Definition: orders.c:24
static void process_screenblt(STREAM s, SCREENBLT_ORDER *os, uint32 present, RD_BOOL delta)
Definition: orders.c:264
static void process_memblt(STREAM s, MEMBLT_ORDER *os, uint32 present, RD_BOOL delta)
Definition: orders.c:410
static void process_text2(STREAM s, TEXT2_ORDER *os, uint32 present, RD_BOOL delta)
Definition: orders.c:837
static void process_polyline(STREAM s, POLYLINE_ORDER *os, uint32 present, RD_BOOL delta)
Definition: orders.c:685
static RD_BOOL rdp_parse_bounds(STREAM s, BOUNDS *bounds)
Definition: orders.c:105
static void process_secondary_order(STREAM s)
Definition: orders.c:1256
static void process_patblt(STREAM s, PATBLT_ORDER *os, uint32 present, RD_BOOL delta)
Definition: orders.c:226
static void process_line(STREAM s, LINE_ORDER *os, uint32 present, RD_BOOL delta)
Definition: orders.c:295
#define RDP_ORDER_BOUNDS
Definition: orders.h:22
@ RDP_ORDER_POLYLINE
Definition: orders.h:41
@ RDP_ORDER_RECT
Definition: orders.h:35
@ RDP_ORDER_ELLIPSE
Definition: orders.h:42
@ RDP_ORDER_LINE
Definition: orders.h:34
@ RDP_ORDER_TRIBLT
Definition: orders.h:38
@ RDP_ORDER_DESTBLT
Definition: orders.h:31
@ RDP_ORDER_ELLIPSE2
Definition: orders.h:43
@ RDP_ORDER_TEXT2
Definition: orders.h:44
@ RDP_ORDER_PATBLT
Definition: orders.h:32
@ RDP_ORDER_MEMBLT
Definition: orders.h:37
@ RDP_ORDER_DESKSAVE
Definition: orders.h:36
@ RDP_ORDER_SCREENBLT
Definition: orders.h:33
@ RDP_ORDER_POLYGON2
Definition: orders.h:40
@ RDP_ORDER_POLYGON
Definition: orders.h:39
#define RDP_ORDER_CHANGE
Definition: orders.h:23
#define RDP_ORDER_SECONDARY
Definition: orders.h:21
#define RDP_ORDER_STANDARD
Definition: orders.h:20
#define RDP_ORDER_LASTBOUNDS
Definition: orders.h:25
#define RDP_ORDER_DELTA
Definition: orders.h:24
void ui_set_clip(int x, int y, int cx, int cy)
Definition: uimain.c:320
void ui_reset_clip(void)
Definition: uimain.c:328
sint16 left
Definition: types.h:74
sint16 top
Definition: types.h:75
sint16 right
Definition: types.h:76
sint16 bottom
Definition: types.h:77
ELLIPSE2_ORDER ellipse2
Definition: orders.h:286
DESKSAVE_ORDER desksave
Definition: orders.h:279
BOUNDS bounds
Definition: orders.h:272
POLYGON_ORDER polygon
Definition: orders.h:282
DESTBLT_ORDER destblt
Definition: orders.h:274
RECT_ORDER rect
Definition: orders.h:278
MEMBLT_ORDER memblt
Definition: orders.h:280
LINE_ORDER line
Definition: orders.h:277
TRIBLT_ORDER triblt
Definition: orders.h:281
POLYGON2_ORDER polygon2
Definition: orders.h:283
PATBLT_ORDER patblt
Definition: orders.h:275
POLYLINE_ORDER polyline
Definition: orders.h:284
SCREENBLT_ORDER screenblt
Definition: orders.h:276
ELLIPSE_ORDER ellipse
Definition: orders.h:285
TEXT2_ORDER text2
Definition: orders.h:287
uint8 order_type
Definition: orders.h:271
static int processed(const type_t *type)
Definition: typegen.c:2254

Referenced by process_update_pdu(), and rdp5_process().

◆ process_palette()

void process_palette ( STREAM  s)

Definition at line 1295 of file rdp.c.

1296{
1298 COLOURMAP map;
1299 RD_HCOLOURMAP hmap;
1300 int i;
1301
1302 in_uint8s(s, 2); /* pad */
1303 in_uint16_le(s, map.ncolours);
1304 in_uint8s(s, 2); /* pad */
1305
1306 map.colours = (COLOURENTRY *) xmalloc(sizeof(COLOURENTRY) * map.ncolours);
1307
1308 DEBUG(("PALETTE(c=%d)\n", map.ncolours));
1309
1310 for (i = 0; i < map.ncolours; i++)
1311 {
1312 entry = &map.colours[i];
1313 in_uint8(s, entry->red);
1314 in_uint8(s, entry->green);
1315 in_uint8(s, entry->blue);
1316 }
1317
1318 hmap = ui_create_colourmap(&map);
1319 ui_set_colourmap(hmap);
1320
1321 xfree(map.colours);
1322}
void ui_set_colourmap(RD_HCOLOURMAP map)
Definition: qtewin.cpp:1527
RD_HCOLOURMAP ui_create_colourmap(COLOURMAP *colours)
Definition: uimain.c:336
Definition: _map.h:48
uint32_t entry
Definition: isohybrid.c:63

Referenced by process_update_pdu(), and rdp5_process().

◆ process_system_pointer_pdu()

void process_system_pointer_pdu ( STREAM  s)

Definition at line 1166 of file rdp.c.

1167{
1168 uint16 system_pointer_type;
1169
1170 in_uint16_le(s, system_pointer_type);
1171 switch (system_pointer_type)
1172 {
1173 case RDP_NULL_POINTER:
1175 break;
1176
1177 default:
1178 unimpl("System pointer message 0x%x\n", system_pointer_type);
1179 }
1180}
@ RDP_NULL_POINTER
Definition: constants.h:225
void ui_set_null_cursor(void)
Definition: uimain.c:227

Referenced by process_pointer_pdu().

◆ pstcache_enumerate()

int pstcache_enumerate ( uint8  id,
HASH_KEY keylist 
)

Definition at line 107 of file pstcache.c.

108{
109 int fd, n;
110 uint16 idx;
111 sint16 mru_idx[0xa00];
112 uint32 mru_stamp[0xa00];
113 CELLHEADER cellhdr;
114
116 return 0;
117
118 /* The server disconnects if the bitmap cache content is sent more than once */
120 return 0;
121
122 DEBUG_RDP5(("Persistent bitmap cache enumeration... "));
123 for (idx = 0; idx < BMPCACHE2_NUM_PSTCELLS; idx++)
124 {
127 if (rd_read_file(fd, &cellhdr, sizeof(CELLHEADER)) <= 0)
128 break;
129
130 if (memcmp(cellhdr.key, zero_key, sizeof(HASH_KEY)) != 0)
131 {
132 memcpy(keylist[idx], cellhdr.key, sizeof(HASH_KEY));
133
134 /* Pre-cache (not possible for 8 bit colour depth cause it needs a colourmap) */
135 if (g_bitmap_cache_precache && cellhdr.stamp && g_server_depth > 8)
137
138 /* Sort by stamp */
139 for (n = idx; n > 0 && cellhdr.stamp < mru_stamp[n - 1]; n--)
140 {
141 mru_idx[n] = mru_idx[n - 1];
142 mru_stamp[n] = mru_stamp[n - 1];
143 }
144
145 mru_idx[n] = idx;
146 mru_stamp[n] = cellhdr.stamp;
147 }
148 else
149 {
150 break;
151 }
152 }
153
154 DEBUG_RDP5(("%d cached bitmaps.\n", idx));
155
158 return idx;
159}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
void cache_rebuild_bmpcache_linked_list(uint8 id, sint16 *idx, int count)
Definition: cache.c:58
#define BMPCACHE2_NUM_PSTCELLS
Definition: constants.h:285
int rd_read_file(int fd, void *ptr, int len)
Definition: uimain.c:854
int rd_lseek_file(int fd, int offset)
Definition: uimain.c:868
int g_server_depth
Definition: uimain.c:41
RD_BOOL g_bitmap_cache_precache
Definition: uimain.c:38
int g_pstcache_Bpp
Definition: pstcache.c:32
RD_BOOL pstcache_load_bitmap(uint8 cache_id, uint16 cache_idx)
Definition: pstcache.c:53
uint8 zero_key[]
Definition: pstcache.c:34
RD_BOOL g_pstcache_enumerated
Definition: pstcache.c:33
int g_pstcache_fd[8]
Definition: pstcache.c:31
RD_BOOL g_bitmap_cache_persist_enable
Definition: uimain.c:37
#define IS_PERSISTENT(id)
Definition: pstcache.c:24
RD_BOOL g_bitmap_cache
Definition: uimain.c:39
#define MAX_CELL_SIZE
Definition: pstcache.c:22
uint8 HASH_KEY[8]
Definition: types.h:161
HASH_KEY key
Definition: types.h:166
Definition: path.c:35

Referenced by rdp_enum_bmpcache2().

◆ pstcache_init()

RD_BOOL pstcache_init ( uint8  cache_id)

Definition at line 163 of file pstcache.c.

164{
165 int fd;
166 char filename[256];
167
169 return True;
170
171 g_pstcache_fd[cache_id] = 0;
172
174 return False;
175
176 if (!rd_pstcache_mkdir())
177 {
178 DEBUG(("failed to get/make cache directory!\n"));
179 return False;
180 }
181
182 g_pstcache_Bpp = (g_server_depth + 7) / 8;
183 sprintf(filename, "cache/pstcache_%d_%d", cache_id, g_pstcache_Bpp);
184 DEBUG(("persistent bitmap cache file: %s\n", filename));
185
187 if (fd == -1)
188 return False;
189
190 if (!rd_lock_file(fd, 0, 0))
191 {
192 warning("Persistent bitmap caching is disabled. (The file is already in use)\n");
194 return False;
195 }
196
197 g_pstcache_fd[cache_id] = fd;
198 return True;
199}
void rd_close_file(int fd)
Definition: uimain.c:847
RD_BOOL rd_lock_file(int fd, int start, int len)
Definition: uimain.c:875
RD_BOOL rd_pstcache_mkdir(void)
Definition: uimain.c:833
int rd_open_file(char *filename)
Definition: uimain.c:840

Referenced by rdp_out_bmpcache2_caps().

◆ pstcache_load_bitmap()

RD_BOOL pstcache_load_bitmap ( uint8  cache_id,
uint16  cache_idx 
)

Definition at line 53 of file pstcache.c.

54{
55 uint8 *celldata;
56 int fd;
57 CELLHEADER cellhdr;
59
61 return False;
62
63 if (!IS_PERSISTENT(cache_id) || cache_idx >= BMPCACHE2_NUM_PSTCELLS)
64 return False;
65
66 fd = g_pstcache_fd[cache_id];
67 rd_lseek_file(fd, cache_idx * (g_pstcache_Bpp * MAX_CELL_SIZE + sizeof(CELLHEADER)));
68 rd_read_file(fd, &cellhdr, sizeof(CELLHEADER));
69 celldata = (uint8 *) xmalloc(cellhdr.length);
70 rd_read_file(fd, celldata, cellhdr.length);
71
72 bitmap = ui_create_bitmap(cellhdr.width, cellhdr.height, celldata);
73 DEBUG(("Load bitmap from disk: id=%d, idx=%d, bmp=%p)\n", cache_id, cache_idx, bitmap));
74 cache_put_bitmap(cache_id, cache_idx, bitmap);
75
76 xfree(celldata);
77 return True;
78}
void cache_put_bitmap(uint8 id, uint16 idx, RD_HBITMAP bitmap)
Definition: cache.c:218
RD_HBITMAP ui_create_bitmap(int width, int height, uint8 *data)
Definition: uimain.c:277

Referenced by cache_get_bitmap(), and pstcache_enumerate().

◆ pstcache_save_bitmap()

RD_BOOL pstcache_save_bitmap ( uint8  cache_id,
uint16  cache_idx,
uint8 key,
uint8  width,
uint8  height,
uint16  length,
uint8 data 
)

Definition at line 82 of file pstcache.c.

84{
85 int fd;
86 CELLHEADER cellhdr;
87
88 if (!IS_PERSISTENT(cache_id) || cache_idx >= BMPCACHE2_NUM_PSTCELLS)
89 return False;
90
91 memcpy(cellhdr.key, key, sizeof(HASH_KEY));
92 cellhdr.width = width;
93 cellhdr.height = height;
94 cellhdr.length = length;
95 cellhdr.stamp = 0;
96
97 fd = g_pstcache_fd[cache_id];
98 rd_lseek_file(fd, cache_idx * (g_pstcache_Bpp * MAX_CELL_SIZE + sizeof(CELLHEADER)));
99 rd_write_file(fd, &cellhdr, sizeof(CELLHEADER));
101
102 return True;
103}
int rd_write_file(int fd, void *ptr, int len)
Definition: uimain.c:861
Definition: copy.c:22

Referenced by process_bmpcache2().

◆ pstcache_touch_bitmap()

void pstcache_touch_bitmap ( uint8  cache_id,
uint16  cache_idx,
uint32  stamp 
)

Definition at line 39 of file pstcache.c.

40{
41 int fd;
42
43 if (!IS_PERSISTENT(cache_id) || cache_idx >= BMPCACHE2_NUM_PSTCELLS)
44 return;
45
46 fd = g_pstcache_fd[cache_id];
47 rd_lseek_file(fd, 12 + cache_idx * (g_pstcache_Bpp * MAX_CELL_SIZE + sizeof(CELLHEADER)));
48 rd_write_file(fd, &stamp, sizeof(stamp));
49}

Referenced by cache_evict_bitmap(), and cache_save_state().

◆ rd_close_file()

void rd_close_file ( int  fd)

Definition at line 847 of file uimain.c.

848{
849 return;
850}

Referenced by pstcache_init().

◆ rd_create_ui()

void rd_create_ui ( void  )

◆ rd_lock_file()

RD_BOOL rd_lock_file ( int  fd,
int  start,
int  len 
)

Definition at line 875 of file uimain.c.

876{
877 return False;
878}

Referenced by pstcache_init().

◆ rd_lseek_file()

int rd_lseek_file ( int  fd,
int  offset 
)

Definition at line 868 of file uimain.c.

869{
870 return 0;
871}

Referenced by pstcache_enumerate(), pstcache_load_bitmap(), pstcache_save_bitmap(), and pstcache_touch_bitmap().

◆ rd_open_file()

int rd_open_file ( char filename)

Definition at line 840 of file uimain.c.

841{
842 return 0;
843}

Referenced by pstcache_init().

◆ rd_pstcache_mkdir()

RD_BOOL rd_pstcache_mkdir ( void  )

Definition at line 833 of file uimain.c.

834{
835 return 0;
836}

Referenced by pstcache_init().

◆ rd_read_file()

int rd_read_file ( int  fd,
void ptr,
int  len 
)

Definition at line 854 of file uimain.c.

855{
856 return 0;
857}

Referenced by pstcache_enumerate(), and pstcache_load_bitmap().

◆ rd_write_file()

int rd_write_file ( int  fd,
void ptr,
int  len 
)

Definition at line 861 of file uimain.c.

862{
863 return 0;
864}

Referenced by pstcache_save_bitmap(), and pstcache_touch_bitmap().

◆ rdp5_process()

void rdp5_process ( STREAM  s)

Definition at line 28 of file rdp5.c.

29{
32 uint8 *next;
33
34 uint32 roff, rlen;
35 struct stream *ns = &(g_mppc_dict.ns);
36 struct stream *ts;
37
38#if 0
39 printf("RDP5 data:\n");
40 hexdump(s->p, s->end - s->p);
41#endif
42
44 while (s->p < s->end)
45 {
46 in_uint8(s, type);
48 {
52 }
53 else
54 {
55 ctype = 0;
57 }
58 g_next_packet = next = s->p + length;
59
61 {
62 if (mppc_expand(s->p, length, ctype, &roff, &rlen) == -1)
63 error("error while decompressing packet\n");
64
65 /* allocate memory and copy the uncompressed data into the temporary stream */
66 ns->data = (uint8 *) xrealloc(ns->data, rlen);
67
68 memcpy((ns->data), (unsigned char *) (g_mppc_dict.hist + roff), rlen);
69
70 ns->size = rlen;
71 ns->end = (ns->data + ns->size);
72 ns->p = ns->data;
73 ns->rdp_hdr = ns->p;
74
75 ts = ns;
76 }
77 else
78 ts = s;
79
80 switch (type)
81 {
82 case 0: /* update orders */
85 break;
86 case 1: /* update bitmap */
87 in_uint8s(ts, 2); /* part length */
89 break;
90 case 2: /* update palette */
91 in_uint8s(ts, 2); /* uint16 = 2 */
93 break;
94 case 3: /* update synchronize */
95 break;
96 case 5: /* null pointer */
98 break;
99 case 6: /* default pointer */
100 break;
101 case 8: /* pointer position */
102 in_uint16_le(ts, x);
103 in_uint16_le(ts, y);
104 if (s_check(ts))
106 break;
107 case 9: /* color pointer */
109 break;
110 case 10: /* cached pointer */
112 break;
113 case 11:
115 break;
116 default:
117 unimpl("RDP5 opcode %d\n", type);
118 }
119
120 s->p = next;
121 }
123}
#define RDP5_COMPRESSED
Definition: constants.h:360
int mppc_expand(uint8 *data, uint32 clen, uint8 ctype, uint32 *roff, uint32 *rlen)
Definition: mppc.c:58
void process_orders(STREAM s, uint16 num_orders)
Definition: orders.c:1311
void process_bitmap_updates(STREAM s)
Definition: rdp.c:1224
void process_cached_pointer_pdu(STREAM s)
Definition: rdp.c:1156
void process_palette(STREAM s)
Definition: rdp.c:1295
void hexdump(unsigned char *p, unsigned int len)
Definition: shimdbg.c:234
void process_colour_pointer_pdu(STREAM s)
Definition: rdp.c:1139
void ui_begin_update(void)
Definition: uimain.c:657
void ui_move_pointer(int x, int y)
Definition: uimain.c:616
void ui_end_update(void)
Definition: uimain.c:664
void process_new_pointer_pdu(STREAM s)
Definition: rdp.c:1146
uint8 * g_next_packet
Definition: rdp.c:45
RDPCOMP g_mppc_dict
Definition: mppc.c:55
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
static unsigned __int64 next
Definition: rand_nt.c:6
struct stream ns
Definition: types.h:192
Definition: mxnamespace.c:45

Referenced by rdp_recv().

◆ rdp_connect()

RD_BOOL rdp_connect ( char server,
uint32  flags,
char domain,
char password,
char command,
char directory,
RD_BOOL  reconnect 
)

Definition at line 1742 of file rdp.c.

1744{
1747
1748 if (!sec_connect(server, g_username, domain, password, reconnect))
1749 return False;
1750
1752
1753 /* run RDP loop until first licence demand active PDU */
1754 while (!g_rdp_shareid)
1755 {
1756 if (g_network_error)
1757 return False;
1758
1760 return False;
1761
1762 if (g_redirect)
1763 return True;
1764 }
1765 return True;
1766}
RD_BOOL sec_connect(char *server, char *username, char *domain, char *password, RD_BOOL reconnect)
Definition: secure.c:1005
static void rdp_send_logon_info(uint32 flags, char *domain, char *user, char *password, char *program, char *directory)
Definition: rdp.c:343
RD_BOOL g_redirect
Definition: uimain.c:55
RD_BOOL g_network_error
Definition: uimain.c:77
RD_BOOL rdp_loop(RD_BOOL *deactivated, uint32 *ext_disc_reason)
Definition: rdp.c:1695
uint32 g_rdp_shareid
Definition: rdp.c:46