fix some crashes and added some debug messages

ulab-original
jsorg71 20 years ago
parent cf6e2abd41
commit 8f2b4512cf

@ -11,6 +11,7 @@ XRDPOBJ = ../common/os_calls.o \
CFLAGS = -Wall -O2 -I../common CFLAGS = -Wall -O2 -I../common
LDFLAGS = -L /usr/gnu/lib LDFLAGS = -L /usr/gnu/lib
LIBS = -lpthread -lcrypto LIBS = -lpthread -lcrypto
#CC = g++
CC = gcc CC = gcc
all: xrdp all: xrdp

@ -403,7 +403,7 @@ int xrdp_login_wnd_create(struct xrdp_wm* self)
but->id = 4; but->id = 4;
but->pointer = 1; but->pointer = 1;
but->tab_stop = 1; but->tab_stop = 1;
but->caption1 = g_malloc(256, 1); but->caption1 = (char*)g_malloc(256, 1);
self->login_window->focused_control = but; self->login_window->focused_control = but;
/* label */ /* label */
@ -425,7 +425,7 @@ int xrdp_login_wnd_create(struct xrdp_wm* self)
but->id = 5; but->id = 5;
but->pointer = 1; but->pointer = 1;
but->tab_stop = 1; but->tab_stop = 1;
but->caption1 = g_malloc(256, 1); but->caption1 = (char*)g_malloc(256, 1);
but->password_char = '*'; but->password_char = '*';
/* label */ /* label */

@ -75,9 +75,10 @@ int xrdp_orders_send(struct xrdp_orders* self)
if (self->order_level > 0) if (self->order_level > 0)
{ {
self->order_level--; self->order_level--;
if (self->order_level == 0) if (self->order_level == 0 && self->order_count > 0)
{ {
s_mark_end(self->out_s); s_mark_end(self->out_s);
DEBUG(("xrdp_orders_send sending %d orders\n\r", self->order_count));
self->order_count_ptr[0] = self->order_count; self->order_count_ptr[0] = self->order_count;
self->order_count_ptr[1] = self->order_count >> 8; self->order_count_ptr[1] = self->order_count >> 8;
if (xrdp_rdp_send_data(self->rdp_layer, self->out_s, if (xrdp_rdp_send_data(self->rdp_layer, self->out_s,
@ -97,6 +98,7 @@ int xrdp_orders_force_send(struct xrdp_orders* self)
if (self->order_count > 0) if (self->order_count > 0)
{ {
s_mark_end(self->out_s); s_mark_end(self->out_s);
DEBUG(("xrdp_orders_force_send sending %d orders\n\r", self->order_count));
self->order_count_ptr[0] = self->order_count; self->order_count_ptr[0] = self->order_count;
self->order_count_ptr[1] = self->order_count >> 8; self->order_count_ptr[1] = self->order_count >> 8;
if (xrdp_rdp_send_data(self->rdp_layer, self->out_s, if (xrdp_rdp_send_data(self->rdp_layer, self->out_s,
@ -1469,7 +1471,6 @@ int xrdp_orders_send_bitmap(struct xrdp_orders* self,
return 1; return 1;
} }
bufsize = s->p - p; bufsize = s->p - p;
//g_printf("bufsize %d\n", bufsize);
Bpp = (bitmap->bpp + 7) / 8; Bpp = (bitmap->bpp + 7) / 8;
xrdp_orders_check(self, bufsize + 16); xrdp_orders_check(self, bufsize + 16);
self->order_count++; self->order_count++;

@ -381,6 +381,20 @@ int xrdp_painter_draw_bitmap(struct xrdp_painter* self,
y1 = 0; y1 = 0;
} }
//g_printf("%d %d %d %d %d %d\n", x1, y1, w, h, srcx, srcy); //g_printf("%d %d %d %d %d %d\n", x1, y1, w, h, srcx, srcy);
DEBUG(("sending memblt order \n\r\
cache_id %d\n\r\
palette_id %d\n\r\
x %d\n\r\
y %d\n\r\
cx %d\n\r\
cy %d\n\r\
rop %d\n\r\
srcx %d\n\r\
srcy %d\n\r\
cache_idx %d\n\r",
cache_id, palette_id,
x1, y1, w, h, self->rop, srcx, srcy,
cache_idx));
xrdp_orders_mem_blt(self->orders, cache_id, palette_id, xrdp_orders_mem_blt(self->orders, cache_id, palette_id,
x1, y1, w, h, self->rop, srcx, srcy, x1, y1, w, h, self->rop, srcx, srcy,
cache_idx, &rect1); cache_idx, &rect1);
@ -554,19 +568,27 @@ int xrdp_painter_draw_text(struct xrdp_painter* self,
y1 = y + total_height; y1 = y + total_height;
draw_rect.right--; draw_rect.right--;
draw_rect.bottom--; draw_rect.bottom--;
flags = 0x03; /* 0x73; TEXT2_IMPLICIT_X and something else */ flags = 0x03; /* 0x03 0x73; TEXT2_IMPLICIT_X and something else */
DEBUG(("sending text order \ DEBUG(("sending text order\n\r\
font %d flags %d mixmode %d color1 %d color2 %d \ font %d\n\r\
clip left %d clip top %d clip right %d clip bottom %d \ flags %d\n\r\
box left %d box top %d box right %d box bottom %d \ mixmode %d\n\r\
x %d y %d len %d rect %d %d %d %d\n\r", color1 %d\n\r\
f, flags, 0, font->color, 0, x, y, x + total_width, color2 %d\n\r\
y + total_height, 0, 0, 0, 0, x1, y1, len, clip box %d %d %d %d\n\r\
box box %d %d %d %d\n\r\
x %d\n\r\
y %d\n\r\
len %d\n\r\
rect %d %d %d %d\n\r",
f, flags, 0, font->color, 0, x, y,
x + total_width, y + total_height,
0, 0, 0, 0, x1, y1, len,
draw_rect.left, draw_rect.top, draw_rect.left, draw_rect.top,
draw_rect.right, draw_rect.bottom)); draw_rect.right, draw_rect.bottom));
xrdp_orders_text(self->orders, f, flags, 0, xrdp_orders_text(self->orders, f, flags, 0,
font->color, 0, font->color, 0,
x, y, x + total_width, y + total_height, x - 1, y - 1, x + total_width, y + total_height,
0, 0, 0, 0, 0, 0, 0, 0,
x1, y1, data, len * 2, &draw_rect); x1, y1, data, len * 2, &draw_rect);
} }

@ -546,6 +546,13 @@ int xrdp_wm_init(struct xrdp_wm* self)
self->red = COLOR24(0xff, 0x00, 0x00); self->red = COLOR24(0xff, 0x00, 0x00);
self->green = COLOR24(0x00, 0xff, 0x00); self->green = COLOR24(0x00, 0xff, 0x00);
} }
DEBUG(("sending cursor\n\r"));
xrdp_wm_load_pointer(self, "cursor1.cur", data, mask, &x, &y);
xrdp_wm_send_pointer(self, 1, data, mask, x, y);
DEBUG(("sending cursor\n\r"));
xrdp_wm_load_pointer(self, "cursor0.cur", data, mask, &x, &y);
xrdp_wm_send_pointer(self, 0, data, mask, x, y);
xrdp_login_wnd_create(self); xrdp_login_wnd_create(self);
/* clear screen */ /* clear screen */
self->screen->bg_color = self->black; self->screen->bg_color = self->black;
@ -553,10 +560,6 @@ int xrdp_wm_init(struct xrdp_wm* self)
xrdp_wm_set_focused(self, self->login_window); xrdp_wm_set_focused(self, self->login_window);
xrdp_wm_load_pointer(self, "cursor1.cur", data, mask, &x, &y);
xrdp_wm_send_pointer(self, 1, data, mask, x, y);
xrdp_wm_load_pointer(self, "cursor0.cur", data, mask, &x, &y);
xrdp_wm_send_pointer(self, 0, data, mask, x, y);
#endif #endif
return 0; return 0;
} }

Loading…
Cancel
Save