more g_ prefix for global vars

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@437 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Jay Sorg 2003-08-01 17:01:58 +00:00
parent de7a67cd41
commit d49e190f92
8 changed files with 58 additions and 58 deletions

View File

@ -27,7 +27,7 @@
#define CHANNEL_FLAG_LAST 0x02 #define CHANNEL_FLAG_LAST 0x02
#define CHANNEL_FLAG_SHOW_PROTOCOL 0x10 #define CHANNEL_FLAG_SHOW_PROTOCOL 0x10
extern BOOL use_rdp5; extern BOOL g_use_rdp5;
extern BOOL g_encryption; extern BOOL g_encryption;
VCHANNEL g_channels[MAX_CHANNELS]; VCHANNEL g_channels[MAX_CHANNELS];
@ -48,7 +48,7 @@ channel_register(char *name, uint32 flags, void (*callback) (STREAM))
{ {
VCHANNEL *channel; VCHANNEL *channel;
if (!use_rdp5) if (!g_use_rdp5)
return NULL; return NULL;
if (g_num_channels >= MAX_CHANNELS) if (g_num_channels >= MAX_CHANNELS)

View File

@ -21,9 +21,9 @@
#include "rdesktop.h" #include "rdesktop.h"
#include "orders.h" #include "orders.h"
extern uint8 *next_packet; extern uint8 *g_next_packet;
static RDP_ORDER_STATE g_order_state; static RDP_ORDER_STATE g_order_state;
extern BOOL use_rdp5; extern BOOL g_use_rdp5;
/* Read field indicating which parameters are present */ /* Read field indicating which parameters are present */
static void static void
@ -695,7 +695,7 @@ process_bmpcache(STREAM s)
in_uint16_le(s, bufsize); /* bufsize */ in_uint16_le(s, bufsize); /* bufsize */
in_uint16_le(s, cache_idx); in_uint16_le(s, cache_idx);
if (!use_rdp5) if (!g_use_rdp5)
{ {
/* Begin compressedBitmapData */ /* Begin compressedBitmapData */
@ -949,8 +949,8 @@ process_orders(STREAM s, uint16 num_orders)
processed++; processed++;
} }
if (s->p != next_packet) if (s->p != g_next_packet)
error("%d bytes remaining\n", (int) (next_packet - s->p)); error("%d bytes remaining\n", (int) (g_next_packet - s->p));
} }
/* Reset order state */ /* Reset order state */

View File

@ -49,18 +49,18 @@ int width = 800; /* If width or height are reset to zero, the geometry will
be fetched from _NET_WORKAREA */ be fetched from _NET_WORKAREA */
int height = 600; int height = 600;
int tcp_port_rdp = TCP_PORT_RDP; int tcp_port_rdp = TCP_PORT_RDP;
int server_bpp = 8; int g_server_bpp = 8;
int win_button_size = 0; /* If zero, disable single app mode */ int win_button_size = 0; /* If zero, disable single app mode */
BOOL g_bitmap_compression = True; BOOL g_bitmap_compression = True;
BOOL sendmotion = True; BOOL sendmotion = True;
BOOL g_orders = True; BOOL g_orders = True;
BOOL g_encryption = True; BOOL g_encryption = True;
BOOL packet_encryption = True; BOOL packet_encryption = True;
BOOL desktop_save = True; BOOL g_desktop_save = True;
BOOL fullscreen = False; BOOL fullscreen = False;
BOOL grab_keyboard = True; BOOL grab_keyboard = True;
BOOL hide_decorations = False; BOOL hide_decorations = False;
BOOL use_rdp5 = False; BOOL g_use_rdp5 = False;
extern BOOL owncolmap; extern BOOL owncolmap;
#ifdef RDP2VNC #ifdef RDP2VNC
@ -298,9 +298,9 @@ main(int argc, char *argv[])
break; break;
case 'a': case 'a':
server_bpp = strtol(optarg, NULL, 10); g_server_bpp = strtol(optarg, NULL, 10);
if (server_bpp != 8 && server_bpp != 16 && server_bpp != 15 if (g_server_bpp != 8 && g_server_bpp != 16 && g_server_bpp != 15
&& server_bpp != 24) && g_server_bpp != 24)
{ {
error("invalid server bpp\n"); error("invalid server bpp\n");
return 1; return 1;
@ -308,7 +308,7 @@ main(int argc, char *argv[])
break; break;
case '5': case '5':
use_rdp5 = True; g_use_rdp5 = True;
break; break;
case 'h': case 'h':
case '?': case '?':

46
rdp.c
View File

@ -25,16 +25,16 @@ extern char g_username[16];
extern BOOL g_bitmap_compression; extern BOOL g_bitmap_compression;
extern BOOL g_orders; extern BOOL g_orders;
extern BOOL g_encryption; extern BOOL g_encryption;
extern BOOL desktop_save; extern BOOL g_desktop_save;
extern BOOL use_rdp5; extern BOOL g_use_rdp5;
extern uint16 server_rdp_version; extern uint16 g_server_rdp_version;
extern int server_bpp; extern int g_server_bpp;
uint8 *next_packet; uint8 *g_next_packet;
uint32 rdp_shareid; uint32 g_rdp_shareid;
#if WITH_DEBUG #if WITH_DEBUG
static uint32 packetno; static uint32 g_packetno;
#endif #endif
/* Receive an RDP packet */ /* Receive an RDP packet */
@ -44,24 +44,24 @@ rdp_recv(uint8 * type)
static STREAM rdp_s; static STREAM rdp_s;
uint16 length, pdu_type; uint16 length, pdu_type;
if ((rdp_s == NULL) || (next_packet >= rdp_s->end)) if ((rdp_s == NULL) || (g_next_packet >= rdp_s->end))
{ {
rdp_s = sec_recv(); rdp_s = sec_recv();
if (rdp_s == NULL) if (rdp_s == NULL)
return NULL; return NULL;
next_packet = rdp_s->p; g_next_packet = rdp_s->p;
} }
else else
{ {
rdp_s->p = next_packet; rdp_s->p = g_next_packet;
} }
in_uint16_le(rdp_s, length); in_uint16_le(rdp_s, length);
/* 32k packets are really 8, keepalive fix */ /* 32k packets are really 8, keepalive fix */
if (length == 0x8000) if (length == 0x8000)
{ {
next_packet += 8; g_next_packet += 8;
*type = 0; *type = 0;
return rdp_s; return rdp_s;
} }
@ -70,11 +70,11 @@ rdp_recv(uint8 * type)
*type = pdu_type & 0xf; *type = pdu_type & 0xf;
#if WITH_DEBUG #if WITH_DEBUG
DEBUG(("RDP packet #%d, (type %x)\n", ++packetno, *type)); DEBUG(("RDP packet #%d, (type %x)\n", ++g_packetno, *type));
// hexdump(next_packet, length); // hexdump(g_next_packet, length);
#endif /* */ #endif /* */
next_packet += length; g_next_packet += length;
return rdp_s; return rdp_s;
} }
@ -103,7 +103,7 @@ rdp_send_data(STREAM s, uint8 data_pdu_type)
out_uint16_le(s, (RDP_PDU_DATA | 0x10)); out_uint16_le(s, (RDP_PDU_DATA | 0x10));
out_uint16_le(s, (g_mcs_userid + 1001)); out_uint16_le(s, (g_mcs_userid + 1001));
out_uint32_le(s, rdp_shareid); out_uint32_le(s, g_rdp_shareid);
out_uint8(s, 0); /* pad */ out_uint8(s, 0); /* pad */
out_uint8(s, 1); /* streamid */ out_uint8(s, 1); /* streamid */
out_uint16_le(s, (length - 14)); out_uint16_le(s, (length - 14));
@ -147,7 +147,7 @@ rdp_send_logon_info(uint32 flags, char *domain, char *user,
uint32 sec_flags = g_encryption ? (SEC_LOGON_INFO | SEC_ENCRYPT) : SEC_LOGON_INFO; uint32 sec_flags = g_encryption ? (SEC_LOGON_INFO | SEC_ENCRYPT) : SEC_LOGON_INFO;
STREAM s; STREAM s;
if (!use_rdp5 || 1 == server_rdp_version) if (!g_use_rdp5 || 1 == g_server_rdp_version)
{ {
DEBUG_RDP5(("Sending RDP4-style Logon packet\n")); DEBUG_RDP5(("Sending RDP4-style Logon packet\n"));
@ -358,7 +358,7 @@ rdp_out_general_caps(STREAM s)
out_uint16_le(s, 0x200); /* Protocol version */ out_uint16_le(s, 0x200); /* Protocol version */
out_uint16(s, 0); /* Pad */ out_uint16(s, 0); /* Pad */
out_uint16(s, 0); /* Compression types */ out_uint16(s, 0); /* Compression types */
out_uint16_le(s, use_rdp5 ? 0x40d : 0); out_uint16_le(s, g_use_rdp5 ? 0x40d : 0);
/* Pad, according to T.128. 0x40d seems to /* Pad, according to T.128. 0x40d seems to
trigger trigger
the server to start sending RDP5 packets. the server to start sending RDP5 packets.
@ -408,7 +408,7 @@ rdp_out_order_caps(STREAM s)
order_caps[8] = 1; /* line */ order_caps[8] = 1; /* line */
order_caps[9] = 1; /* line */ order_caps[9] = 1; /* line */
order_caps[10] = 1; /* rect */ order_caps[10] = 1; /* rect */
order_caps[11] = (desktop_save == False ? 0 : 1); /* desksave */ order_caps[11] = (g_desktop_save == False ? 0 : 1); /* desksave */
order_caps[13] = 1; /* memblt */ order_caps[13] = 1; /* memblt */
order_caps[14] = 1; /* triblt */ order_caps[14] = 1; /* triblt */
order_caps[22] = 1; /* polyline */ order_caps[22] = 1; /* polyline */
@ -426,7 +426,7 @@ rdp_out_order_caps(STREAM s)
out_uint8p(s, order_caps, 32); /* Orders supported */ out_uint8p(s, order_caps, 32); /* Orders supported */
out_uint16_le(s, 0x6a1); /* Text capability flags */ out_uint16_le(s, 0x6a1); /* Text capability flags */
out_uint8s(s, 6); /* Pad */ out_uint8s(s, 6); /* Pad */
out_uint32_le(s, desktop_save == False ? 0 : 0x38400); /* Desktop cache size */ out_uint32_le(s, g_desktop_save == False ? 0 : 0x38400); /* Desktop cache size */
out_uint32(s, 0); /* Unknown */ out_uint32(s, 0); /* Unknown */
out_uint32_le(s, 0x4e4); /* Unknown */ out_uint32_le(s, 0x4e4); /* Unknown */
} }
@ -439,7 +439,7 @@ rdp_out_bmpcache_caps(STREAM s)
out_uint16_le(s, RDP_CAPSET_BMPCACHE); out_uint16_le(s, RDP_CAPSET_BMPCACHE);
out_uint16_le(s, RDP_CAPLEN_BMPCACHE); out_uint16_le(s, RDP_CAPLEN_BMPCACHE);
Bpp = (server_bpp + 7) / 8; Bpp = (g_server_bpp + 7) / 8;
out_uint8s(s, 24); /* unused */ out_uint8s(s, 24); /* unused */
out_uint16_le(s, 0x258); /* entries */ out_uint16_le(s, 0x258); /* entries */
out_uint16_le(s, 0x100 * Bpp); /* max cell size */ out_uint16_le(s, 0x100 * Bpp); /* max cell size */
@ -559,7 +559,7 @@ rdp_send_confirm_active(void)
out_uint16_le(s, (RDP_PDU_CONFIRM_ACTIVE | 0x10)); /* Version 1 */ out_uint16_le(s, (RDP_PDU_CONFIRM_ACTIVE | 0x10)); /* Version 1 */
out_uint16_le(s, (g_mcs_userid + 1001)); out_uint16_le(s, (g_mcs_userid + 1001));
out_uint32_le(s, rdp_shareid); out_uint32_le(s, g_rdp_shareid);
out_uint16_le(s, 0x3ea); /* userid */ out_uint16_le(s, 0x3ea); /* userid */
out_uint16_le(s, sizeof(RDP_SOURCE)); out_uint16_le(s, sizeof(RDP_SOURCE));
out_uint16_le(s, caplen); out_uint16_le(s, caplen);
@ -589,9 +589,9 @@ process_demand_active(STREAM s)
{ {
uint8 type; uint8 type;
in_uint32_le(s, rdp_shareid); in_uint32_le(s, g_rdp_shareid);
DEBUG(("DEMAND_ACTIVE(id=0x%x)\n", rdp_shareid)); DEBUG(("DEMAND_ACTIVE(id=0x%x)\n", g_rdp_shareid));
rdp_send_confirm_active(); rdp_send_confirm_active();
rdp_send_synchronise(); rdp_send_synchronise();

4
rdp5.c
View File

@ -21,7 +21,7 @@
#include "rdesktop.h" #include "rdesktop.h"
extern uint8 *next_packet; extern uint8 *g_next_packet;
void void
rdp5_process(STREAM s, BOOL encryption) rdp5_process(STREAM s, BOOL encryption)
@ -45,7 +45,7 @@ rdp5_process(STREAM s, BOOL encryption)
{ {
in_uint8(s, type); in_uint8(s, type);
in_uint16_le(s, length); in_uint16_le(s, length);
next_packet = next = s->p + length; g_next_packet = next = s->p + length;
switch (type) switch (type)
{ {

View File

@ -39,8 +39,8 @@ extern int height;
extern int keylayout; extern int keylayout;
extern BOOL g_encryption; extern BOOL g_encryption;
extern BOOL g_licence_issued; extern BOOL g_licence_issued;
extern BOOL use_rdp5; extern BOOL g_use_rdp5;
extern int server_bpp; extern int g_server_bpp;
extern uint16 mcs_userid; extern uint16 mcs_userid;
extern VCHANNEL g_channels[]; extern VCHANNEL g_channels[];
extern unsigned int g_num_channels; extern unsigned int g_num_channels;
@ -57,7 +57,7 @@ static uint8 sec_decrypt_update_key[16];
static uint8 sec_encrypt_update_key[16]; static uint8 sec_encrypt_update_key[16];
static uint8 sec_crypted_random[SEC_MODULUS_SIZE]; static uint8 sec_crypted_random[SEC_MODULUS_SIZE];
uint16 server_rdp_version = 0; uint16 g_server_rdp_version = 0;
/* /*
* General purpose 48-byte transformation, using two 32-byte salts (generally, * General purpose 48-byte transformation, using two 32-byte salts (generally,
@ -430,7 +430,7 @@ sec_out_mcs_data(STREAM s)
/* Client information */ /* Client information */
out_uint16_le(s, SEC_TAG_CLI_INFO); out_uint16_le(s, SEC_TAG_CLI_INFO);
out_uint16_le(s, 212); /* length */ out_uint16_le(s, 212); /* length */
out_uint16_le(s, use_rdp5 ? 4 : 1); /* RDP version. 1 == RDP4, 4 == RDP5. */ out_uint16_le(s, g_use_rdp5 ? 4 : 1); /* RDP version. 1 == RDP4, 4 == RDP5. */
out_uint16_le(s, 8); out_uint16_le(s, 8);
out_uint16_le(s, width); out_uint16_le(s, width);
out_uint16_le(s, height); out_uint16_le(s, height);
@ -448,7 +448,7 @@ sec_out_mcs_data(STREAM s)
out_uint32_le(s, 12); out_uint32_le(s, 12);
out_uint8s(s, 64); /* reserved? 4 + 12 doublewords */ out_uint8s(s, 64); /* reserved? 4 + 12 doublewords */
switch (server_bpp) switch (g_server_bpp)
{ {
case 8: case 8:
out_uint16_le(s, 0xca01); out_uint16_le(s, 0xca01);
@ -466,7 +466,7 @@ sec_out_mcs_data(STREAM s)
out_uint16_le(s, 1); out_uint16_le(s, 1);
out_uint32(s, 0); out_uint32(s, 0);
out_uint8(s, server_bpp); out_uint8(s, g_server_bpp);
out_uint16_le(s, 0x0700); out_uint16_le(s, 0x0700);
out_uint8(s, 0); out_uint8(s, 0);
out_uint32_le(s, 1); out_uint32_le(s, 1);
@ -736,10 +736,10 @@ sec_process_crypt_info(STREAM s)
static void static void
sec_process_srv_info(STREAM s) sec_process_srv_info(STREAM s)
{ {
in_uint16_le(s, server_rdp_version); in_uint16_le(s, g_server_rdp_version);
DEBUG_RDP5(("Server RDP version is %d\n", server_rdp_version)); DEBUG_RDP5(("Server RDP version is %d\n", g_server_rdp_version));
if (1 == server_rdp_version) if (1 == g_server_rdp_version)
use_rdp5 = 0; g_use_rdp5 = 0;
} }

14
xwin.c
View File

@ -32,7 +32,7 @@ extern BOOL fullscreen;
extern BOOL grab_keyboard; extern BOOL grab_keyboard;
extern BOOL hide_decorations; extern BOOL hide_decorations;
extern char title[]; extern char title[];
extern int server_bpp; extern int g_server_bpp;
extern int win_button_size; extern int win_button_size;
BOOL enable_compose = False; BOOL enable_compose = False;
BOOL focused; BOOL focused;
@ -105,7 +105,7 @@ BOOL owncolmap = False;
static Colormap xcolmap; static Colormap xcolmap;
static uint32 *colmap; static uint32 *colmap;
#define TRANSLATE(col) ( server_bpp != 8 ? translate_colour(col) : owncolmap ? col : translate_colour(colmap[col]) ) #define TRANSLATE(col) ( g_server_bpp != 8 ? translate_colour(col) : owncolmap ? col : translate_colour(colmap[col]) )
#define SET_FOREGROUND(col) XSetForeground(display, gc, TRANSLATE(col)); #define SET_FOREGROUND(col) XSetForeground(display, gc, TRANSLATE(col));
#define SET_BACKGROUND(col) XSetBackground(display, gc, TRANSLATE(col)); #define SET_BACKGROUND(col) XSetBackground(display, gc, TRANSLATE(col));
@ -218,7 +218,7 @@ make_colour32(PixelColour pc)
static uint32 static uint32
translate_colour(uint32 colour) translate_colour(uint32 colour)
{ {
switch (server_bpp) switch (g_server_bpp)
{ {
case 15: case 15:
switch (bpp) switch (bpp)
@ -419,7 +419,7 @@ translate_image(int width, int height, uint8 * data)
uint8 *out = (uint8 *) xmalloc(size); uint8 *out = (uint8 *) xmalloc(size);
uint8 *end = out + size; uint8 *end = out + size;
switch (server_bpp) switch (g_server_bpp)
{ {
case 24: case 24:
switch (bpp) switch (bpp)
@ -616,7 +616,7 @@ ui_init(void)
xclip_init(); xclip_init();
/* todo take this out when high colour is done */ /* todo take this out when high colour is done */
printf("server bpp %d client bpp %d depth %d\n", server_bpp, bpp, depth); printf("server bpp %d client bpp %d depth %d\n", g_server_bpp, bpp, depth);
return True; return True;
} }
@ -1069,7 +1069,7 @@ ui_create_bitmap(int width, int height, uint8 * data)
tdata = (owncolmap ? data : translate_image(width, height, data)); tdata = (owncolmap ? data : translate_image(width, height, data));
bitmap = XCreatePixmap(display, wnd, width, height, depth); bitmap = XCreatePixmap(display, wnd, width, height, depth);
image = XCreateImage(display, visual, depth, ZPixmap, 0, image = XCreateImage(display, visual, depth, ZPixmap, 0,
(char *) tdata, width, height, server_bpp == 8 ? 8 : bpp, 0); (char *) tdata, width, height, g_server_bpp == 8 ? 8 : bpp, 0);
XPutImage(display, bitmap, gc, image, 0, 0, 0, 0, width, height); XPutImage(display, bitmap, gc, image, 0, 0, 0, 0, width, height);
@ -1086,7 +1086,7 @@ ui_paint_bitmap(int x, int y, int cx, int cy, int width, int height, uint8 * dat
uint8 *tdata; uint8 *tdata;
tdata = (owncolmap ? data : translate_image(width, height, data)); tdata = (owncolmap ? data : translate_image(width, height, data));
image = XCreateImage(display, visual, depth, ZPixmap, 0, image = XCreateImage(display, visual, depth, ZPixmap, 0,
(char *) tdata, width, height, server_bpp == 8 ? 8 : bpp, 0); (char *) tdata, width, height, g_server_bpp == 8 ? 8 : bpp, 0);
if (ownbackstore) if (ownbackstore)
{ {