remove uirdesktop
This commit is contained in:
parent
c20adcd743
commit
49dac1e014
@ -1,368 +0,0 @@
|
||||
/*
|
||||
rdesktop: A Remote Desktop Protocol client.
|
||||
RDP order processing
|
||||
Copyright (C) Matthew Chapman 1999-2005
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#define RDP_ORDER_STANDARD 0x01
|
||||
#define RDP_ORDER_SECONDARY 0x02
|
||||
#define RDP_ORDER_BOUNDS 0x04
|
||||
#define RDP_ORDER_CHANGE 0x08
|
||||
#define RDP_ORDER_DELTA 0x10
|
||||
#define RDP_ORDER_LASTBOUNDS 0x20
|
||||
#define RDP_ORDER_SMALL 0x40
|
||||
#define RDP_ORDER_TINY 0x80
|
||||
|
||||
enum RDP_ORDER_TYPE
|
||||
{
|
||||
RDP_ORDER_DESTBLT = 0,
|
||||
RDP_ORDER_PATBLT = 1,
|
||||
RDP_ORDER_SCREENBLT = 2,
|
||||
RDP_ORDER_LINE = 9,
|
||||
RDP_ORDER_RECT = 10,
|
||||
RDP_ORDER_DESKSAVE = 11,
|
||||
RDP_ORDER_MEMBLT = 13,
|
||||
RDP_ORDER_TRIBLT = 14,
|
||||
RDP_ORDER_POLYGON = 20,
|
||||
RDP_ORDER_POLYGON2 = 21,
|
||||
RDP_ORDER_POLYLINE = 22,
|
||||
RDP_ORDER_ELLIPSE = 25,
|
||||
RDP_ORDER_ELLIPSE2 = 26,
|
||||
RDP_ORDER_TEXT2 = 27
|
||||
};
|
||||
|
||||
enum RDP_SECONDARY_ORDER_TYPE
|
||||
{
|
||||
RDP_ORDER_RAW_BMPCACHE = 0,
|
||||
RDP_ORDER_COLCACHE = 1,
|
||||
RDP_ORDER_BMPCACHE = 2,
|
||||
RDP_ORDER_FONTCACHE = 3,
|
||||
RDP_ORDER_RAW_BMPCACHE2 = 4,
|
||||
RDP_ORDER_BMPCACHE2 = 5,
|
||||
RDP_ORDER_BRUSHCACHE = 7
|
||||
};
|
||||
|
||||
typedef struct _DESTBLT_ORDER
|
||||
{
|
||||
sint16 x;
|
||||
sint16 y;
|
||||
sint16 cx;
|
||||
sint16 cy;
|
||||
uint8 opcode;
|
||||
|
||||
}
|
||||
DESTBLT_ORDER;
|
||||
|
||||
typedef struct _PATBLT_ORDER
|
||||
{
|
||||
sint16 x;
|
||||
sint16 y;
|
||||
sint16 cx;
|
||||
sint16 cy;
|
||||
uint8 opcode;
|
||||
uint32 bgcolour;
|
||||
uint32 fgcolour;
|
||||
BRUSH brush;
|
||||
|
||||
}
|
||||
PATBLT_ORDER;
|
||||
|
||||
typedef struct _SCREENBLT_ORDER
|
||||
{
|
||||
sint16 x;
|
||||
sint16 y;
|
||||
sint16 cx;
|
||||
sint16 cy;
|
||||
uint8 opcode;
|
||||
sint16 srcx;
|
||||
sint16 srcy;
|
||||
|
||||
}
|
||||
SCREENBLT_ORDER;
|
||||
|
||||
typedef struct _LINE_ORDER
|
||||
{
|
||||
uint16 mixmode;
|
||||
sint16 startx;
|
||||
sint16 starty;
|
||||
sint16 endx;
|
||||
sint16 endy;
|
||||
uint32 bgcolour;
|
||||
uint8 opcode;
|
||||
PEN pen;
|
||||
|
||||
}
|
||||
LINE_ORDER;
|
||||
|
||||
typedef struct _RECT_ORDER
|
||||
{
|
||||
sint16 x;
|
||||
sint16 y;
|
||||
sint16 cx;
|
||||
sint16 cy;
|
||||
uint32 colour;
|
||||
|
||||
}
|
||||
RECT_ORDER;
|
||||
|
||||
typedef struct _DESKSAVE_ORDER
|
||||
{
|
||||
uint32 offset;
|
||||
sint16 left;
|
||||
sint16 top;
|
||||
sint16 right;
|
||||
sint16 bottom;
|
||||
uint8 action;
|
||||
|
||||
}
|
||||
DESKSAVE_ORDER;
|
||||
|
||||
typedef struct _TRIBLT_ORDER
|
||||
{
|
||||
uint8 colour_table;
|
||||
uint8 cache_id;
|
||||
sint16 x;
|
||||
sint16 y;
|
||||
sint16 cx;
|
||||
sint16 cy;
|
||||
uint8 opcode;
|
||||
sint16 srcx;
|
||||
sint16 srcy;
|
||||
uint32 bgcolour;
|
||||
uint32 fgcolour;
|
||||
BRUSH brush;
|
||||
uint16 cache_idx;
|
||||
uint16 unknown;
|
||||
|
||||
}
|
||||
TRIBLT_ORDER;
|
||||
|
||||
typedef struct _MEMBLT_ORDER
|
||||
{
|
||||
uint8 colour_table;
|
||||
uint8 cache_id;
|
||||
sint16 x;
|
||||
sint16 y;
|
||||
sint16 cx;
|
||||
sint16 cy;
|
||||
uint8 opcode;
|
||||
sint16 srcx;
|
||||
sint16 srcy;
|
||||
uint16 cache_idx;
|
||||
|
||||
}
|
||||
MEMBLT_ORDER;
|
||||
|
||||
#define MAX_DATA 256
|
||||
|
||||
typedef struct _POLYGON_ORDER
|
||||
{
|
||||
sint16 x;
|
||||
sint16 y;
|
||||
uint8 opcode;
|
||||
uint8 fillmode;
|
||||
uint32 fgcolour;
|
||||
uint8 npoints;
|
||||
uint8 datasize;
|
||||
uint8 data[MAX_DATA];
|
||||
|
||||
}
|
||||
POLYGON_ORDER;
|
||||
|
||||
typedef struct _POLYGON2_ORDER
|
||||
{
|
||||
sint16 x;
|
||||
sint16 y;
|
||||
uint8 opcode;
|
||||
uint8 fillmode;
|
||||
uint32 bgcolour;
|
||||
uint32 fgcolour;
|
||||
BRUSH brush;
|
||||
uint8 npoints;
|
||||
uint8 datasize;
|
||||
uint8 data[MAX_DATA];
|
||||
|
||||
}
|
||||
POLYGON2_ORDER;
|
||||
|
||||
typedef struct _POLYLINE_ORDER
|
||||
{
|
||||
sint16 x;
|
||||
sint16 y;
|
||||
uint8 opcode;
|
||||
uint32 fgcolour;
|
||||
uint8 lines;
|
||||
uint8 datasize;
|
||||
uint8 data[MAX_DATA];
|
||||
|
||||
}
|
||||
POLYLINE_ORDER;
|
||||
|
||||
typedef struct _ELLIPSE_ORDER
|
||||
{
|
||||
sint16 left;
|
||||
sint16 top;
|
||||
sint16 right;
|
||||
sint16 bottom;
|
||||
uint8 opcode;
|
||||
uint8 fillmode;
|
||||
uint32 fgcolour;
|
||||
|
||||
}
|
||||
ELLIPSE_ORDER;
|
||||
|
||||
typedef struct _ELLIPSE2_ORDER
|
||||
{
|
||||
sint16 left;
|
||||
sint16 top;
|
||||
sint16 right;
|
||||
sint16 bottom;
|
||||
uint8 opcode;
|
||||
uint8 fillmode;
|
||||
BRUSH brush;
|
||||
uint32 bgcolour;
|
||||
uint32 fgcolour;
|
||||
|
||||
}
|
||||
ELLIPSE2_ORDER;
|
||||
|
||||
#define MAX_TEXT 256
|
||||
|
||||
typedef struct _TEXT2_ORDER
|
||||
{
|
||||
uint8 font;
|
||||
uint8 flags;
|
||||
uint8 opcode;
|
||||
uint8 mixmode;
|
||||
uint32 bgcolour;
|
||||
uint32 fgcolour;
|
||||
sint16 clipleft;
|
||||
sint16 cliptop;
|
||||
sint16 clipright;
|
||||
sint16 clipbottom;
|
||||
sint16 boxleft;
|
||||
sint16 boxtop;
|
||||
sint16 boxright;
|
||||
sint16 boxbottom;
|
||||
BRUSH brush;
|
||||
sint16 x;
|
||||
sint16 y;
|
||||
uint8 length;
|
||||
uint8 text[MAX_TEXT];
|
||||
|
||||
}
|
||||
TEXT2_ORDER;
|
||||
|
||||
typedef struct _RDP_ORDER_STATE
|
||||
{
|
||||
uint8 order_type;
|
||||
BOUNDS bounds;
|
||||
|
||||
DESTBLT_ORDER destblt;
|
||||
PATBLT_ORDER patblt;
|
||||
SCREENBLT_ORDER screenblt;
|
||||
LINE_ORDER line;
|
||||
RECT_ORDER rect;
|
||||
DESKSAVE_ORDER desksave;
|
||||
MEMBLT_ORDER memblt;
|
||||
TRIBLT_ORDER triblt;
|
||||
POLYGON_ORDER polygon;
|
||||
POLYGON2_ORDER polygon2;
|
||||
POLYLINE_ORDER polyline;
|
||||
ELLIPSE_ORDER ellipse;
|
||||
ELLIPSE2_ORDER ellipse2;
|
||||
TEXT2_ORDER text2;
|
||||
|
||||
}
|
||||
RDP_ORDER_STATE;
|
||||
|
||||
typedef struct _RDP_RAW_BMPCACHE_ORDER
|
||||
{
|
||||
uint8 cache_id;
|
||||
uint8 pad1;
|
||||
uint8 width;
|
||||
uint8 height;
|
||||
uint8 bpp;
|
||||
uint16 bufsize;
|
||||
uint16 cache_idx;
|
||||
uint8 *data;
|
||||
|
||||
}
|
||||
RDP_RAW_BMPCACHE_ORDER;
|
||||
|
||||
typedef struct _RDP_BMPCACHE_ORDER
|
||||
{
|
||||
uint8 cache_id;
|
||||
uint8 pad1;
|
||||
uint8 width;
|
||||
uint8 height;
|
||||
uint8 bpp;
|
||||
uint16 bufsize;
|
||||
uint16 cache_idx;
|
||||
uint16 pad2;
|
||||
uint16 size;
|
||||
uint16 row_size;
|
||||
uint16 final_size;
|
||||
uint8 *data;
|
||||
|
||||
}
|
||||
RDP_BMPCACHE_ORDER;
|
||||
|
||||
/* RDP_BMPCACHE2_ORDER */
|
||||
#define ID_MASK 0x0007
|
||||
#define MODE_MASK 0x0038
|
||||
#define SQUARE 0x0080
|
||||
#define PERSIST 0x0100
|
||||
#define FLAG_51_UNKNOWN 0x0800
|
||||
|
||||
#define MODE_SHIFT 3
|
||||
|
||||
#define LONG_FORMAT 0x80
|
||||
#define BUFSIZE_MASK 0x3FFF /* or 0x1FFF? */
|
||||
|
||||
#define MAX_GLYPH 32
|
||||
|
||||
typedef struct _RDP_FONT_GLYPH
|
||||
{
|
||||
uint16 character;
|
||||
uint16 unknown;
|
||||
uint16 baseline;
|
||||
uint16 width;
|
||||
uint16 height;
|
||||
uint8 data[MAX_GLYPH];
|
||||
|
||||
}
|
||||
RDP_FONT_GLYPH;
|
||||
|
||||
#define MAX_GLYPHS 256
|
||||
|
||||
typedef struct _RDP_FONTCACHE_ORDER
|
||||
{
|
||||
uint8 font;
|
||||
uint8 nglyphs;
|
||||
RDP_FONT_GLYPH glyphs[MAX_GLYPHS];
|
||||
|
||||
}
|
||||
RDP_FONTCACHE_ORDER;
|
||||
|
||||
typedef struct _RDP_COLCACHE_ORDER
|
||||
{
|
||||
uint8 cache_id;
|
||||
COLOURMAP map;
|
||||
|
||||
}
|
||||
RDP_COLCACHE_ORDER;
|
@ -1,95 +0,0 @@
|
||||
/*
|
||||
rdesktop: A Remote Desktop Protocol client.
|
||||
Parsing primitives
|
||||
Copyright (C) Matthew Chapman 1999-2005
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* Parser state */
|
||||
typedef struct stream
|
||||
{
|
||||
unsigned char *p;
|
||||
unsigned char *end;
|
||||
unsigned char *data;
|
||||
unsigned int size;
|
||||
|
||||
/* Offsets of various headers */
|
||||
unsigned char *iso_hdr;
|
||||
unsigned char *mcs_hdr;
|
||||
unsigned char *sec_hdr;
|
||||
unsigned char *rdp_hdr;
|
||||
unsigned char *channel_hdr;
|
||||
|
||||
}
|
||||
*STREAM;
|
||||
|
||||
#define s_push_layer(s,h,n) { (s)->h = (s)->p; (s)->p += n; }
|
||||
#define s_pop_layer(s,h) (s)->p = (s)->h;
|
||||
#define s_mark_end(s) (s)->end = (s)->p;
|
||||
#define s_check(s) ((s)->p <= (s)->end)
|
||||
#define s_check_rem(s,n) ((s)->p + n <= (s)->end)
|
||||
#define s_check_end(s) ((s)->p == (s)->end)
|
||||
|
||||
#if defined(L_ENDIAN) && !defined(NEED_ALIGN)
|
||||
#define in_uint16_le(s,v) { v = *(uint16 *)((s)->p); (s)->p += 2; }
|
||||
#define in_uint32_le(s,v) { v = *(uint32 *)((s)->p); (s)->p += 4; }
|
||||
#define out_uint16_le(s,v) { *(uint16 *)((s)->p) = v; (s)->p += 2; }
|
||||
#define out_uint32_le(s,v) { *(uint32 *)((s)->p) = v; (s)->p += 4; }
|
||||
|
||||
#else
|
||||
#define in_uint16_le(s,v) { v = *((s)->p++); v += *((s)->p++) << 8; }
|
||||
#define in_uint32_le(s,v) { in_uint16_le(s,v) \
|
||||
v += *((s)->p++) << 16; v += *((s)->p++) << 24; }
|
||||
#define out_uint16_le(s,v) { *((s)->p++) = (v) & 0xff; *((s)->p++) = ((v) >> 8) & 0xff; }
|
||||
#define out_uint32_le(s,v) { out_uint16_le(s, (v) & 0xffff); out_uint16_le(s, ((v) >> 16) & 0xffff); }
|
||||
#endif
|
||||
|
||||
#if defined(B_ENDIAN) && !defined(NEED_ALIGN)
|
||||
#define in_uint16_be(s,v) { v = *(uint16 *)((s)->p); (s)->p += 2; }
|
||||
#define in_uint32_be(s,v) { v = *(uint32 *)((s)->p); (s)->p += 4; }
|
||||
#define out_uint16_be(s,v) { *(uint16 *)((s)->p) = v; (s)->p += 2; }
|
||||
#define out_uint32_be(s,v) { *(uint32 *)((s)->p) = v; (s)->p += 4; }
|
||||
|
||||
#define B_ENDIAN_PREFERRED
|
||||
#define in_uint16(s,v) in_uint16_be(s,v)
|
||||
#define in_uint32(s,v) in_uint32_be(s,v)
|
||||
#define out_uint16(s,v) out_uint16_be(s,v)
|
||||
#define out_uint32(s,v) out_uint32_be(s,v)
|
||||
|
||||
#else
|
||||
#define in_uint16_be(s,v) { v = *((s)->p++); next_be(s,v); }
|
||||
#define in_uint32_be(s,v) { in_uint16_be(s,v); next_be(s,v); next_be(s,v); }
|
||||
#define out_uint16_be(s,v) { *((s)->p++) = ((v) >> 8) & 0xff; *((s)->p++) = (v) & 0xff; }
|
||||
#define out_uint32_be(s,v) { out_uint16_be(s, ((v) >> 16) & 0xffff); out_uint16_be(s, (v) & 0xffff); }
|
||||
#endif
|
||||
|
||||
#ifndef B_ENDIAN_PREFERRED
|
||||
#define in_uint16(s,v) in_uint16_le(s,v)
|
||||
#define in_uint32(s,v) in_uint32_le(s,v)
|
||||
#define out_uint16(s,v) out_uint16_le(s,v)
|
||||
#define out_uint32(s,v) out_uint32_le(s,v)
|
||||
#endif
|
||||
|
||||
#define in_uint8(s,v) v = *((s)->p++);
|
||||
#define in_uint8p(s,v,n) { v = (s)->p; (s)->p += n; }
|
||||
#define in_uint8a(s,v,n) { memcpy(v,(s)->p,n); (s)->p += n; }
|
||||
#define in_uint8s(s,n) (s)->p += n;
|
||||
#define out_uint8(s,v) *((s)->p++) = v;
|
||||
#define out_uint8p(s,v,n) { memcpy((s)->p,v,n); (s)->p += n; }
|
||||
#define out_uint8a(s,v,n) out_uint8p(s,v,n);
|
||||
#define out_uint8s(s,n) { memset((s)->p,0,n); (s)->p += n; }
|
||||
|
||||
#define next_be(s,v) v = ((v) << 8) + *((s)->p++);
|
@ -1,316 +0,0 @@
|
||||
/* -*- c-basic-offset: 8 -*-
|
||||
rdesktop: A Remote Desktop Protocol client.
|
||||
Copyright (C) Matthew Chapman 1999-2005
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef RDESKTOP_PROTO_H
|
||||
#define RDESKTOP_PROTO_H
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/* *INDENT-ON* */
|
||||
/* bitmap.c */
|
||||
BOOL bitmap_decompress(uint8 * output, int width, int height, uint8 * input, int size, int Bpp);
|
||||
BOOL bitmap_decompress_ex(uint8 * output, int width, int height, uint8 * input, int size,
|
||||
int in_bpp, int out_bpp);
|
||||
/* cache.c */
|
||||
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);
|
||||
FONTGLYPH *cache_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);
|
||||
DATABLOB *cache_get_text(uint8 cache_id);
|
||||
void cache_put_text(uint8 cache_id, void *data, int length);
|
||||
uint8 *cache_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);
|
||||
/* channels.c */
|
||||
VCHANNEL *channel_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);
|
||||
/* cliprdr.c */
|
||||
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);
|
||||
BOOL cliprdr_init(void);
|
||||
/* disk.c */
|
||||
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);
|
||||
/* mppc.c */
|
||||
int mppc_expand(uint8 * data, uint32 clen, uint8 ctype, uint32 * roff, uint32 * rlen);
|
||||
/* ewmhints.c */
|
||||
int get_current_workarea(uint32 * x, uint32 * y, uint32 * width, uint32 * height);
|
||||
void ewmh_init(void);
|
||||
/* iso.c */
|
||||
STREAM iso_init(int length);
|
||||
void iso_send(STREAM s);
|
||||
STREAM iso_recv(uint8 * rdpver);
|
||||
BOOL iso_connect(char *server, char *username);
|
||||
BOOL iso_reconnect(char *server);
|
||||
void iso_disconnect(void);
|
||||
void iso_reset_state(void);
|
||||
/* licence.c */
|
||||
void licence_process(STREAM s);
|
||||
/* mcs.c */
|
||||
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);
|
||||
BOOL mcs_connect(char *server, STREAM mcs_data, char *username);
|
||||
BOOL mcs_reconnect(char *server, STREAM mcs_data);
|
||||
void mcs_disconnect(void);
|
||||
void mcs_reset_state(void);
|
||||
/* orders.c */
|
||||
void process_orders(STREAM s, uint16 num_orders);
|
||||
void reset_order_state(void);
|
||||
/* parallel.c */
|
||||
int parallel_enum_devices(uint32 * id, char *optarg);
|
||||
/* printer.c */
|
||||
int printer_enum_devices(uint32 * id, char *optarg);
|
||||
/* printercache.c */
|
||||
int printercache_load_blob(char *printer_name, uint8 ** data);
|
||||
void printercache_process(STREAM s);
|
||||
/* pstcache.c */
|
||||
void pstcache_touch_bitmap(uint8 cache_id, uint16 cache_idx, uint32 stamp);
|
||||
BOOL pstcache_load_bitmap(uint8 cache_id, uint16 cache_idx);
|
||||
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);
|
||||
BOOL pstcache_init(uint8 cache_id);
|
||||
/* rdesktop.c */
|
||||
int main(int argc, char *argv[]);
|
||||
void generate_random(uint8 * random);
|
||||
void *xmalloc(int size);
|
||||
char *xstrdup(const char *s);
|
||||
void *xrealloc(void *oldmem, int 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);
|
||||
char *next_arg(char *src, char needle);
|
||||
void toupper_str(char *p);
|
||||
BOOL str_startswith(const char *s, const char *prefix);
|
||||
BOOL str_handle_lines(const char *input, char **rest, str_handle_lines_t linehandler, void *data);
|
||||
BOOL subprocess(char *const argv[], str_handle_lines_t linehandler, void *data);
|
||||
char *l_to_a(long N, int base);
|
||||
int load_licence(unsigned char **data);
|
||||
void save_licence(unsigned char *data, int length);
|
||||
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);
|
||||
BOOL rd_lock_file(int fd, int start, int len);
|
||||
/* rdp5.c */
|
||||
void rdp5_process(STREAM s);
|
||||
/* rdp.c */
|
||||
void rdp_out_unistr(STREAM s, char *string, int len);
|
||||
int rdp_in_unistr(STREAM s, char *string, int uni_len);
|
||||
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_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(BOOL * deactivated, uint32 * ext_disc_reason);
|
||||
BOOL rdp_loop(BOOL * deactivated, uint32 * ext_disc_reason);
|
||||
BOOL rdp_connect(char *server, uint32 flags, char *domain, char *password, char *command,
|
||||
char *directory);
|
||||
BOOL rdp_reconnect(char *server, uint32 flags, char *domain, char *password, char *command,
|
||||
char *directory, char *cookie);
|
||||
void rdp_reset_state(void);
|
||||
void rdp_disconnect(void);
|
||||
/* rdpdr.c */
|
||||
int get_device_index(RD_NTHANDLE handle);
|
||||
void convert_to_unix_filename(char *filename);
|
||||
BOOL rdpdr_init(void);
|
||||
void rdpdr_add_fds(int *n, fd_set * rfds, fd_set * wfds, struct timeval *tv, 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, BOOL timed_out);
|
||||
BOOL rdpdr_abort_io(uint32 fd, uint32 major, RD_NTSTATUS status);
|
||||
/* rdpsnd.c */
|
||||
void rdpsnd_send_completion(uint16 tick, uint8 packet_index);
|
||||
BOOL rdpsnd_init(void);
|
||||
/* rdpsnd_oss.c */
|
||||
BOOL wave_out_open(void);
|
||||
void wave_out_close(void);
|
||||
BOOL wave_out_format_supported(RD_WAVEFORMATEX * pwfx);
|
||||
BOOL wave_out_set_format(RD_WAVEFORMATEX * pwfx);
|
||||
void wave_out_volume(uint16 left, uint16 right);
|
||||
void wave_out_write(STREAM s, uint16 tick, uint8 index);
|
||||
void wave_out_play(void);
|
||||
/* secure.c */
|
||||
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);
|
||||
BOOL sec_connect(char *server, char *username);
|
||||
BOOL sec_reconnect(char *server);
|
||||
void sec_disconnect(void);
|
||||
void sec_reset_state(void);
|
||||
/* serial.c */
|
||||
int serial_enum_devices(uint32 * id, char *optarg);
|
||||
BOOL serial_get_event(RD_NTHANDLE handle, uint32 * result);
|
||||
BOOL serial_get_timeout(RD_NTHANDLE handle, uint32 length, uint32 * timeout, uint32 * itv_timeout);
|
||||
/* tcp.c */
|
||||
STREAM tcp_init(uint32 maxlen);
|
||||
void tcp_send(STREAM s);
|
||||
STREAM tcp_recv(STREAM s, uint32 length);
|
||||
BOOL tcp_connect(char *server);
|
||||
void tcp_disconnect(void);
|
||||
char *tcp_get_address(void);
|
||||
void tcp_reset_state(void);
|
||||
/* xclip.c */
|
||||
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);
|
||||
/* xkeymap.c */
|
||||
BOOL xkeymap_from_locale(const char *locale);
|
||||
FILE *xkeymap_open(const char *filename);
|
||||
void xkeymap_init(void);
|
||||
BOOL handle_special_keys(uint32 keysym, unsigned int state, uint32 ev_time, 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,
|
||||
BOOL pressed, uint8 nesting);
|
||||
uint16 xkeymap_translate_button(unsigned int button);
|
||||
char *get_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);
|
||||
/* xwin.c */
|
||||
BOOL get_key_state(unsigned int state, uint32 keysym);
|
||||
BOOL ui_init(void);
|
||||
void ui_deinit(void);
|
||||
BOOL ui_create_window(void);
|
||||
void ui_resize_window(void);
|
||||
void ui_destroy_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);
|
||||
RD_HBITMAP ui_create_bitmap_ex(int width, int height, uint8 * data, int data_size, int compressed);
|
||||
void ui_paint_bitmap(int x, int y, int cx, int cy, int width, int height, uint8 * data);
|
||||
void ui_paint_bitmap_ex(int x, int y, int cx, int cy, int width, int height, uint8 * data,
|
||||
int data_size, int compressed);
|
||||
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);
|
||||
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(BOOL hidden);
|
||||
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_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);
|
||||
void ui_logon(void);
|
||||
/* lspci.c */
|
||||
BOOL lspci_init(void);
|
||||
/* seamless.c */
|
||||
BOOL seamless_init(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);
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/* *INDENT-ON* */
|
||||
|
||||
#endif
|
@ -1,126 +0,0 @@
|
||||
/*
|
||||
rdesktop: A Remote Desktop Protocol client.
|
||||
Master include file
|
||||
Copyright (C) Matthew Chapman 1999-2005
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifdef _WIN32
|
||||
#include <winsock2.h> /* winsock2.h first */
|
||||
#include <windows.h>
|
||||
#include <time.h>
|
||||
#else /* WIN32 */
|
||||
#include <dirent.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
#include <sys/select.h>
|
||||
#else /* HAVE_SYS_SELECT_H */
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#endif /* HAVE_SYS_SELECT_H */
|
||||
#endif /* WIN32 */
|
||||
#include <limits.h> /* PATH_MAX */
|
||||
|
||||
#define VERSION "1.4.1"
|
||||
|
||||
#ifdef WITH_DEBUG
|
||||
#define DEBUG(args) printf args;
|
||||
#else
|
||||
#define DEBUG(args)
|
||||
#endif
|
||||
|
||||
#ifdef WITH_DEBUG_KBD
|
||||
#define DEBUG_KBD(args) printf args;
|
||||
#else
|
||||
#define DEBUG_KBD(args)
|
||||
#endif
|
||||
|
||||
#ifdef WITH_DEBUG_RDP5
|
||||
#define DEBUG_RDP5(args) printf args;
|
||||
#else
|
||||
#define DEBUG_RDP5(args)
|
||||
#endif
|
||||
|
||||
#ifdef WITH_DEBUG_CLIPBOARD
|
||||
#define DEBUG_CLIPBOARD(args) printf args;
|
||||
#else
|
||||
#define DEBUG_CLIPBOARD(args)
|
||||
#endif
|
||||
|
||||
#ifdef WITH_DEBUG_CHANNEL
|
||||
#define DEBUG_CHANNEL(args) printf args;
|
||||
#else
|
||||
#define DEBUG_CHANNEL(args)
|
||||
#endif
|
||||
|
||||
#define STRNCPY(dst,src,n) { strncpy(dst,src,n-1); dst[n-1] = 0; }
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(x,y) (((x) < (y)) ? (x) : (y))
|
||||
#endif
|
||||
|
||||
#ifndef MAX
|
||||
#define MAX(x,y) (((x) > (y)) ? (x) : (y))
|
||||
#endif
|
||||
|
||||
/* timeval macros */
|
||||
#ifndef timerisset
|
||||
#define timerisset(tvp)\
|
||||
((tvp)->tv_sec || (tvp)->tv_usec)
|
||||
#endif
|
||||
#ifndef timercmp
|
||||
#define timercmp(tvp, uvp, cmp)\
|
||||
((tvp)->tv_sec cmp (uvp)->tv_sec ||\
|
||||
(tvp)->tv_sec == (uvp)->tv_sec &&\
|
||||
(tvp)->tv_usec cmp (uvp)->tv_usec)
|
||||
#endif
|
||||
#ifndef timerclear
|
||||
#define timerclear(tvp)\
|
||||
((tvp)->tv_sec = (tvp)->tv_usec = 0)
|
||||
#endif
|
||||
|
||||
/* If configure does not define the endianess, try
|
||||
to find it out */
|
||||
#if !defined(L_ENDIAN) && !defined(B_ENDIAN)
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
#define L_ENDIAN
|
||||
#elif __BYTE_ORDER == __BIG_ENDIAN
|
||||
#define B_ENDIAN
|
||||
#else
|
||||
#error Unknown endianness. Edit rdesktop.h.
|
||||
#endif
|
||||
#endif /* B_ENDIAN, L_ENDIAN from configure */
|
||||
|
||||
/* No need for alignment on x86 and amd64 */
|
||||
#if !defined(NEED_ALIGN)
|
||||
#if !(defined(__x86__) || defined(__x86_64__) || \
|
||||
defined(__AMD64__) || defined(_M_IX86) || \
|
||||
defined(__i386__))
|
||||
#define NEED_ALIGN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "parse.h"
|
||||
#include "constants.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifndef MAKE_PROTO
|
||||
#include "proto.h"
|
||||
#endif
|
@ -1,121 +0,0 @@
|
||||
/* -*- c-basic-offset: 8 -*-
|
||||
rdesktop: A Remote Desktop Protocol client.
|
||||
Protocol services - RDP5 short form PDU processing
|
||||
Copyright (C) Matthew Chapman 1999-2005
|
||||
Copyright (C) Erik Forsberg 2003
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include "rdesktop.h"
|
||||
|
||||
extern uint8 *g_next_packet;
|
||||
|
||||
extern RDPCOMP g_mppc_dict;
|
||||
|
||||
void
|
||||
rdp5_process(STREAM s)
|
||||
{
|
||||
uint16 length, count, x, y;
|
||||
uint8 type, ctype;
|
||||
uint8 *next;
|
||||
|
||||
uint32 roff, rlen;
|
||||
struct stream *ns = &(g_mppc_dict.ns);
|
||||
struct stream *ts;
|
||||
|
||||
#if 0
|
||||
printf("RDP5 data:\n");
|
||||
hexdump(s->p, s->end - s->p);
|
||||
#endif
|
||||
|
||||
ui_begin_update();
|
||||
while (s->p < s->end)
|
||||
{
|
||||
in_uint8(s, type);
|
||||
if (type & RDP5_COMPRESSED)
|
||||
{
|
||||
in_uint8(s, ctype);
|
||||
in_uint16_le(s, length);
|
||||
type ^= RDP5_COMPRESSED;
|
||||
}
|
||||
else
|
||||
{
|
||||
ctype = 0;
|
||||
in_uint16_le(s, length);
|
||||
}
|
||||
g_next_packet = next = s->p + length;
|
||||
|
||||
if (ctype & RDP_MPPC_COMPRESSED)
|
||||
{
|
||||
if (mppc_expand(s->p, length, ctype, &roff, &rlen) == -1)
|
||||
error("error while decompressing packet\n");
|
||||
|
||||
/* allocate memory and copy the uncompressed data into the temporary stream */
|
||||
ns->data = (uint8 *) xrealloc(ns->data, rlen);
|
||||
|
||||
memcpy((ns->data), (unsigned char *) (g_mppc_dict.hist + roff), rlen);
|
||||
|
||||
ns->size = rlen;
|
||||
ns->end = (ns->data + ns->size);
|
||||
ns->p = ns->data;
|
||||
ns->rdp_hdr = ns->p;
|
||||
|
||||
ts = ns;
|
||||
}
|
||||
else
|
||||
ts = s;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case 0: /* update orders */
|
||||
in_uint16_le(ts, count);
|
||||
process_orders(ts, count);
|
||||
break;
|
||||
case 1: /* update bitmap */
|
||||
in_uint8s(ts, 2); /* part length */
|
||||
process_bitmap_updates(ts);
|
||||
break;
|
||||
case 2: /* update palette */
|
||||
in_uint8s(ts, 2); /* uint16 = 2 */
|
||||
process_palette(ts);
|
||||
break;
|
||||
case 3: /* update synchronize */
|
||||
break;
|
||||
case 5: /* null pointer */
|
||||
ui_set_null_cursor();
|
||||
break;
|
||||
case 6: /* default pointer */
|
||||
break;
|
||||
case 8: /* pointer position */
|
||||
in_uint16_le(ts, x);
|
||||
in_uint16_le(ts, y);
|
||||
if (s_check(ts))
|
||||
ui_move_pointer(x, y);
|
||||
break;
|
||||
case 9: /* color pointer */
|
||||
process_colour_pointer_pdu(ts);
|
||||
break;
|
||||
case 10: /* cached pointer */
|
||||
process_cached_pointer_pdu(ts);
|
||||
break;
|
||||
default:
|
||||
unimpl("RDP5 opcode %d\n", type);
|
||||
}
|
||||
|
||||
s->p = next;
|
||||
}
|
||||
ui_end_update();
|
||||
}
|
1007
uirdesktop/secure.c
1007
uirdesktop/secure.c
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
316
uirdesktop/tcp.c
316
uirdesktop/tcp.c
@ -1,316 +0,0 @@
|
||||
/* -*- c-basic-offset: 8 -*-
|
||||
rdesktop: A Remote Desktop Protocol client.
|
||||
Protocol services - TCP layer
|
||||
Copyright (C) Matthew Chapman 1999-2005
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <unistd.h> /* select read write close */
|
||||
#include <sys/socket.h> /* socket connect setsockopt */
|
||||
#include <sys/time.h> /* timeval */
|
||||
#include <netdb.h> /* gethostbyname */
|
||||
#include <netinet/in.h> /* sockaddr_in */
|
||||
#include <netinet/tcp.h> /* TCP_NODELAY */
|
||||
#include <arpa/inet.h> /* inet_addr */
|
||||
#include <errno.h> /* errno */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
#include "rdesktop.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#define socklen_t int
|
||||
#define TCP_CLOSE(_sck) closesocket(_sck)
|
||||
#define TCP_STRERROR "tcp error"
|
||||
#define TCP_SLEEP(_n) Sleep(_n)
|
||||
#define TCP_BLOCKS (WSAGetLastError() == WSAEWOULDBLOCK)
|
||||
#else /* _WIN32 */
|
||||
#define TCP_CLOSE(_sck) close(_sck)
|
||||
#define TCP_STRERROR strerror(errno)
|
||||
#define TCP_SLEEP(_n) sleep(_n)
|
||||
#define TCP_BLOCKS (errno == EWOULDBLOCK)
|
||||
#endif /* _WIN32 */
|
||||
|
||||
#ifndef INADDR_NONE
|
||||
#define INADDR_NONE ((unsigned long) -1)
|
||||
#endif
|
||||
|
||||
static int sock;
|
||||
static struct stream in;
|
||||
static struct stream out;
|
||||
int g_tcp_port_rdp = TCP_PORT_RDP;
|
||||
int g_bytes_in = 0;
|
||||
|
||||
/* Initialise TCP transport data packet */
|
||||
STREAM
|
||||
tcp_init(uint32 maxlen)
|
||||
{
|
||||
if (maxlen > out.size)
|
||||
{
|
||||
out.data = (uint8 *) xrealloc(out.data, maxlen);
|
||||
out.size = maxlen;
|
||||
}
|
||||
|
||||
out.p = out.data;
|
||||
out.end = out.data + out.size;
|
||||
return &out;
|
||||
}
|
||||
|
||||
/* Send TCP transport data packet */
|
||||
void
|
||||
tcp_send(STREAM s)
|
||||
{
|
||||
int length = s->end - s->data;
|
||||
int sent, total = 0;
|
||||
|
||||
while (total < length)
|
||||
{
|
||||
sent = send(sock, s->data + total, length - total, 0);
|
||||
if (sent <= 0)
|
||||
{
|
||||
if (sent == -1 && TCP_BLOCKS)
|
||||
{
|
||||
TCP_SLEEP(0);
|
||||
sent = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
error("send: %s\n", TCP_STRERROR);
|
||||
return;
|
||||
}
|
||||
}
|
||||
total += sent;
|
||||
}
|
||||
}
|
||||
|
||||
/* Receive a message on the TCP layer */
|
||||
STREAM
|
||||
tcp_recv(STREAM s, uint32 length)
|
||||
{
|
||||
unsigned int new_length, end_offset, p_offset;
|
||||
int rcvd = 0;
|
||||
|
||||
g_bytes_in += length;
|
||||
if (s == NULL)
|
||||
{
|
||||
/* read into "new" stream */
|
||||
if (length > in.size)
|
||||
{
|
||||
in.data = (uint8 *) xrealloc(in.data, length);
|
||||
in.size = length;
|
||||
}
|
||||
in.end = in.p = in.data;
|
||||
s = ∈
|
||||
}
|
||||
else
|
||||
{
|
||||
/* append to existing stream */
|
||||
new_length = (s->end - s->data) + length;
|
||||
if (new_length > s->size)
|
||||
{
|
||||
p_offset = s->p - s->data;
|
||||
end_offset = s->end - s->data;
|
||||
s->data = (uint8 *) xrealloc(s->data, new_length);
|
||||
s->size = new_length;
|
||||
s->p = s->data + p_offset;
|
||||
s->end = s->data + end_offset;
|
||||
}
|
||||
}
|
||||
|
||||
while (length > 0)
|
||||
{
|
||||
if (!ui_select(sock))
|
||||
/* User quit */
|
||||
return NULL;
|
||||
|
||||
rcvd = recv(sock, s->end, length, 0);
|
||||
if (rcvd < 0)
|
||||
{
|
||||
if (rcvd == -1 && TCP_BLOCKS)
|
||||
{
|
||||
TCP_SLEEP(0);
|
||||
rcvd = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
error("recv: %s\n", TCP_STRERROR);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
else if (rcvd == 0)
|
||||
{
|
||||
error("Connection closed\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
s->end += rcvd;
|
||||
length -= rcvd;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
/* Establish a connection on the TCP layer */
|
||||
BOOL
|
||||
tcp_connect(char *server)
|
||||
{
|
||||
int lvalue;
|
||||
|
||||
#ifdef IPv6
|
||||
|
||||
int n;
|
||||
struct addrinfo hints, *res, *ressave;
|
||||
char tcp_port_rdp_s[10];
|
||||
|
||||
snprintf(tcp_port_rdp_s, 10, "%d", g_tcp_port_rdp);
|
||||
|
||||
memset(&hints, 0, sizeof(struct addrinfo));
|
||||
hints.ai_family = AF_UNSPEC;
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
|
||||
if ((n = getaddrinfo(server, tcp_port_rdp_s, &hints, &res)))
|
||||
{
|
||||
error("getaddrinfo: %s\n", gai_strerror(n));
|
||||
return False;
|
||||
}
|
||||
|
||||
ressave = res;
|
||||
sock = -1;
|
||||
while (res)
|
||||
{
|
||||
sock = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
|
||||
if (!(sock < 0))
|
||||
{
|
||||
if (connect(sock, res->ai_addr, res->ai_addrlen) == 0)
|
||||
break;
|
||||
TCP_CLOSE(sock);
|
||||
sock = -1;
|
||||
}
|
||||
res = res->ai_next;
|
||||
}
|
||||
freeaddrinfo(ressave);
|
||||
|
||||
if (sock == -1)
|
||||
{
|
||||
error("%s: unable to connect\n", server);
|
||||
return False;
|
||||
}
|
||||
|
||||
#else /* no IPv6 support */
|
||||
|
||||
struct hostent *nslookup;
|
||||
struct sockaddr_in servaddr;
|
||||
|
||||
if ((nslookup = gethostbyname(server)) != NULL)
|
||||
{
|
||||
memcpy(&servaddr.sin_addr, nslookup->h_addr, sizeof(servaddr.sin_addr));
|
||||
}
|
||||
else if ((servaddr.sin_addr.s_addr = inet_addr(server)) == INADDR_NONE)
|
||||
{
|
||||
error("%s: unable to resolve host\n", server);
|
||||
return False;
|
||||
}
|
||||
|
||||
if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0)
|
||||
{
|
||||
error("socket: %s\n", TCP_STRERROR);
|
||||
return False;
|
||||
}
|
||||
|
||||
servaddr.sin_family = AF_INET;
|
||||
servaddr.sin_port = htons((uint16) g_tcp_port_rdp);
|
||||
|
||||
if (connect(sock, (struct sockaddr *) &servaddr, sizeof(struct sockaddr)) < 0)
|
||||
{
|
||||
error("connect: %s\n", TCP_STRERROR);
|
||||
TCP_CLOSE(sock);
|
||||
return False;
|
||||
}
|
||||
|
||||
#endif /* IPv6 */
|
||||
|
||||
//lvalue = 1;
|
||||
//setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (void *) &lvalue, sizeof(lvalue));
|
||||
lvalue = 8192 * 2;
|
||||
setsockopt(sock, SOL_SOCKET, SO_SNDBUF, (void *) &lvalue, sizeof(lvalue));
|
||||
lvalue = 8192 * 2;
|
||||
setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (void *) &lvalue, sizeof(lvalue));
|
||||
|
||||
in.size = 8192 * 2;
|
||||
in.data = (uint8 *) xmalloc(in.size);
|
||||
|
||||
out.size = 8192 * 2;
|
||||
out.data = (uint8 *) xmalloc(out.size);
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
/* Disconnect on the TCP layer */
|
||||
void
|
||||
tcp_disconnect(void)
|
||||
{
|
||||
TCP_CLOSE(sock);
|
||||
}
|
||||
|
||||
char *
|
||||
tcp_get_address()
|
||||
{
|
||||
static char ipaddr[32];
|
||||
struct sockaddr_in sockaddr;
|
||||
socklen_t len = sizeof(sockaddr);
|
||||
if (getsockname(sock, (struct sockaddr *) &sockaddr, &len) == 0)
|
||||
{
|
||||
unsigned char *ip = (unsigned char *) &sockaddr.sin_addr;
|
||||
sprintf(ipaddr, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
|
||||
}
|
||||
else
|
||||
strcpy(ipaddr, "127.0.0.1");
|
||||
return ipaddr;
|
||||
}
|
||||
|
||||
/* reset the state of the tcp layer */
|
||||
/* Support for Session Directory */
|
||||
void
|
||||
tcp_reset_state(void)
|
||||
{
|
||||
sock = -1; /* reset socket */
|
||||
|
||||
/* Clear the incoming stream */
|
||||
if (in.data != NULL)
|
||||
xfree(in.data);
|
||||
in.p = NULL;
|
||||
in.end = NULL;
|
||||
in.data = NULL;
|
||||
in.size = 0;
|
||||
in.iso_hdr = NULL;
|
||||
in.mcs_hdr = NULL;
|
||||
in.sec_hdr = NULL;
|
||||
in.rdp_hdr = NULL;
|
||||
in.channel_hdr = NULL;
|
||||
|
||||
/* Clear the outgoing stream */
|
||||
if (out.data != NULL)
|
||||
xfree(out.data);
|
||||
out.p = NULL;
|
||||
out.end = NULL;
|
||||
out.data = NULL;
|
||||
out.size = 0;
|
||||
out.iso_hdr = NULL;
|
||||
out.mcs_hdr = NULL;
|
||||
out.sec_hdr = NULL;
|
||||
out.rdp_hdr = NULL;
|
||||
out.channel_hdr = NULL;
|
||||
}
|
@ -1,270 +0,0 @@
|
||||
/*
|
||||
rdesktop: A Remote Desktop Protocol client.
|
||||
Common data types
|
||||
Copyright (C) Matthew Chapman 1999-2005
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
typedef int BOOL;
|
||||
|
||||
#ifndef True
|
||||
#define True (1)
|
||||
#define False (0)
|
||||
#endif
|
||||
|
||||
typedef unsigned char uint8;
|
||||
typedef signed char sint8;
|
||||
typedef unsigned short uint16;
|
||||
typedef signed short sint16;
|
||||
typedef unsigned int uint32;
|
||||
typedef signed int sint32;
|
||||
|
||||
typedef void *RD_HBITMAP;
|
||||
typedef void *RD_HGLYPH;
|
||||
typedef void *RD_HCOLOURMAP;
|
||||
typedef void *RD_HCURSOR;
|
||||
|
||||
typedef struct _RD_POINT
|
||||
{
|
||||
sint16 x, y;
|
||||
}
|
||||
RD_POINT;
|
||||
|
||||
typedef struct _COLOURENTRY
|
||||
{
|
||||
uint8 red;
|
||||
uint8 green;
|
||||
uint8 blue;
|
||||
|
||||
}
|
||||
COLOURENTRY;
|
||||
|
||||
typedef struct _COLOURMAP
|
||||
{
|
||||
uint16 ncolours;
|
||||
COLOURENTRY *colours;
|
||||
|
||||
}
|
||||
COLOURMAP;
|
||||
|
||||
typedef struct _BOUNDS
|
||||
{
|
||||
sint16 left;
|
||||
sint16 top;
|
||||
sint16 right;
|
||||
sint16 bottom;
|
||||
|
||||
}
|
||||
BOUNDS;
|
||||
|
||||
typedef struct _PEN
|
||||
{
|
||||
uint8 style;
|
||||
uint8 width;
|
||||
uint32 colour;
|
||||
|
||||
}
|
||||
PEN;
|
||||
|
||||
typedef struct _BRUSH
|
||||
{
|
||||
uint8 xorigin;
|
||||
uint8 yorigin;
|
||||
uint8 style;
|
||||
uint8 pattern[8];
|
||||
|
||||
}
|
||||
BRUSH;
|
||||
|
||||
typedef struct _FONTGLYPH
|
||||
{
|
||||
sint16 offset;
|
||||
sint16 baseline;
|
||||
uint16 width;
|
||||
uint16 height;
|
||||
RD_HBITMAP pixmap;
|
||||
|
||||
}
|
||||
FONTGLYPH;
|
||||
|
||||
typedef struct _DATABLOB
|
||||
{
|
||||
void *data;
|
||||
int size;
|
||||
|
||||
}
|
||||
DATABLOB;
|
||||
|
||||
typedef struct _key_translation
|
||||
{
|
||||
/* For normal scancode translations */
|
||||
uint8 scancode;
|
||||
uint16 modifiers;
|
||||
/* For sequences. If keysym is nonzero, the fields above are not used. */
|
||||
uint32 seq_keysym; /* Really KeySym */
|
||||
struct _key_translation *next;
|
||||
}
|
||||
key_translation;
|
||||
|
||||
typedef struct _VCHANNEL
|
||||
{
|
||||
uint16 mcs_id;
|
||||
char name[8];
|
||||
uint32 flags;
|
||||
struct stream in;
|
||||
void (*process) (STREAM);
|
||||
}
|
||||
VCHANNEL;
|
||||
|
||||
/* PSTCACHE */
|
||||
typedef uint8 HASH_KEY[8];
|
||||
|
||||
/* Header for an entry in the persistent bitmap cache file */
|
||||
typedef struct _PSTCACHE_CELLHEADER
|
||||
{
|
||||
HASH_KEY key;
|
||||
uint8 width, height;
|
||||
uint16 length;
|
||||
uint32 stamp;
|
||||
}
|
||||
CELLHEADER;
|
||||
|
||||
#define MAX_CBSIZE 256
|
||||
|
||||
/* RDPSND */
|
||||
typedef struct
|
||||
{
|
||||
uint16 wFormatTag;
|
||||
uint16 nChannels;
|
||||
uint32 nSamplesPerSec;
|
||||
uint32 nAvgBytesPerSec;
|
||||
uint16 nBlockAlign;
|
||||
uint16 wBitsPerSample;
|
||||
uint16 cbSize;
|
||||
uint8 cb[MAX_CBSIZE];
|
||||
} RD_WAVEFORMATEX;
|
||||
|
||||
typedef struct _RDPCOMP
|
||||
{
|
||||
uint32 roff;
|
||||
uint8 hist[RDP_MPPC_DICT_SIZE];
|
||||
struct stream ns;
|
||||
}
|
||||
RDPCOMP;
|
||||
|
||||
/* RDPDR */
|
||||
typedef uint32 RD_NTSTATUS;
|
||||
typedef uint32 RD_NTHANDLE;
|
||||
|
||||
typedef struct _DEVICE_FNS
|
||||
{
|
||||
RD_NTSTATUS(*create) (uint32 device, uint32 desired_access, uint32 share_mode,
|
||||
uint32 create_disposition, uint32 flags_and_attributes, char *filename,
|
||||
RD_NTHANDLE * handle);
|
||||
RD_NTSTATUS(*close) (RD_NTHANDLE handle);
|
||||
RD_NTSTATUS(*read) (RD_NTHANDLE handle, uint8 * data, uint32 length, uint32 offset,
|
||||
uint32 * result);
|
||||
RD_NTSTATUS(*write) (RD_NTHANDLE handle, uint8 * data, uint32 length, uint32 offset,
|
||||
uint32 * result);
|
||||
RD_NTSTATUS(*device_control) (RD_NTHANDLE handle, uint32 request, STREAM in, STREAM out);
|
||||
}
|
||||
DEVICE_FNS;
|
||||
|
||||
|
||||
typedef struct rdpdr_device_info
|
||||
{
|
||||
uint32 device_type;
|
||||
RD_NTHANDLE handle;
|
||||
char name[8];
|
||||
char *local_path;
|
||||
void *pdevice_data;
|
||||
}
|
||||
RDPDR_DEVICE;
|
||||
|
||||
typedef struct rdpdr_serial_device_info
|
||||
{
|
||||
int dtr;
|
||||
int rts;
|
||||
uint32 control, xonoff, onlimit, offlimit;
|
||||
uint32 baud_rate,
|
||||
queue_in_size,
|
||||
queue_out_size,
|
||||
wait_mask,
|
||||
read_interval_timeout,
|
||||
read_total_timeout_multiplier,
|
||||
read_total_timeout_constant,
|
||||
write_total_timeout_multiplier, write_total_timeout_constant, posix_wait_mask;
|
||||
uint8 stop_bits, parity, word_length;
|
||||
uint8 chars[6];
|
||||
struct termios *ptermios, *pold_termios;
|
||||
int event_txempty, event_cts, event_dsr, event_rlsd, event_pending;
|
||||
}
|
||||
SERIAL_DEVICE;
|
||||
|
||||
typedef struct rdpdr_parallel_device_info
|
||||
{
|
||||
char *driver, *printer;
|
||||
uint32 queue_in_size,
|
||||
queue_out_size,
|
||||
wait_mask,
|
||||
read_interval_timeout,
|
||||
read_total_timeout_multiplier,
|
||||
read_total_timeout_constant,
|
||||
write_total_timeout_multiplier,
|
||||
write_total_timeout_constant, posix_wait_mask, bloblen;
|
||||
uint8 *blob;
|
||||
}
|
||||
PARALLEL_DEVICE;
|
||||
|
||||
typedef struct rdpdr_printer_info
|
||||
{
|
||||
FILE *printer_fp;
|
||||
char *driver, *printer;
|
||||
uint32 bloblen;
|
||||
uint8 *blob;
|
||||
BOOL default_printer;
|
||||
}
|
||||
PRINTER;
|
||||
|
||||
typedef struct notify_data
|
||||
{
|
||||
time_t modify_time;
|
||||
time_t status_time;
|
||||
time_t total_time;
|
||||
unsigned int num_entries;
|
||||
}
|
||||
NOTIFY;
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 256
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32
|
||||
typedef struct fileinfo
|
||||
{
|
||||
uint32 device_id, flags_and_attributes, accessmask;
|
||||
char path[PATH_MAX];
|
||||
DIR *pdir;
|
||||
struct dirent *pdirent;
|
||||
char pattern[PATH_MAX];
|
||||
BOOL delete_on_close;
|
||||
NOTIFY notify;
|
||||
uint32 info_class;
|
||||
}
|
||||
FILEINFO;
|
||||
#endif
|
||||
|
||||
typedef BOOL(*str_handle_lines_t) (const char *line, void *data);
|
1185
uirdesktop/uimain.c
1185
uirdesktop/uimain.c
File diff suppressed because it is too large
Load Diff
@ -1,96 +0,0 @@
|
||||
/* -*- c-basic-offset: 8 -*-
|
||||
rdesktop: A Remote Desktop Protocol client.
|
||||
main ui header
|
||||
Copyright (C) Jay Sorg 2005-2006
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* in uimain.c */
|
||||
int
|
||||
ui_main(void);
|
||||
int
|
||||
ui_lib_main(void);
|
||||
void
|
||||
ui_invalidate(int x, int y, int cx, int cy);
|
||||
int
|
||||
ui_read_wire(void);
|
||||
void
|
||||
ui_mouse_move(int x, int y);
|
||||
void
|
||||
ui_mouse_button(int button, int x, int y, int down);
|
||||
void
|
||||
ui_key_down(int key, int ext);
|
||||
void
|
||||
ui_key_up(int key, int ext);
|
||||
|
||||
void
|
||||
|
||||
ui_set_modifier_state(int code);
|
||||
|
||||
#define SPLIT_COLOUR15(c, r, g, b) \
|
||||
{ \
|
||||
r = ((c >> 7) & 0xf8) | ((c >> 12) & 0x7); \
|
||||
g = ((c >> 2) & 0xf8) | ((c >> 8) & 0x7); \
|
||||
b = ((c << 3) & 0xf8) | ((c >> 2) & 0x7); \
|
||||
}
|
||||
|
||||
#define SPLIT_COLOUR16(c, r, g, b) \
|
||||
{ \
|
||||
r = ((c >> 8) & 0xf8) | ((c >> 13) & 0x7); \
|
||||
g = ((c >> 3) & 0xfc) | ((c >> 9) & 0x3); \
|
||||
b = ((c << 3) & 0xf8) | ((c >> 2) & 0x7); \
|
||||
}
|
||||
|
||||
#define SPLIT_COLOUR32(c, r, g, b) \
|
||||
{ \
|
||||
r = ((c >> 0) & 0xff); \
|
||||
g = ((c >> 8) & 0xff); \
|
||||
b = ((c >> 16) & 0xff); \
|
||||
}
|
||||
|
||||
#define MAKE_COLOUR15(c, r, g, b) \
|
||||
{ \
|
||||
c = ( \
|
||||
(((r & 0xff) >> 3) << 10) | \
|
||||
(((g & 0xff) >> 3) << 5) | \
|
||||
(((b & 0xff) >> 3) << 0) \
|
||||
); \
|
||||
}
|
||||
|
||||
#define MAKE_COLOUR16(c, r, g, b) \
|
||||
{ \
|
||||
c = ( \
|
||||
(((r & 0xff) >> 3) << 11) | \
|
||||
(((g & 0xff) >> 2) << 5) | \
|
||||
(((b & 0xff) >> 3) << 0) \
|
||||
); \
|
||||
}
|
||||
|
||||
#define MAKE_COLOUR32(c, r, g, b) \
|
||||
{ \
|
||||
c = ( \
|
||||
((r & 0xff) << 16) | \
|
||||
((g & 0xff) << 8) | \
|
||||
((b & 0xff) << 0) \
|
||||
); \
|
||||
}
|
||||
|
||||
#undef UI_MAX
|
||||
#define UI_MAX(a, b) (((a) > (b)) ? (a) : (b))
|
||||
#undef UI_MIN
|
||||
#define UI_MIN(a, b) (((a) < (b)) ? (a) : (b))
|
||||
|
||||
|
1733
uirdesktop/win32.c
1733
uirdesktop/win32.c
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user