Changed indentation style (-psl).
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@24 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
parent
b9613445f9
commit
75717d8ab6
5
bitmap.c
5
bitmap.c
@ -26,8 +26,9 @@
|
||||
#define REPEAT(statement) { while ((count > 0) && (x < width)) { statement; count--; x++; } }
|
||||
#define MASK_UPDATE() { mixmask <<= 1; if (mixmask == 0) { mask = CVAL(input); mixmask = 1; } }
|
||||
|
||||
BOOL bitmap_decompress(unsigned char *output, int width, int height,
|
||||
unsigned char *input, int size)
|
||||
BOOL
|
||||
bitmap_decompress(unsigned char *output, int width, int height,
|
||||
unsigned char *input, int size)
|
||||
{
|
||||
unsigned char *end = input + size;
|
||||
unsigned char *prevline = NULL, *line = NULL;
|
||||
|
28
cache.c
28
cache.c
@ -27,7 +27,8 @@
|
||||
static HBITMAP bmpcache[3][600];
|
||||
|
||||
/* Retrieve a bitmap from the cache */
|
||||
HBITMAP cache_get_bitmap(uint8 cache_id, uint16 cache_idx)
|
||||
HBITMAP
|
||||
cache_get_bitmap(uint8 cache_id, uint16 cache_idx)
|
||||
{
|
||||
HBITMAP bitmap;
|
||||
|
||||
@ -44,7 +45,8 @@ HBITMAP cache_get_bitmap(uint8 cache_id, uint16 cache_idx)
|
||||
}
|
||||
|
||||
/* Store a bitmap in the cache */
|
||||
void cache_put_bitmap(uint8 cache_id, uint16 cache_idx, HBITMAP bitmap)
|
||||
void
|
||||
cache_put_bitmap(uint8 cache_id, uint16 cache_idx, HBITMAP bitmap)
|
||||
{
|
||||
HBITMAP old;
|
||||
|
||||
@ -68,7 +70,8 @@ void cache_put_bitmap(uint8 cache_id, uint16 cache_idx, HBITMAP bitmap)
|
||||
static FONTGLYPH fontcache[12][256];
|
||||
|
||||
/* Retrieve a glyph from the font cache */
|
||||
FONTGLYPH *cache_get_font(uint8 font, uint16 character)
|
||||
FONTGLYPH *
|
||||
cache_get_font(uint8 font, uint16 character)
|
||||
{
|
||||
FONTGLYPH *glyph;
|
||||
|
||||
@ -85,9 +88,9 @@ FONTGLYPH *cache_get_font(uint8 font, uint16 character)
|
||||
}
|
||||
|
||||
/* Store a glyph in the font cache */
|
||||
void cache_put_font(uint8 font, uint16 character, uint16 offset,
|
||||
uint16 baseline, uint16 width, uint16 height,
|
||||
HGLYPH pixmap)
|
||||
void
|
||||
cache_put_font(uint8 font, uint16 character, uint16 offset,
|
||||
uint16 baseline, uint16 width, uint16 height, HGLYPH pixmap)
|
||||
{
|
||||
FONTGLYPH *glyph;
|
||||
|
||||
@ -115,7 +118,8 @@ void cache_put_font(uint8 font, uint16 character, uint16 offset,
|
||||
static DATABLOB textcache[256];
|
||||
|
||||
/* Retrieve a text item from the cache */
|
||||
DATABLOB *cache_get_text(uint8 cache_id)
|
||||
DATABLOB *
|
||||
cache_get_text(uint8 cache_id)
|
||||
{
|
||||
DATABLOB *text;
|
||||
|
||||
@ -131,7 +135,8 @@ DATABLOB *cache_get_text(uint8 cache_id)
|
||||
}
|
||||
|
||||
/* Store a text item in the cache */
|
||||
void cache_put_text(uint8 cache_id, void *data, int length)
|
||||
void
|
||||
cache_put_text(uint8 cache_id, void *data, int length)
|
||||
{
|
||||
DATABLOB *text;
|
||||
|
||||
@ -156,7 +161,8 @@ void cache_put_text(uint8 cache_id, void *data, int length)
|
||||
static uint8 deskcache[0x38400];
|
||||
|
||||
/* Retrieve desktop data from the cache */
|
||||
uint8 *cache_get_desktop(uint32 offset, int cx, int cy)
|
||||
uint8 *
|
||||
cache_get_desktop(uint32 offset, int cx, int cy)
|
||||
{
|
||||
int length = cx * cy;
|
||||
|
||||
@ -170,8 +176,8 @@ uint8 *cache_get_desktop(uint32 offset, int cx, int cy)
|
||||
}
|
||||
|
||||
/* Store desktop data in the cache */
|
||||
void cache_put_desktop(uint32 offset, int cx, int cy, int scanline,
|
||||
uint8 *data)
|
||||
void
|
||||
cache_put_desktop(uint32 offset, int cx, int cy, int scanline, uint8 *data)
|
||||
{
|
||||
int length = cx * cy;
|
||||
|
||||
|
21
iso.c
21
iso.c
@ -21,7 +21,8 @@
|
||||
#include "rdesktop.h"
|
||||
|
||||
/* Send a self-contained ISO PDU */
|
||||
static void iso_send_msg(uint8 code)
|
||||
static void
|
||||
iso_send_msg(uint8 code)
|
||||
{
|
||||
STREAM s;
|
||||
|
||||
@ -42,7 +43,8 @@ static void iso_send_msg(uint8 code)
|
||||
}
|
||||
|
||||
/* Receive a message on the ISO layer, return code */
|
||||
static STREAM iso_recv_msg(uint8 *code)
|
||||
static STREAM
|
||||
iso_recv_msg(uint8 *code)
|
||||
{
|
||||
STREAM s;
|
||||
uint16 length;
|
||||
@ -80,7 +82,8 @@ static STREAM iso_recv_msg(uint8 *code)
|
||||
}
|
||||
|
||||
/* Initialise ISO transport data packet */
|
||||
STREAM iso_init(int length)
|
||||
STREAM
|
||||
iso_init(int length)
|
||||
{
|
||||
STREAM s;
|
||||
|
||||
@ -91,7 +94,8 @@ STREAM iso_init(int length)
|
||||
}
|
||||
|
||||
/* Send an ISO data PDU */
|
||||
void iso_send(STREAM s)
|
||||
void
|
||||
iso_send(STREAM s)
|
||||
{
|
||||
uint16 length;
|
||||
|
||||
@ -110,7 +114,8 @@ void iso_send(STREAM s)
|
||||
}
|
||||
|
||||
/* Receive ISO transport data packet */
|
||||
STREAM iso_recv()
|
||||
STREAM
|
||||
iso_recv()
|
||||
{
|
||||
STREAM s;
|
||||
uint8 code;
|
||||
@ -126,7 +131,8 @@ STREAM iso_recv()
|
||||
}
|
||||
|
||||
/* Establish a connection up to the ISO layer */
|
||||
BOOL iso_connect(char *server)
|
||||
BOOL
|
||||
iso_connect(char *server)
|
||||
{
|
||||
uint8 code;
|
||||
|
||||
@ -146,7 +152,8 @@ BOOL iso_connect(char *server)
|
||||
}
|
||||
|
||||
/* Disconnect from the ISO layer */
|
||||
void iso_disconnect()
|
||||
void
|
||||
iso_disconnect()
|
||||
{
|
||||
iso_send_msg(ISO_PDU_DR);
|
||||
tcp_disconnect();
|
||||
|
28
licence.c
28
licence.c
@ -29,8 +29,8 @@ static uint8 licence_key[16];
|
||||
static uint8 licence_sign_key[16];
|
||||
|
||||
/* Generate a session key and RC4 keys, given client and server randoms */
|
||||
void licence_generate_keys(uint8 *client_key, uint8 *server_key,
|
||||
uint8 *client_rsa)
|
||||
void
|
||||
licence_generate_keys(uint8 *client_key, uint8 *server_key, uint8 *client_rsa)
|
||||
{
|
||||
uint8 session_key[48];
|
||||
uint8 temp_hash[48];
|
||||
@ -47,8 +47,9 @@ void licence_generate_keys(uint8 *client_key, uint8 *server_key,
|
||||
}
|
||||
|
||||
/* Send a licence request packet */
|
||||
static void licence_send_request(uint8 *client_random, uint8 *rsa_data,
|
||||
char *user, char *host)
|
||||
static void
|
||||
licence_send_request(uint8 *client_random, uint8 *rsa_data,
|
||||
char *user, char *host)
|
||||
{
|
||||
uint32 sec_flags = SEC_LICENCE_NEG;
|
||||
uint16 userlen = strlen(user) + 1;
|
||||
@ -83,7 +84,8 @@ static void licence_send_request(uint8 *client_random, uint8 *rsa_data,
|
||||
}
|
||||
|
||||
/* Process a licence demand packet */
|
||||
static void licence_process_demand(STREAM s)
|
||||
static void
|
||||
licence_process_demand(STREAM s)
|
||||
{
|
||||
uint8 null_data[SEC_MODULUS_SIZE];
|
||||
uint8 *server_random;
|
||||
@ -101,8 +103,8 @@ static void licence_process_demand(STREAM s)
|
||||
}
|
||||
|
||||
/* Send an authentication response packet */
|
||||
static void licence_send_authresp(uint8 *token, uint8 *crypt_hwid,
|
||||
uint8 *signature)
|
||||
static void
|
||||
licence_send_authresp(uint8 *token, uint8 *crypt_hwid, uint8 *signature)
|
||||
{
|
||||
uint32 sec_flags = SEC_LICENCE_NEG;
|
||||
uint16 length = 58;
|
||||
@ -128,7 +130,8 @@ static void licence_send_authresp(uint8 *token, uint8 *crypt_hwid,
|
||||
}
|
||||
|
||||
/* Parse an authentication request packet */
|
||||
static BOOL licence_parse_authreq(STREAM s, uint8 **token, uint8 **signature)
|
||||
static BOOL
|
||||
licence_parse_authreq(STREAM s, uint8 **token, uint8 **signature)
|
||||
{
|
||||
uint16 tokenlen;
|
||||
|
||||
@ -148,7 +151,8 @@ static BOOL licence_parse_authreq(STREAM s, uint8 **token, uint8 **signature)
|
||||
}
|
||||
|
||||
/* Process an authentication request packet */
|
||||
static void licence_process_authreq(STREAM s)
|
||||
static void
|
||||
licence_process_authreq(STREAM s)
|
||||
{
|
||||
uint8 *in_token, *in_sig;
|
||||
uint8 out_token[LICENCE_TOKEN_SIZE],
|
||||
@ -188,7 +192,8 @@ static void licence_process_authreq(STREAM s)
|
||||
}
|
||||
|
||||
/* Process an licence issue packet */
|
||||
static void licence_process_issue(STREAM s)
|
||||
static void
|
||||
licence_process_issue(STREAM s)
|
||||
{
|
||||
RC4_KEY crypt_key;
|
||||
uint32 length;
|
||||
@ -211,7 +216,8 @@ static void licence_process_issue(STREAM s)
|
||||
}
|
||||
|
||||
/* Process a licence packet */
|
||||
void licence_process(STREAM s)
|
||||
void
|
||||
licence_process(STREAM s)
|
||||
{
|
||||
uint16 tag;
|
||||
|
||||
|
53
mcs.c
53
mcs.c
@ -23,7 +23,8 @@
|
||||
uint16 mcs_userid;
|
||||
|
||||
/* Parse an ASN.1 BER header */
|
||||
static BOOL ber_parse_header(STREAM s, int tagval, int *length)
|
||||
static BOOL
|
||||
ber_parse_header(STREAM s, int tagval, int *length)
|
||||
{
|
||||
int tag, len;
|
||||
|
||||
@ -57,7 +58,8 @@ static BOOL ber_parse_header(STREAM s, int tagval, int *length)
|
||||
}
|
||||
|
||||
/* Output an ASN.1 BER header */
|
||||
static void ber_out_header(STREAM s, int tagval, int length)
|
||||
static void
|
||||
ber_out_header(STREAM s, int tagval, int length)
|
||||
{
|
||||
if (tagval > 0xff)
|
||||
{
|
||||
@ -78,15 +80,17 @@ static void ber_out_header(STREAM s, int tagval, int length)
|
||||
}
|
||||
|
||||
/* Output an ASN.1 BER integer */
|
||||
static void ber_out_integer(STREAM s, int value)
|
||||
static void
|
||||
ber_out_integer(STREAM s, int value)
|
||||
{
|
||||
ber_out_header(s, BER_TAG_INTEGER, 2);
|
||||
out_uint16_be(s, value);
|
||||
}
|
||||
|
||||
/* Output a DOMAIN_PARAMS structure (ASN.1 BER) */
|
||||
static void mcs_out_domain_params(STREAM s, int max_channels, int max_users,
|
||||
int max_tokens, int max_pdusize)
|
||||
static void
|
||||
mcs_out_domain_params(STREAM s, int max_channels, int max_users,
|
||||
int max_tokens, int max_pdusize)
|
||||
{
|
||||
ber_out_header(s, MCS_TAG_DOMAIN_PARAMS, 32);
|
||||
ber_out_integer(s, max_channels);
|
||||
@ -100,7 +104,8 @@ static void mcs_out_domain_params(STREAM s, int max_channels, int max_users,
|
||||
}
|
||||
|
||||
/* Parse a DOMAIN_PARAMS structure (ASN.1 BER) */
|
||||
static BOOL mcs_parse_domain_params(STREAM s)
|
||||
static BOOL
|
||||
mcs_parse_domain_params(STREAM s)
|
||||
{
|
||||
int length;
|
||||
|
||||
@ -111,7 +116,8 @@ static BOOL mcs_parse_domain_params(STREAM s)
|
||||
}
|
||||
|
||||
/* Send an MCS_CONNECT_INITIAL message (ASN.1 BER) */
|
||||
static void mcs_send_connect_initial(STREAM mcs_data)
|
||||
static void
|
||||
mcs_send_connect_initial(STREAM mcs_data)
|
||||
{
|
||||
int datalen = mcs_data->end - mcs_data->data;
|
||||
int length = 7 + 3 * 34 + 4 + datalen;
|
||||
@ -138,7 +144,8 @@ static void mcs_send_connect_initial(STREAM mcs_data)
|
||||
}
|
||||
|
||||
/* Expect a MCS_CONNECT_RESPONSE message (ASN.1 BER) */
|
||||
static BOOL mcs_recv_connect_response(STREAM mcs_data)
|
||||
static BOOL
|
||||
mcs_recv_connect_response(STREAM mcs_data)
|
||||
{
|
||||
uint8 result;
|
||||
int length;
|
||||
@ -177,7 +184,8 @@ static BOOL mcs_recv_connect_response(STREAM mcs_data)
|
||||
}
|
||||
|
||||
/* Send an EDrq message (ASN.1 PER) */
|
||||
static void mcs_send_edrq()
|
||||
static void
|
||||
mcs_send_edrq()
|
||||
{
|
||||
STREAM s;
|
||||
|
||||
@ -192,7 +200,8 @@ static void mcs_send_edrq()
|
||||
}
|
||||
|
||||
/* Send an AUrq message (ASN.1 PER) */
|
||||
static void mcs_send_aurq()
|
||||
static void
|
||||
mcs_send_aurq()
|
||||
{
|
||||
STREAM s;
|
||||
|
||||
@ -205,7 +214,8 @@ static void mcs_send_aurq()
|
||||
}
|
||||
|
||||
/* Expect a AUcf message (ASN.1 PER) */
|
||||
static BOOL mcs_recv_aucf(uint16 *mcs_userid)
|
||||
static BOOL
|
||||
mcs_recv_aucf(uint16 *mcs_userid)
|
||||
{
|
||||
uint8 opcode, result;
|
||||
STREAM s;
|
||||
@ -235,7 +245,8 @@ static BOOL mcs_recv_aucf(uint16 *mcs_userid)
|
||||
}
|
||||
|
||||
/* Send a CJrq message (ASN.1 PER) */
|
||||
static void mcs_send_cjrq(uint16 chanid)
|
||||
static void
|
||||
mcs_send_cjrq(uint16 chanid)
|
||||
{
|
||||
STREAM s;
|
||||
|
||||
@ -250,7 +261,8 @@ static void mcs_send_cjrq(uint16 chanid)
|
||||
}
|
||||
|
||||
/* Expect a CJcf message (ASN.1 PER) */
|
||||
static BOOL mcs_recv_cjcf()
|
||||
static BOOL
|
||||
mcs_recv_cjcf()
|
||||
{
|
||||
uint8 opcode, result;
|
||||
STREAM s;
|
||||
@ -281,7 +293,8 @@ static BOOL mcs_recv_cjcf()
|
||||
}
|
||||
|
||||
/* Initialise an MCS transport data packet */
|
||||
STREAM mcs_init(int length)
|
||||
STREAM
|
||||
mcs_init(int length)
|
||||
{
|
||||
STREAM s;
|
||||
|
||||
@ -292,7 +305,8 @@ STREAM mcs_init(int length)
|
||||
}
|
||||
|
||||
/* Send an MCS transport data packet */
|
||||
void mcs_send(STREAM s)
|
||||
void
|
||||
mcs_send(STREAM s)
|
||||
{
|
||||
uint16 length;
|
||||
|
||||
@ -310,7 +324,8 @@ void mcs_send(STREAM s)
|
||||
}
|
||||
|
||||
/* Receive an MCS transport data packet */
|
||||
STREAM mcs_recv()
|
||||
STREAM
|
||||
mcs_recv()
|
||||
{
|
||||
uint8 opcode, appid, length;
|
||||
STREAM s;
|
||||
@ -339,7 +354,8 @@ STREAM mcs_recv()
|
||||
}
|
||||
|
||||
/* Establish a connection up to the MCS layer */
|
||||
BOOL mcs_connect(char *server, STREAM mcs_data)
|
||||
BOOL
|
||||
mcs_connect(char *server, STREAM mcs_data)
|
||||
{
|
||||
if (!iso_connect(server))
|
||||
return False;
|
||||
@ -370,7 +386,8 @@ BOOL mcs_connect(char *server, STREAM mcs_data)
|
||||
}
|
||||
|
||||
/* Disconnect from the MCS layer */
|
||||
void mcs_disconnect()
|
||||
void
|
||||
mcs_disconnect()
|
||||
{
|
||||
iso_disconnect();
|
||||
}
|
||||
|
80
orders.c
80
orders.c
@ -25,7 +25,8 @@ extern unsigned char *next_packet;
|
||||
static RDP_ORDER_STATE order_state;
|
||||
|
||||
/* Read field indicating which parameters are present */
|
||||
static void rdp_in_present(STREAM s, uint32 *present, uint8 flags, int size)
|
||||
static void
|
||||
rdp_in_present(STREAM s, uint32 *present, uint8 flags, int size)
|
||||
{
|
||||
uint8 bits;
|
||||
int i;
|
||||
@ -52,7 +53,8 @@ static void rdp_in_present(STREAM s, uint32 *present, uint8 flags, int size)
|
||||
}
|
||||
|
||||
/* Read a co-ordinate (16-bit, or 8-bit delta) */
|
||||
static void rdp_in_coord(STREAM s, uint16 *coord, BOOL delta)
|
||||
static void
|
||||
rdp_in_coord(STREAM s, uint16 *coord, BOOL delta)
|
||||
{
|
||||
uint8 change;
|
||||
|
||||
@ -68,14 +70,16 @@ static void rdp_in_coord(STREAM s, uint16 *coord, BOOL delta)
|
||||
}
|
||||
|
||||
/* Read a colour entry */
|
||||
static void rdp_in_colour(STREAM s, uint8 *colour)
|
||||
static void
|
||||
rdp_in_colour(STREAM s, uint8 *colour)
|
||||
{
|
||||
in_uint8(s, *colour);
|
||||
s->p += 2;
|
||||
}
|
||||
|
||||
/* Parse bounds information */
|
||||
static BOOL rdp_parse_bounds(STREAM s, BOUNDS *bounds)
|
||||
static BOOL
|
||||
rdp_parse_bounds(STREAM s, BOUNDS *bounds)
|
||||
{
|
||||
uint8 present;
|
||||
|
||||
@ -105,7 +109,8 @@ static BOOL rdp_parse_bounds(STREAM s, BOUNDS *bounds)
|
||||
}
|
||||
|
||||
/* Parse a pen */
|
||||
static BOOL rdp_parse_pen(STREAM s, PEN *pen, uint32 present)
|
||||
static BOOL
|
||||
rdp_parse_pen(STREAM s, PEN *pen, uint32 present)
|
||||
{
|
||||
if (present & 1)
|
||||
in_uint8(s, pen->style);
|
||||
@ -120,7 +125,8 @@ static BOOL rdp_parse_pen(STREAM s, PEN *pen, uint32 present)
|
||||
}
|
||||
|
||||
/* Parse a brush */
|
||||
static BOOL rdp_parse_brush(STREAM s, BRUSH *brush, uint32 present)
|
||||
static BOOL
|
||||
rdp_parse_brush(STREAM s, BRUSH *brush, uint32 present)
|
||||
{
|
||||
if (present & 1)
|
||||
in_uint8(s, brush->xorigin);
|
||||
@ -141,8 +147,8 @@ static BOOL rdp_parse_brush(STREAM s, BRUSH *brush, uint32 present)
|
||||
}
|
||||
|
||||
/* Process a destination blt order */
|
||||
static void process_destblt(STREAM s, DESTBLT_ORDER *os,
|
||||
uint32 present, BOOL delta)
|
||||
static void
|
||||
process_destblt(STREAM s, DESTBLT_ORDER *os, uint32 present, BOOL delta)
|
||||
{
|
||||
if (present & 0x01)
|
||||
rdp_in_coord(s, &os->x, delta);
|
||||
@ -166,8 +172,8 @@ static void process_destblt(STREAM s, DESTBLT_ORDER *os,
|
||||
}
|
||||
|
||||
/* Process a pattern blt order */
|
||||
static void process_patblt(STREAM s, PATBLT_ORDER *os,
|
||||
uint32 present, BOOL delta)
|
||||
static void
|
||||
process_patblt(STREAM s, PATBLT_ORDER *os, uint32 present, BOOL delta)
|
||||
{
|
||||
if (present & 0x0001)
|
||||
rdp_in_coord(s, &os->x, delta);
|
||||
@ -201,8 +207,8 @@ static void process_patblt(STREAM s, PATBLT_ORDER *os,
|
||||
}
|
||||
|
||||
/* Process a screen blt order */
|
||||
static void process_screenblt(STREAM s, SCREENBLT_ORDER *os,
|
||||
uint32 present, BOOL delta)
|
||||
static void
|
||||
process_screenblt(STREAM s, SCREENBLT_ORDER *os, uint32 present, BOOL delta)
|
||||
{
|
||||
if (present & 0x0001)
|
||||
rdp_in_coord(s, &os->x, delta);
|
||||
@ -233,7 +239,8 @@ static void process_screenblt(STREAM s, SCREENBLT_ORDER *os,
|
||||
}
|
||||
|
||||
/* Process a line order */
|
||||
static void process_line(STREAM s, LINE_ORDER *os, uint32 present, BOOL delta)
|
||||
static void
|
||||
process_line(STREAM s, LINE_ORDER *os, uint32 present, BOOL delta)
|
||||
{
|
||||
if (present & 0x0001)
|
||||
in_uint16_le(s, os->mixmode);
|
||||
@ -273,7 +280,8 @@ static void process_line(STREAM s, LINE_ORDER *os, uint32 present, BOOL delta)
|
||||
}
|
||||
|
||||
/* Process an opaque rectangle order */
|
||||
static void process_rect(STREAM s, RECT_ORDER *os, uint32 present, BOOL delta)
|
||||
static void
|
||||
process_rect(STREAM s, RECT_ORDER *os, uint32 present, BOOL delta)
|
||||
{
|
||||
if (present & 0x01)
|
||||
rdp_in_coord(s, &os->x, delta);
|
||||
@ -297,8 +305,8 @@ static void process_rect(STREAM s, RECT_ORDER *os, uint32 present, BOOL delta)
|
||||
}
|
||||
|
||||
/* Process a desktop save order */
|
||||
static void process_desksave(STREAM s, DESKSAVE_ORDER *os,
|
||||
uint32 present, BOOL delta)
|
||||
static void
|
||||
process_desksave(STREAM s, DESKSAVE_ORDER *os, uint32 present, BOOL delta)
|
||||
{
|
||||
int width, height;
|
||||
|
||||
@ -335,8 +343,8 @@ static void process_desksave(STREAM s, DESKSAVE_ORDER *os,
|
||||
}
|
||||
|
||||
/* Process a memory blt order */
|
||||
static void process_memblt(STREAM s, MEMBLT_ORDER *os,
|
||||
uint32 present, BOOL delta)
|
||||
static void
|
||||
process_memblt(STREAM s, MEMBLT_ORDER *os, uint32 present, BOOL delta)
|
||||
{
|
||||
HBITMAP bitmap;
|
||||
|
||||
@ -383,8 +391,8 @@ static void process_memblt(STREAM s, MEMBLT_ORDER *os,
|
||||
}
|
||||
|
||||
/* Process a 3-way blt order */
|
||||
static void process_triblt(STREAM s, TRIBLT_ORDER *os,
|
||||
uint32 present, BOOL delta)
|
||||
static void
|
||||
process_triblt(STREAM s, TRIBLT_ORDER *os, uint32 present, BOOL delta)
|
||||
{
|
||||
HBITMAP bitmap;
|
||||
|
||||
@ -444,7 +452,8 @@ static void process_triblt(STREAM s, TRIBLT_ORDER *os,
|
||||
}
|
||||
|
||||
/* Parse a delta co-ordinate in polyline order form */
|
||||
static int parse_delta(uint8 *buffer, int *offset)
|
||||
static int
|
||||
parse_delta(uint8 *buffer, int *offset)
|
||||
{
|
||||
int value = buffer[(*offset)++];
|
||||
int two_byte = value & 0x80;
|
||||
@ -461,8 +470,8 @@ static int parse_delta(uint8 *buffer, int *offset)
|
||||
}
|
||||
|
||||
/* Process a polyline order */
|
||||
static void process_polyline(STREAM s, POLYLINE_ORDER *os,
|
||||
uint32 present, BOOL delta)
|
||||
static void
|
||||
process_polyline(STREAM s, POLYLINE_ORDER *os, uint32 present, BOOL delta)
|
||||
{
|
||||
int index, line, data;
|
||||
int x, y, xfrom, yfrom;
|
||||
@ -531,8 +540,8 @@ static void process_polyline(STREAM s, POLYLINE_ORDER *os,
|
||||
}
|
||||
|
||||
/* Process a text order */
|
||||
static void process_text2(STREAM s, TEXT2_ORDER *os, uint32 present,
|
||||
BOOL delta)
|
||||
static void
|
||||
process_text2(STREAM s, TEXT2_ORDER *os, uint32 present, BOOL delta)
|
||||
{
|
||||
DATABLOB *entry;
|
||||
int i;
|
||||
@ -634,7 +643,8 @@ static void process_text2(STREAM s, TEXT2_ORDER *os, uint32 present,
|
||||
}
|
||||
|
||||
/* Process a raw bitmap cache order */
|
||||
static void process_raw_bmpcache(STREAM s)
|
||||
static void
|
||||
process_raw_bmpcache(STREAM s)
|
||||
{
|
||||
HBITMAP bitmap;
|
||||
uint16 cache_idx, bufsize;
|
||||
@ -658,7 +668,8 @@ static void process_raw_bmpcache(STREAM s)
|
||||
}
|
||||
|
||||
/* Process a bitmap cache order */
|
||||
static void process_bmpcache(STREAM s)
|
||||
static void
|
||||
process_bmpcache(STREAM s)
|
||||
{
|
||||
HBITMAP bitmap;
|
||||
uint16 cache_idx, size;
|
||||
@ -692,7 +703,8 @@ static void process_bmpcache(STREAM s)
|
||||
}
|
||||
|
||||
/* Process a colourmap cache order */
|
||||
static void process_colcache(STREAM s)
|
||||
static void
|
||||
process_colcache(STREAM s)
|
||||
{
|
||||
COLOURENTRY *entry;
|
||||
COLOURMAP map;
|
||||
@ -723,7 +735,8 @@ static void process_colcache(STREAM s)
|
||||
}
|
||||
|
||||
/* Process a font cache order */
|
||||
static void process_fontcache(STREAM s)
|
||||
static void
|
||||
process_fontcache(STREAM s)
|
||||
{
|
||||
HGLYPH bitmap;
|
||||
uint8 font, nglyphs;
|
||||
@ -754,7 +767,8 @@ static void process_fontcache(STREAM s)
|
||||
}
|
||||
|
||||
/* Process a secondary order */
|
||||
static void process_secondary_order(STREAM s)
|
||||
static void
|
||||
process_secondary_order(STREAM s)
|
||||
{
|
||||
uint16 length;
|
||||
uint8 type;
|
||||
@ -792,7 +806,8 @@ static void process_secondary_order(STREAM s)
|
||||
}
|
||||
|
||||
/* Process an order PDU */
|
||||
void process_orders(STREAM s)
|
||||
void
|
||||
process_orders(STREAM s)
|
||||
{
|
||||
RDP_ORDER_STATE *os = &order_state;
|
||||
uint32 present;
|
||||
@ -929,7 +944,8 @@ void process_orders(STREAM s)
|
||||
}
|
||||
|
||||
/* Reset order state */
|
||||
void reset_order_state()
|
||||
void
|
||||
reset_order_state()
|
||||
{
|
||||
memset(&order_state, 0, sizeof(order_state));
|
||||
}
|
||||
|
21
rdesktop.c
21
rdesktop.c
@ -37,7 +37,8 @@ BOOL orders = True;
|
||||
BOOL licence = True;
|
||||
|
||||
/* Display usage information */
|
||||
static void usage(char *program)
|
||||
static void
|
||||
usage(char *program)
|
||||
{
|
||||
STATUS("Usage: %s [options] server\n", program);
|
||||
STATUS(" -u: user name\n");
|
||||
@ -55,7 +56,8 @@ static void usage(char *program)
|
||||
}
|
||||
|
||||
/* Client program */
|
||||
int main(int argc, char *argv[])
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
struct passwd *pw;
|
||||
char *server;
|
||||
@ -183,7 +185,8 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* Generate a 32-byte random for the secure transport code. */
|
||||
void generate_random(uint8 *random)
|
||||
void
|
||||
generate_random(uint8 *random)
|
||||
{
|
||||
struct stat st;
|
||||
struct tms tmsbuf;
|
||||
@ -210,7 +213,8 @@ void generate_random(uint8 *random)
|
||||
}
|
||||
|
||||
/* malloc; exit if out of memory */
|
||||
void *xmalloc(int size)
|
||||
void *
|
||||
xmalloc(int size)
|
||||
{
|
||||
void *mem = malloc(size);
|
||||
if (mem == NULL)
|
||||
@ -222,7 +226,8 @@ void *xmalloc(int size)
|
||||
}
|
||||
|
||||
/* realloc; exit if out of memory */
|
||||
void *xrealloc(void *oldmem, int size)
|
||||
void *
|
||||
xrealloc(void *oldmem, int size)
|
||||
{
|
||||
void *mem = realloc(oldmem, size);
|
||||
if (mem == NULL)
|
||||
@ -234,13 +239,15 @@ void *xrealloc(void *oldmem, int size)
|
||||
}
|
||||
|
||||
/* free */
|
||||
void xfree(void *mem)
|
||||
void
|
||||
xfree(void *mem)
|
||||
{
|
||||
free(mem);
|
||||
}
|
||||
|
||||
/* Produce a hex dump */
|
||||
void hexdump(unsigned char *p, unsigned int len)
|
||||
void
|
||||
hexdump(unsigned char *p, unsigned int len)
|
||||
{
|
||||
unsigned char *line = p;
|
||||
unsigned int thisline, offset = 0;
|
||||
|
118
rdp.c
118
rdp.c
@ -28,7 +28,8 @@ unsigned char *next_packet;
|
||||
uint32 rdp_shareid;
|
||||
|
||||
/* Initialise an RDP packet */
|
||||
static STREAM rdp_init(int maxlen)
|
||||
static STREAM
|
||||
rdp_init(int maxlen)
|
||||
{
|
||||
STREAM s;
|
||||
|
||||
@ -39,7 +40,8 @@ static STREAM rdp_init(int maxlen)
|
||||
}
|
||||
|
||||
/* Send an RDP packet */
|
||||
static void rdp_send(STREAM s, uint8 pdu_type)
|
||||
static void
|
||||
rdp_send(STREAM s, uint8 pdu_type)
|
||||
{
|
||||
uint16 length;
|
||||
|
||||
@ -54,7 +56,8 @@ static void rdp_send(STREAM s, uint8 pdu_type)
|
||||
}
|
||||
|
||||
/* Receive an RDP packet */
|
||||
static STREAM rdp_recv(uint8 *type)
|
||||
static STREAM
|
||||
rdp_recv(uint8 *type)
|
||||
{
|
||||
static STREAM rdp_s;
|
||||
uint16 length, pdu_type;
|
||||
@ -88,7 +91,8 @@ static STREAM rdp_recv(uint8 *type)
|
||||
}
|
||||
|
||||
/* Initialise an RDP data packet */
|
||||
static STREAM rdp_init_data(int maxlen)
|
||||
static STREAM
|
||||
rdp_init_data(int maxlen)
|
||||
{
|
||||
STREAM s;
|
||||
|
||||
@ -99,7 +103,8 @@ static STREAM rdp_init_data(int maxlen)
|
||||
}
|
||||
|
||||
/* Send an RDP data packet */
|
||||
static void rdp_send_data(STREAM s, uint8 data_pdu_type)
|
||||
static void
|
||||
rdp_send_data(STREAM s, uint8 data_pdu_type)
|
||||
{
|
||||
uint16 length;
|
||||
|
||||
@ -122,7 +127,8 @@ static void rdp_send_data(STREAM s, uint8 data_pdu_type)
|
||||
}
|
||||
|
||||
/* Output a string in Unicode */
|
||||
void rdp_out_unistr(STREAM s, char *string, int len)
|
||||
void
|
||||
rdp_out_unistr(STREAM s, char *string, int len)
|
||||
{
|
||||
int i = 0, j = 0;
|
||||
|
||||
@ -138,9 +144,9 @@ void rdp_out_unistr(STREAM s, char *string, int len)
|
||||
}
|
||||
|
||||
/* Parse a logon info packet */
|
||||
static void rdp_send_logon_info(uint32 flags, char *domain, char *user,
|
||||
char *password, char *program,
|
||||
char *directory)
|
||||
static void
|
||||
rdp_send_logon_info(uint32 flags, char *domain, char *user,
|
||||
char *password, char *program, char *directory)
|
||||
{
|
||||
int len_domain = 2 * strlen(domain);
|
||||
int len_user = 2 * strlen(user);
|
||||
@ -171,7 +177,8 @@ static void rdp_send_logon_info(uint32 flags, char *domain, char *user,
|
||||
}
|
||||
|
||||
/* Send a control PDU */
|
||||
static void rdp_send_control(uint16 action)
|
||||
static void
|
||||
rdp_send_control(uint16 action)
|
||||
{
|
||||
STREAM s;
|
||||
|
||||
@ -186,7 +193,8 @@ static void rdp_send_control(uint16 action)
|
||||
}
|
||||
|
||||
/* Send a synchronisation PDU */
|
||||
static void rdp_send_synchronise()
|
||||
static void
|
||||
rdp_send_synchronise()
|
||||
{
|
||||
STREAM s;
|
||||
|
||||
@ -200,8 +208,9 @@ static void rdp_send_synchronise()
|
||||
}
|
||||
|
||||
/* Send a single input event */
|
||||
void rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags,
|
||||
uint16 param1, uint16 param2)
|
||||
void
|
||||
rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags,
|
||||
uint16 param1, uint16 param2)
|
||||
{
|
||||
STREAM s;
|
||||
|
||||
@ -221,7 +230,8 @@ void rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags,
|
||||
}
|
||||
|
||||
/* Send an (empty) font information PDU */
|
||||
static void rdp_send_fonts(uint16 seq)
|
||||
static void
|
||||
rdp_send_fonts(uint16 seq)
|
||||
{
|
||||
STREAM s;
|
||||
|
||||
@ -237,7 +247,8 @@ static void rdp_send_fonts(uint16 seq)
|
||||
}
|
||||
|
||||
/* Output general capability set */
|
||||
static void rdp_out_general_caps(STREAM s)
|
||||
static void
|
||||
rdp_out_general_caps(STREAM s)
|
||||
{
|
||||
out_uint16_le(s, RDP_CAPSET_GENERAL);
|
||||
out_uint16_le(s, RDP_CAPLEN_GENERAL);
|
||||
@ -255,7 +266,8 @@ static void rdp_out_general_caps(STREAM s)
|
||||
}
|
||||
|
||||
/* Output bitmap capability set */
|
||||
static void rdp_out_bitmap_caps(STREAM s)
|
||||
static void
|
||||
rdp_out_bitmap_caps(STREAM s)
|
||||
{
|
||||
out_uint16_le(s, RDP_CAPSET_BITMAP);
|
||||
out_uint16_le(s, RDP_CAPLEN_BITMAP);
|
||||
@ -275,7 +287,8 @@ static void rdp_out_bitmap_caps(STREAM s)
|
||||
}
|
||||
|
||||
/* Output order capability set */
|
||||
static void rdp_out_order_caps(STREAM s)
|
||||
static void
|
||||
rdp_out_order_caps(STREAM s)
|
||||
{
|
||||
uint8 order_caps[32];
|
||||
|
||||
@ -300,7 +313,8 @@ static void rdp_out_order_caps(STREAM s)
|
||||
}
|
||||
|
||||
/* Output bitmap cache capability set */
|
||||
static void rdp_out_bmpcache_caps(STREAM s)
|
||||
static void
|
||||
rdp_out_bmpcache_caps(STREAM s)
|
||||
{
|
||||
out_uint16_le(s, RDP_CAPSET_BMPCACHE);
|
||||
out_uint16_le(s, RDP_CAPLEN_BMPCACHE);
|
||||
@ -315,7 +329,8 @@ static void rdp_out_bmpcache_caps(STREAM s)
|
||||
}
|
||||
|
||||
/* Output control capability set */
|
||||
static void rdp_out_control_caps(STREAM s)
|
||||
static void
|
||||
rdp_out_control_caps(STREAM s)
|
||||
{
|
||||
out_uint16_le(s, RDP_CAPSET_CONTROL);
|
||||
out_uint16_le(s, RDP_CAPLEN_CONTROL);
|
||||
@ -327,7 +342,8 @@ static void rdp_out_control_caps(STREAM s)
|
||||
}
|
||||
|
||||
/* Output activation capability set */
|
||||
static void rdp_out_activate_caps(STREAM s)
|
||||
static void
|
||||
rdp_out_activate_caps(STREAM s)
|
||||
{
|
||||
out_uint16_le(s, RDP_CAPSET_ACTIVATE);
|
||||
out_uint16_le(s, RDP_CAPLEN_ACTIVATE);
|
||||
@ -339,7 +355,8 @@ static void rdp_out_activate_caps(STREAM s)
|
||||
}
|
||||
|
||||
/* Output pointer capability set */
|
||||
static void rdp_out_pointer_caps(STREAM s)
|
||||
static void
|
||||
rdp_out_pointer_caps(STREAM s)
|
||||
{
|
||||
out_uint16_le(s, RDP_CAPSET_POINTER);
|
||||
out_uint16_le(s, RDP_CAPLEN_POINTER);
|
||||
@ -349,7 +366,8 @@ static void rdp_out_pointer_caps(STREAM s)
|
||||
}
|
||||
|
||||
/* Output share capability set */
|
||||
static void rdp_out_share_caps(STREAM s)
|
||||
static void
|
||||
rdp_out_share_caps(STREAM s)
|
||||
{
|
||||
out_uint16_le(s, RDP_CAPSET_SHARE);
|
||||
out_uint16_le(s, RDP_CAPLEN_SHARE);
|
||||
@ -359,7 +377,8 @@ static void rdp_out_share_caps(STREAM s)
|
||||
}
|
||||
|
||||
/* Output colour cache capability set */
|
||||
static void rdp_out_colcache_caps(STREAM s)
|
||||
static void
|
||||
rdp_out_colcache_caps(STREAM s)
|
||||
{
|
||||
out_uint16_le(s, RDP_CAPSET_COLCACHE);
|
||||
out_uint16_le(s, RDP_CAPLEN_COLCACHE);
|
||||
@ -371,27 +390,28 @@ static void rdp_out_colcache_caps(STREAM s)
|
||||
static uint8 canned_caps[] = {
|
||||
0x01, 0x00, 0x00, 0x00, 0x09, 0x04, 0x00, 0x00, 0x04,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x0C, 0x00, 0x08, 0x00, 0x01,
|
||||
0x0C, 0x00, 0x08, 0x00, 0x01,
|
||||
0x00, 0x00, 0x00, 0x0E, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x10, 0x00, 0x34, 0x00, 0xFE,
|
||||
0x10, 0x00, 0x34, 0x00, 0xFE,
|
||||
0x00, 0x04, 0x00, 0xFE, 0x00, 0x04, 0x00, 0xFE, 0x00, 0x08, 0x00,
|
||||
0xFE, 0x00, 0x08, 0x00, 0xFE,
|
||||
0xFE, 0x00, 0x08, 0x00, 0xFE,
|
||||
0x00, 0x10, 0x00, 0xFE, 0x00, 0x20, 0x00, 0xFE, 0x00, 0x40, 0x00,
|
||||
0xFE, 0x00, 0x80, 0x00, 0xFE,
|
||||
0xFE, 0x00, 0x80, 0x00, 0xFE,
|
||||
0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x01,
|
||||
0x02, 0x00, 0x00, 0x00
|
||||
0x02, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
/* Output unknown capability set */
|
||||
static void rdp_out_unknown_caps(STREAM s)
|
||||
static void
|
||||
rdp_out_unknown_caps(STREAM s)
|
||||
{
|
||||
out_uint16_le(s, RDP_CAPSET_UNKNOWN);
|
||||
out_uint16_le(s, 0x58);
|
||||
@ -400,7 +420,8 @@ static void rdp_out_unknown_caps(STREAM s)
|
||||
}
|
||||
|
||||
/* Send a confirm active PDU */
|
||||
static void rdp_send_confirm_active()
|
||||
static void
|
||||
rdp_send_confirm_active()
|
||||
{
|
||||
STREAM s;
|
||||
uint16 caplen =
|
||||
@ -436,7 +457,8 @@ static void rdp_send_confirm_active()
|
||||
}
|
||||
|
||||
/* Respond to a demand active PDU */
|
||||
static void process_demand_active(STREAM s)
|
||||
static void
|
||||
process_demand_active(STREAM s)
|
||||
{
|
||||
uint8 type;
|
||||
|
||||
@ -459,7 +481,8 @@ static void process_demand_active(STREAM s)
|
||||
}
|
||||
|
||||
/* Process a pointer PDU */
|
||||
static void process_pointer_pdu(STREAM s)
|
||||
static void
|
||||
process_pointer_pdu(STREAM s)
|
||||
{
|
||||
uint16 message_type;
|
||||
uint16 x, y;
|
||||
@ -482,7 +505,8 @@ static void process_pointer_pdu(STREAM s)
|
||||
}
|
||||
|
||||
/* Process bitmap updates */
|
||||
static void process_bitmap_updates(STREAM s)
|
||||
static void
|
||||
process_bitmap_updates(STREAM s)
|
||||
{
|
||||
uint16 num_updates;
|
||||
uint16 left, top, right, bottom, width, height;
|
||||
@ -535,7 +559,8 @@ static void process_bitmap_updates(STREAM s)
|
||||
}
|
||||
|
||||
/* Process a palette update */
|
||||
static void process_palette(STREAM s)
|
||||
static void
|
||||
process_palette(STREAM s)
|
||||
{
|
||||
HCOLOURMAP hmap;
|
||||
COLOURMAP map;
|
||||
@ -550,7 +575,8 @@ static void process_palette(STREAM s)
|
||||
}
|
||||
|
||||
/* Process an update PDU */
|
||||
static void process_update_pdu(STREAM s)
|
||||
static void
|
||||
process_update_pdu(STREAM s)
|
||||
{
|
||||
uint16 update_type;
|
||||
|
||||
@ -580,7 +606,8 @@ static void process_update_pdu(STREAM s)
|
||||
}
|
||||
|
||||
/* Process data PDU */
|
||||
static void process_data_pdu(STREAM s)
|
||||
static void
|
||||
process_data_pdu(STREAM s)
|
||||
{
|
||||
uint8 data_pdu_type;
|
||||
|
||||
@ -612,7 +639,8 @@ static void process_data_pdu(STREAM s)
|
||||
}
|
||||
|
||||
/* Process incoming packets */
|
||||
void rdp_main_loop()
|
||||
void
|
||||
rdp_main_loop()
|
||||
{
|
||||
uint8 type;
|
||||
STREAM s;
|
||||
@ -639,8 +667,9 @@ void rdp_main_loop()
|
||||
}
|
||||
|
||||
/* Establish a connection up to the RDP layer */
|
||||
BOOL rdp_connect(char *server, uint32 flags, char *domain, char *password,
|
||||
char *command, char *directory)
|
||||
BOOL
|
||||
rdp_connect(char *server, uint32 flags, char *domain, char *password,
|
||||
char *command, char *directory)
|
||||
{
|
||||
if (!sec_connect(server))
|
||||
return False;
|
||||
@ -651,7 +680,8 @@ BOOL rdp_connect(char *server, uint32 flags, char *domain, char *password,
|
||||
}
|
||||
|
||||
/* Disconnect from the RDP layer */
|
||||
void rdp_disconnect()
|
||||
void
|
||||
rdp_disconnect()
|
||||
{
|
||||
sec_disconnect();
|
||||
}
|
||||
|
86
secure.c
86
secure.c
@ -45,8 +45,8 @@ static uint8 sec_crypted_random[64];
|
||||
* a client and server salt) and a global salt value used for padding.
|
||||
* Both SHA1 and MD5 algorithms are used.
|
||||
*/
|
||||
void sec_hash_48(uint8 *out, uint8 *in, uint8 *salt1, uint8 *salt2,
|
||||
uint8 salt)
|
||||
void
|
||||
sec_hash_48(uint8 *out, uint8 *in, uint8 *salt1, uint8 *salt2, uint8 salt)
|
||||
{
|
||||
uint8 shasig[20];
|
||||
uint8 pad[4];
|
||||
@ -76,7 +76,8 @@ void sec_hash_48(uint8 *out, uint8 *in, uint8 *salt1, uint8 *salt2,
|
||||
* Weaker 16-byte transformation, also using two 32-byte salts, but
|
||||
* only using a single round of MD5.
|
||||
*/
|
||||
void sec_hash_16(uint8 *out, uint8 *in, uint8 *salt1, uint8 *salt2)
|
||||
void
|
||||
sec_hash_16(uint8 *out, uint8 *in, uint8 *salt1, uint8 *salt2)
|
||||
{
|
||||
MD5_CTX md5;
|
||||
|
||||
@ -88,7 +89,8 @@ void sec_hash_16(uint8 *out, uint8 *in, uint8 *salt1, uint8 *salt2)
|
||||
}
|
||||
|
||||
/* Reduce key entropy from 64 to 40 bits */
|
||||
static void sec_make_40bit(uint8 *key)
|
||||
static void
|
||||
sec_make_40bit(uint8 *key)
|
||||
{
|
||||
key[0] = 0xd1;
|
||||
key[1] = 0x26;
|
||||
@ -96,8 +98,8 @@ static void sec_make_40bit(uint8 *key)
|
||||
}
|
||||
|
||||
/* Generate a session key and RC4 keys, given client and server randoms */
|
||||
static void sec_generate_keys(uint8 *client_key, uint8 *server_key,
|
||||
int rc4_key_size)
|
||||
static void
|
||||
sec_generate_keys(uint8 *client_key, uint8 *server_key, int rc4_key_size)
|
||||
{
|
||||
uint8 session_key[48];
|
||||
uint8 temp_hash[48];
|
||||
@ -145,20 +147,21 @@ static void sec_generate_keys(uint8 *client_key, uint8 *server_key,
|
||||
|
||||
static uint8 pad_54[40] = {
|
||||
54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
|
||||
54, 54, 54,
|
||||
54, 54, 54,
|
||||
54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
|
||||
54, 54, 54
|
||||
54, 54, 54
|
||||
};
|
||||
|
||||
static uint8 pad_92[48] = {
|
||||
92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
|
||||
92, 92, 92, 92, 92, 92, 92,
|
||||
92, 92, 92, 92, 92, 92, 92,
|
||||
92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
|
||||
92, 92, 92, 92, 92, 92, 92
|
||||
92, 92, 92, 92, 92, 92, 92
|
||||
};
|
||||
|
||||
/* Output a uint32 into a buffer (little-endian) */
|
||||
void buf_out_uint32(uint8 *buffer, uint32 value)
|
||||
void
|
||||
buf_out_uint32(uint8 *buffer, uint32 value)
|
||||
{
|
||||
buffer[0] = (value) & 0xff;
|
||||
buffer[1] = (value >> 8) & 0xff;
|
||||
@ -167,8 +170,9 @@ void buf_out_uint32(uint8 *buffer, uint32 value)
|
||||
}
|
||||
|
||||
/* Generate a signature hash, using a combination of SHA1 and MD5 */
|
||||
void sec_sign(uint8 *signature, uint8 *session_key, int length,
|
||||
uint8 *data, int datalen)
|
||||
void
|
||||
sec_sign(uint8 *signature, uint8 *session_key, int length,
|
||||
uint8 *data, int datalen)
|
||||
{
|
||||
uint8 shasig[20];
|
||||
uint8 md5sig[16];
|
||||
@ -195,7 +199,8 @@ void sec_sign(uint8 *signature, uint8 *session_key, int length,
|
||||
}
|
||||
|
||||
/* Update an encryption key - similar to the signing process */
|
||||
static void sec_update(uint8 *key, uint8 *update_key)
|
||||
static void
|
||||
sec_update(uint8 *key, uint8 *update_key)
|
||||
{
|
||||
uint8 shasig[20];
|
||||
SHA_CTX sha;
|
||||
@ -222,7 +227,8 @@ static void sec_update(uint8 *key, uint8 *update_key)
|
||||
}
|
||||
|
||||
/* Encrypt data using RC4 */
|
||||
static void sec_encrypt(uint8 *data, int length)
|
||||
static void
|
||||
sec_encrypt(uint8 *data, int length)
|
||||
{
|
||||
static int use_count;
|
||||
|
||||
@ -238,7 +244,8 @@ static void sec_encrypt(uint8 *data, int length)
|
||||
}
|
||||
|
||||
/* Decrypt data using RC4 */
|
||||
static void sec_decrypt(uint8 *data, int length)
|
||||
static void
|
||||
sec_decrypt(uint8 *data, int length)
|
||||
{
|
||||
static int use_count;
|
||||
|
||||
@ -254,7 +261,8 @@ static void sec_decrypt(uint8 *data, int length)
|
||||
}
|
||||
|
||||
/* Read in a NUMBER from a buffer */
|
||||
static void sec_read_number(NUMBER * num, uint8 *buffer, int len)
|
||||
static void
|
||||
sec_read_number(NUMBER * num, uint8 *buffer, int len)
|
||||
{
|
||||
INT *data = num->n_part;
|
||||
int i, j;
|
||||
@ -266,7 +274,8 @@ static void sec_read_number(NUMBER * num, uint8 *buffer, int len)
|
||||
}
|
||||
|
||||
/* Write a NUMBER to a buffer */
|
||||
static void sec_write_number(NUMBER * num, uint8 *buffer, int len)
|
||||
static void
|
||||
sec_write_number(NUMBER * num, uint8 *buffer, int len)
|
||||
{
|
||||
INT *data = num->n_part;
|
||||
int i, j;
|
||||
@ -279,8 +288,9 @@ static void sec_write_number(NUMBER * num, uint8 *buffer, int len)
|
||||
}
|
||||
|
||||
/* Perform an RSA public key encryption operation */
|
||||
static void sec_rsa_encrypt(uint8 *out, uint8 *in, int len,
|
||||
uint8 *modulus, uint8 *exponent)
|
||||
static void
|
||||
sec_rsa_encrypt(uint8 *out, uint8 *in, int len,
|
||||
uint8 *modulus, uint8 *exponent)
|
||||
{
|
||||
NUMBER data, key;
|
||||
|
||||
@ -296,7 +306,8 @@ static void sec_rsa_encrypt(uint8 *out, uint8 *in, int len,
|
||||
}
|
||||
|
||||
/* Initialise secure transport packet */
|
||||
STREAM sec_init(uint32 flags, int maxlen)
|
||||
STREAM
|
||||
sec_init(uint32 flags, int maxlen)
|
||||
{
|
||||
int hdrlen;
|
||||
STREAM s;
|
||||
@ -309,7 +320,8 @@ STREAM sec_init(uint32 flags, int maxlen)
|
||||
}
|
||||
|
||||
/* Transmit secure transport packet */
|
||||
void sec_send(STREAM s, uint32 flags)
|
||||
void
|
||||
sec_send(STREAM s, uint32 flags)
|
||||
{
|
||||
int datalen;
|
||||
|
||||
@ -334,7 +346,8 @@ void sec_send(STREAM s, uint32 flags)
|
||||
}
|
||||
|
||||
/* Transfer the client random to the server */
|
||||
static void sec_establish_key()
|
||||
static void
|
||||
sec_establish_key()
|
||||
{
|
||||
uint32 length = SEC_MODULUS_SIZE + SEC_PADDING_SIZE;
|
||||
uint32 flags = SEC_CLIENT_RANDOM;
|
||||
@ -351,7 +364,8 @@ static void sec_establish_key()
|
||||
}
|
||||
|
||||
/* Output connect initial data blob */
|
||||
static void sec_out_mcs_data(STREAM s)
|
||||
static void
|
||||
sec_out_mcs_data(STREAM s)
|
||||
{
|
||||
int hostlen = 2 * strlen(hostname);
|
||||
|
||||
@ -403,7 +417,8 @@ static void sec_out_mcs_data(STREAM s)
|
||||
}
|
||||
|
||||
/* Parse a public key structure */
|
||||
static BOOL sec_parse_public_key(STREAM s, uint8 **modulus, uint8 **exponent)
|
||||
static BOOL
|
||||
sec_parse_public_key(STREAM s, uint8 **modulus, uint8 **exponent)
|
||||
{
|
||||
uint32 magic, modulus_len;
|
||||
|
||||
@ -430,9 +445,9 @@ static BOOL sec_parse_public_key(STREAM s, uint8 **modulus, uint8 **exponent)
|
||||
}
|
||||
|
||||
/* Parse a crypto information structure */
|
||||
static BOOL sec_parse_crypt_info(STREAM s, uint32 *rc4_key_size,
|
||||
uint8 **server_random, uint8 **modulus,
|
||||
uint8 **exponent)
|
||||
static BOOL
|
||||
sec_parse_crypt_info(STREAM s, uint32 *rc4_key_size,
|
||||
uint8 **server_random, uint8 **modulus, uint8 **exponent)
|
||||
{
|
||||
uint32 crypt_level, random_len, rsa_info_len;
|
||||
uint16 tag, length;
|
||||
@ -490,7 +505,8 @@ static BOOL sec_parse_crypt_info(STREAM s, uint32 *rc4_key_size,
|
||||
}
|
||||
|
||||
/* Process crypto information blob */
|
||||
static void sec_process_crypt_info(STREAM s)
|
||||
static void
|
||||
sec_process_crypt_info(STREAM s)
|
||||
{
|
||||
uint8 *server_random, *modulus, *exponent;
|
||||
uint8 client_random[SEC_RANDOM_SIZE];
|
||||
@ -508,7 +524,8 @@ static void sec_process_crypt_info(STREAM s)
|
||||
}
|
||||
|
||||
/* Process connect response data blob */
|
||||
static void sec_process_mcs_data(STREAM s)
|
||||
static void
|
||||
sec_process_mcs_data(STREAM s)
|
||||
{
|
||||
uint16 tag, length;
|
||||
uint8 *next_tag;
|
||||
@ -544,7 +561,8 @@ static void sec_process_mcs_data(STREAM s)
|
||||
}
|
||||
|
||||
/* Receive secure transport packet */
|
||||
STREAM sec_recv()
|
||||
STREAM
|
||||
sec_recv()
|
||||
{
|
||||
uint32 sec_flags;
|
||||
STREAM s;
|
||||
@ -572,7 +590,8 @@ STREAM sec_recv()
|
||||
}
|
||||
|
||||
/* Establish a secure connection */
|
||||
BOOL sec_connect(char *server)
|
||||
BOOL
|
||||
sec_connect(char *server)
|
||||
{
|
||||
struct stream mcs_data;
|
||||
|
||||
@ -590,7 +609,8 @@ BOOL sec_connect(char *server)
|
||||
}
|
||||
|
||||
/* Disconnect a connection */
|
||||
void sec_disconnect()
|
||||
void
|
||||
sec_disconnect()
|
||||
{
|
||||
mcs_disconnect();
|
||||
}
|
||||
|
15
tcp.c
15
tcp.c
@ -33,7 +33,8 @@ static struct stream in;
|
||||
static struct stream out;
|
||||
|
||||
/* Initialise TCP transport data packet */
|
||||
STREAM tcp_init(int maxlen)
|
||||
STREAM
|
||||
tcp_init(int maxlen)
|
||||
{
|
||||
if (maxlen > out.size)
|
||||
{
|
||||
@ -47,7 +48,8 @@ STREAM tcp_init(int maxlen)
|
||||
}
|
||||
|
||||
/* Send TCP transport data packet */
|
||||
void tcp_send(STREAM s)
|
||||
void
|
||||
tcp_send(STREAM s)
|
||||
{
|
||||
int length = s->end - s->data;
|
||||
int sent, total = 0;
|
||||
@ -67,7 +69,8 @@ void tcp_send(STREAM s)
|
||||
}
|
||||
|
||||
/* Receive a message on the TCP layer */
|
||||
STREAM tcp_recv(int length)
|
||||
STREAM
|
||||
tcp_recv(int length)
|
||||
{
|
||||
int ret, rcvd = 0;
|
||||
struct timeval tv;
|
||||
@ -111,7 +114,8 @@ STREAM tcp_recv(int length)
|
||||
}
|
||||
|
||||
/* Establish a connection on the TCP layer */
|
||||
BOOL tcp_connect(char *server)
|
||||
BOOL
|
||||
tcp_connect(char *server)
|
||||
{
|
||||
struct hostent *nslookup;
|
||||
struct sockaddr_in servaddr;
|
||||
@ -159,7 +163,8 @@ BOOL tcp_connect(char *server)
|
||||
}
|
||||
|
||||
/* Disconnect on the TCP layer */
|
||||
void tcp_disconnect()
|
||||
void
|
||||
tcp_disconnect()
|
||||
{
|
||||
close(sock);
|
||||
}
|
||||
|
145
xwin.c
145
xwin.c
@ -32,7 +32,8 @@ static GC gc;
|
||||
static Visual *visual;
|
||||
static XIM IM;
|
||||
|
||||
BOOL ui_create_window(char *title)
|
||||
BOOL
|
||||
ui_create_window(char *title)
|
||||
{
|
||||
Screen *screen;
|
||||
XSetWindowAttributes attribs;
|
||||
@ -83,7 +84,8 @@ BOOL ui_create_window(char *title)
|
||||
return True;
|
||||
}
|
||||
|
||||
void ui_destroy_window()
|
||||
void
|
||||
ui_destroy_window()
|
||||
{
|
||||
XCloseIM(IM);
|
||||
XFreeGC(display, gc);
|
||||
@ -91,7 +93,8 @@ void ui_destroy_window()
|
||||
XCloseDisplay(display);
|
||||
}
|
||||
|
||||
static uint8 xwin_translate_key(unsigned long key)
|
||||
static uint8
|
||||
xwin_translate_key(unsigned long key)
|
||||
{
|
||||
DEBUG("KEY(code=0x%lx)\n", key);
|
||||
|
||||
@ -115,7 +118,8 @@ static uint8 xwin_translate_key(unsigned long key)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static uint16 xwin_translate_mouse(unsigned long button)
|
||||
static uint16
|
||||
xwin_translate_mouse(unsigned long button)
|
||||
{
|
||||
switch (button)
|
||||
{
|
||||
@ -130,7 +134,8 @@ static uint16 xwin_translate_mouse(unsigned long button)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ui_process_events()
|
||||
void
|
||||
ui_process_events()
|
||||
{
|
||||
XEvent event;
|
||||
uint8 scancode;
|
||||
@ -148,8 +153,8 @@ void ui_process_events()
|
||||
{
|
||||
case KeyPress:
|
||||
scancode =
|
||||
xwin_translate_key(event.xkey.
|
||||
keycode);
|
||||
xwin_translate_key(event.
|
||||
xkey.keycode);
|
||||
if (scancode == 0)
|
||||
break;
|
||||
|
||||
@ -159,8 +164,8 @@ void ui_process_events()
|
||||
|
||||
case KeyRelease:
|
||||
scancode =
|
||||
xwin_translate_key(event.xkey.
|
||||
keycode);
|
||||
xwin_translate_key(event.
|
||||
xkey.keycode);
|
||||
if (scancode == 0)
|
||||
break;
|
||||
|
||||
@ -171,8 +176,8 @@ void ui_process_events()
|
||||
|
||||
case ButtonPress:
|
||||
button =
|
||||
xwin_translate_mouse(event.xbutton.
|
||||
button);
|
||||
xwin_translate_mouse(event.
|
||||
xbutton.button);
|
||||
|
||||
if (button == 0)
|
||||
break;
|
||||
@ -185,8 +190,8 @@ void ui_process_events()
|
||||
|
||||
case ButtonRelease:
|
||||
button =
|
||||
xwin_translate_mouse(event.xbutton.
|
||||
button);
|
||||
xwin_translate_mouse(event.
|
||||
xbutton.button);
|
||||
if (button == 0)
|
||||
break;
|
||||
|
||||
@ -205,12 +210,14 @@ void ui_process_events()
|
||||
}
|
||||
}
|
||||
|
||||
void ui_move_pointer(int x, int y)
|
||||
void
|
||||
ui_move_pointer(int x, int y)
|
||||
{
|
||||
XWarpPointer(display, wnd, wnd, 0, 0, 0, 0, x, y);
|
||||
}
|
||||
|
||||
HBITMAP ui_create_bitmap(int width, int height, uint8 *data)
|
||||
HBITMAP
|
||||
ui_create_bitmap(int width, int height, uint8 *data)
|
||||
{
|
||||
XImage *image;
|
||||
Pixmap bitmap;
|
||||
@ -226,8 +233,9 @@ HBITMAP ui_create_bitmap(int width, int height, uint8 *data)
|
||||
return (HBITMAP) bitmap;
|
||||
}
|
||||
|
||||
void ui_paint_bitmap(int x, int y, int cx, int cy,
|
||||
int width, int height, uint8 *data)
|
||||
void
|
||||
ui_paint_bitmap(int x, int y, int cx, int cy,
|
||||
int width, int height, uint8 *data)
|
||||
{
|
||||
XImage *image;
|
||||
|
||||
@ -238,12 +246,14 @@ void ui_paint_bitmap(int x, int y, int cx, int cy,
|
||||
XFree(image);
|
||||
}
|
||||
|
||||
void ui_destroy_bitmap(HBITMAP bmp)
|
||||
void
|
||||
ui_destroy_bitmap(HBITMAP bmp)
|
||||
{
|
||||
XFreePixmap(display, (Pixmap) bmp);
|
||||
}
|
||||
|
||||
HGLYPH ui_create_glyph(int width, int height, uint8 *data)
|
||||
HGLYPH
|
||||
ui_create_glyph(int width, int height, uint8 *data)
|
||||
{
|
||||
XImage *image;
|
||||
Pixmap bitmap;
|
||||
@ -269,12 +279,14 @@ HGLYPH ui_create_glyph(int width, int height, uint8 *data)
|
||||
return (HGLYPH) bitmap;
|
||||
}
|
||||
|
||||
void ui_destroy_glyph(HGLYPH glyph)
|
||||
void
|
||||
ui_destroy_glyph(HGLYPH glyph)
|
||||
{
|
||||
XFreePixmap(display, (Pixmap) glyph);
|
||||
}
|
||||
|
||||
HCOLOURMAP ui_create_colourmap(COLOURMAP *colours)
|
||||
HCOLOURMAP
|
||||
ui_create_colourmap(COLOURMAP *colours)
|
||||
{
|
||||
COLOURENTRY *entry;
|
||||
XColor *xcolours, *xentry;
|
||||
@ -301,17 +313,20 @@ HCOLOURMAP ui_create_colourmap(COLOURMAP *colours)
|
||||
return (HCOLOURMAP) map;
|
||||
}
|
||||
|
||||
void ui_destroy_colourmap(HCOLOURMAP map)
|
||||
void
|
||||
ui_destroy_colourmap(HCOLOURMAP map)
|
||||
{
|
||||
XFreeColormap(display, (Colormap) map);
|
||||
}
|
||||
|
||||
void ui_set_colourmap(HCOLOURMAP map)
|
||||
void
|
||||
ui_set_colourmap(HCOLOURMAP map)
|
||||
{
|
||||
XSetWindowColormap(display, wnd, (Colormap) map);
|
||||
}
|
||||
|
||||
void ui_set_clip(int x, int y, int cx, int cy)
|
||||
void
|
||||
ui_set_clip(int x, int y, int cx, int cy)
|
||||
{
|
||||
XRectangle rect;
|
||||
|
||||
@ -322,7 +337,8 @@ void ui_set_clip(int x, int y, int cx, int cy)
|
||||
XSetClipRectangles(display, gc, 0, 0, &rect, 1, YXBanded);
|
||||
}
|
||||
|
||||
void ui_reset_clip()
|
||||
void
|
||||
ui_reset_clip()
|
||||
{
|
||||
XRectangle rect;
|
||||
|
||||
@ -333,7 +349,8 @@ void ui_reset_clip()
|
||||
XSetClipRectangles(display, gc, 0, 0, &rect, 1, YXBanded);
|
||||
}
|
||||
|
||||
void ui_bell()
|
||||
void
|
||||
ui_bell()
|
||||
{
|
||||
XBell(display, 0);
|
||||
}
|
||||
@ -357,22 +374,25 @@ static int rop2_map[] = {
|
||||
GXset /* 1 */
|
||||
};
|
||||
|
||||
static void xwin_set_function(uint8 rop2)
|
||||
static void
|
||||
xwin_set_function(uint8 rop2)
|
||||
{
|
||||
XSetFunction(display, gc, rop2_map[rop2]);
|
||||
}
|
||||
|
||||
void ui_destblt(uint8 opcode,
|
||||
/* dest */ int x, int y, int cx, int cy)
|
||||
void
|
||||
ui_destblt(uint8 opcode,
|
||||
/* dest */ int x, int y, int cx, int cy)
|
||||
{
|
||||
xwin_set_function(opcode);
|
||||
|
||||
XFillRectangle(display, wnd, gc, x, y, cx, cy);
|
||||
}
|
||||
|
||||
void ui_patblt(uint8 opcode,
|
||||
/* dest */ int x, int y, int cx, int cy,
|
||||
/* brush */ BRUSH *brush, int bgcolour, int fgcolour)
|
||||
void
|
||||
ui_patblt(uint8 opcode,
|
||||
/* dest */ int x, int y, int cx, int cy,
|
||||
/* brush */ BRUSH *brush, int bgcolour, int fgcolour)
|
||||
{
|
||||
Display *dpy = display;
|
||||
Pixmap fill;
|
||||
@ -405,28 +425,31 @@ void ui_patblt(uint8 opcode,
|
||||
}
|
||||
}
|
||||
|
||||
void ui_screenblt(uint8 opcode,
|
||||
/* dest */ int x, int y, int cx, int cy,
|
||||
/* src */ int srcx, int srcy)
|
||||
void
|
||||
ui_screenblt(uint8 opcode,
|
||||
/* dest */ int x, int y, int cx, int cy,
|
||||
/* src */ int srcx, int srcy)
|
||||
{
|
||||
xwin_set_function(opcode);
|
||||
|
||||
XCopyArea(display, wnd, wnd, gc, srcx, srcy, cx, cy, x, y);
|
||||
}
|
||||
|
||||
void ui_memblt(uint8 opcode,
|
||||
/* dest */ int x, int y, int cx, int cy,
|
||||
/* src */ HBITMAP src, int srcx, int srcy)
|
||||
void
|
||||
ui_memblt(uint8 opcode,
|
||||
/* dest */ int x, int y, int cx, int cy,
|
||||
/* src */ HBITMAP src, int srcx, int srcy)
|
||||
{
|
||||
xwin_set_function(opcode);
|
||||
|
||||
XCopyArea(display, (Pixmap) src, wnd, gc, srcx, srcy, cx, cy, x, y);
|
||||
}
|
||||
|
||||
void ui_triblt(uint8 opcode,
|
||||
/* dest */ int x, int y, int cx, int cy,
|
||||
/* src */ HBITMAP src, int srcx, int srcy,
|
||||
/* brush */ BRUSH *brush, int bgcolour, int fgcolour)
|
||||
void
|
||||
ui_triblt(uint8 opcode,
|
||||
/* dest */ int x, int y, int cx, int cy,
|
||||
/* src */ HBITMAP src, int srcx, int srcy,
|
||||
/* brush */ BRUSH *brush, int bgcolour, int fgcolour)
|
||||
{
|
||||
/* This is potentially difficult to do in general. Until someone
|
||||
comes up with a more efficient way of doing it I am using cases. */
|
||||
@ -453,9 +476,10 @@ void ui_triblt(uint8 opcode,
|
||||
}
|
||||
}
|
||||
|
||||
void ui_line(uint8 opcode,
|
||||
/* dest */ int startx, int starty, int endx, int endy,
|
||||
/* pen */ PEN *pen)
|
||||
void
|
||||
ui_line(uint8 opcode,
|
||||
/* dest */ int startx, int starty, int endx, int endy,
|
||||
/* pen */ PEN *pen)
|
||||
{
|
||||
xwin_set_function(opcode);
|
||||
|
||||
@ -463,9 +487,10 @@ void ui_line(uint8 opcode,
|
||||
XDrawLine(display, wnd, gc, startx, starty, endx, endy);
|
||||
}
|
||||
|
||||
void ui_rect(
|
||||
/* dest */ int x, int y, int cx, int cy,
|
||||
/* brush */ int colour)
|
||||
void
|
||||
ui_rect(
|
||||
/* dest */ int x, int y, int cx, int cy,
|
||||
/* brush */ int colour)
|
||||
{
|
||||
xwin_set_function(ROP2_COPY);
|
||||
|
||||
@ -473,10 +498,11 @@ void ui_rect(
|
||||
XFillRectangle(display, wnd, gc, x, y, cx, cy);
|
||||
}
|
||||
|
||||
void ui_draw_glyph(int mixmode,
|
||||
/* dest */ int x, int y, int cx, int cy,
|
||||
/* src */ HGLYPH glyph, int srcx, int srcy, int bgcolour,
|
||||
int fgcolour)
|
||||
void
|
||||
ui_draw_glyph(int mixmode,
|
||||
/* dest */ int x, int y, int cx, int cy,
|
||||
/* src */ HGLYPH glyph, int srcx, int srcy, int bgcolour,
|
||||
int fgcolour)
|
||||
{
|
||||
Pixmap pixmap = (Pixmap) glyph;
|
||||
|
||||
@ -505,10 +531,11 @@ void ui_draw_glyph(int mixmode,
|
||||
}
|
||||
}
|
||||
|
||||
void ui_draw_text(uint8 font, uint8 flags, int mixmode, int x, int y,
|
||||
int clipx, int clipy, int clipcx, int clipcy,
|
||||
int boxx, int boxy, int boxcx, int boxcy,
|
||||
int bgcolour, int fgcolour, uint8 *text, uint8 length)
|
||||
void
|
||||
ui_draw_text(uint8 font, uint8 flags, int mixmode, int x, int y,
|
||||
int clipx, int clipy, int clipcx, int clipcy,
|
||||
int boxx, int boxy, int boxcx, int boxcy,
|
||||
int bgcolour, int fgcolour, uint8 *text, uint8 length)
|
||||
{
|
||||
FONTGLYPH *glyph;
|
||||
int i;
|
||||
@ -544,7 +571,8 @@ void ui_draw_text(uint8 font, uint8 flags, int mixmode, int x, int y,
|
||||
}
|
||||
}
|
||||
|
||||
void ui_desktop_save(uint32 offset, int x, int y, int cx, int cy)
|
||||
void
|
||||
ui_desktop_save(uint32 offset, int x, int y, int cx, int cy)
|
||||
{
|
||||
XImage *image;
|
||||
|
||||
@ -554,7 +582,8 @@ void ui_desktop_save(uint32 offset, int x, int y, int cx, int cy)
|
||||
XFree(image);
|
||||
}
|
||||
|
||||
void ui_desktop_restore(uint32 offset, int x, int y, int cx, int cy)
|
||||
void
|
||||
ui_desktop_restore(uint32 offset, int x, int y, int cx, int cy)
|
||||
{
|
||||
XImage *image;
|
||||
uint8 *data;
|
||||
|
Loading…
Reference in New Issue
Block a user