some other console fixes

eric pouech eric.pouech at wanadoo.fr
Wed Jan 2 16:08:48 CST 2002


eric pouech wrote:
> 
> eric pouech wrote:
> >
> > as spotted by Marcus, but only half done, the fg & bg colors were
> > inverted
> > moreover, this patch also some initialisation problems in wineconsole
> 
> hrmmm sounds like I forgot some part (one third ?) too...
> here it goes. alexandre, use this patch instead
ahum
since Marcus is faster at identifying bug than Alexandre is at
committing
patches, here's another slightly modified version with another bug fix
(the
crash when no command line was given)

A+
-- 
---------------
Eric Pouech (http://perso.wanadoo.fr/eric.pouech/)
"The future will be better tomorrow", Vice President Dan Quayle
-------------- next part --------------
Name: con_clr
ChangeLog: fixed color definition (bg and fg were swapped)
	fixed some initialisation issues
	fixed exit condition when nothing was allocated
GenDate: 2002/01/02 22:06:48 UTC
ModifiedFiles: server/console.c programs/wineconsole/user.c programs/wineconsole/dialog.c programs/wineconsole/registry.c programs/wineconsole/wineconsole.c
AddedFiles: 
===================================================================
RCS file: /usr/share/cvs/cvsroot/wine/wine/server/console.c,v
retrieving revision 1.32
diff -u -u -r1.32 console.c
--- server/console.c	2001/12/20 00:07:08	1.32
+++ server/console.c	2002/01/02 11:24:19
@@ -116,7 +116,7 @@
 
 static struct screen_buffer *screen_buffer_list;
 
-static const char_info_t empty_char_info = { ' ', 0x00f0 };  /* white on black space */
+static const char_info_t empty_char_info = { ' ', 0x000f };  /* white on black space */
 
 /* dumps the renderer events of a console */
 static void console_input_events_dump( struct object *obj, int verbose )
@@ -227,7 +227,7 @@
     screen_buffer->max_height     = 25;
     screen_buffer->cursor_x       = 0;
     screen_buffer->cursor_y       = 0;
-    screen_buffer->attr           = 0xF0;
+    screen_buffer->attr           = 0x0F;
     screen_buffer->win.left       = 0;
     screen_buffer->win.right      = screen_buffer->max_width - 1;
     screen_buffer->win.top        = 0;
Index: programs/wineconsole/user.c
===================================================================
RCS file: /usr/share/cvs/cvsroot/wine/wine/programs/wineconsole/user.c,v
retrieving revision 1.4
diff -u -u -r1.4 user.c
--- programs/wineconsole/user.c	2002/01/01 00:14:02	1.4
+++ programs/wineconsole/user.c	2002/01/01 16:30:49
@@ -1030,7 +1030,7 @@
 
     WNDCLASS		wndclass;
 
-    data->private = HeapAlloc(GetProcessHeap(), 0, sizeof(struct inner_data_user));
+    data->private = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct inner_data_user));
     if (!data->private) return FALSE;
 
     data->fnMainLoop = WCUSER_MainLoop;
Index: programs/wineconsole/dialog.c
===================================================================
RCS file: /usr/share/cvs/cvsroot/wine/wine/programs/wineconsole/dialog.c,v
retrieving revision 1.3
diff -u -u -r1.3 dialog.c
--- programs/wineconsole/dialog.c	2002/01/01 00:14:02	1.3
+++ programs/wineconsole/dialog.c	2002/01/01 16:00:40
@@ -521,8 +521,8 @@
 	di->hDlg = hDlg;
 	SetWindowLong(hDlg, DWL_USER, (DWORD)di);
 	fill_list_font(di);
-        SetWindowLong(GetDlgItem(hDlg, IDC_FNT_COLOR_BK), 0, di->config->def_attr & 0x0F);
-        SetWindowLong(GetDlgItem(hDlg, IDC_FNT_COLOR_FG), 0, (di->config->def_attr >> 4) & 0x0F);
+        SetWindowLong(GetDlgItem(hDlg, IDC_FNT_COLOR_BK), 0, (di->config->def_attr >> 4) & 0x0F);
+        SetWindowLong(GetDlgItem(hDlg, IDC_FNT_COLOR_FG), 0, di->config->def_attr & 0x0F);
 	break;
     case WM_COMMAND:
 	di = (struct dialog_info*)GetWindowLong(hDlg, DWL_USER);
@@ -559,8 +559,8 @@
 	    if (val < di->nFont) (di->apply)(di, hDlg, WCUSER_ApplyToFont, val);
 
             (di->apply)(di, hDlg, WCUSER_ApplyToAttribute, 
-                        GetWindowLong(GetDlgItem(hDlg, IDC_FNT_COLOR_BK), 0) | 
-                        (GetWindowLong(GetDlgItem(hDlg, IDC_FNT_COLOR_FG), 0) << 4));
+                        (GetWindowLong(GetDlgItem(hDlg, IDC_FNT_COLOR_BK), 0) << 4) |
+                        GetWindowLong(GetDlgItem(hDlg, IDC_FNT_COLOR_FG), 0));
 
             SetWindowLong(hDlg, DWL_MSGRESULT, PSNRET_NOERROR);
 	    return TRUE;
Index: programs/wineconsole/registry.c
===================================================================
RCS file: /usr/share/cvs/cvsroot/wine/wine/programs/wineconsole/registry.c,v
retrieving revision 1.1
diff -u -u -r1.1 registry.c
--- programs/wineconsole/registry.c	2001/12/04 20:46:54	1.1
+++ programs/wineconsole/registry.c	2002/01/01 16:29:28
@@ -72,18 +72,18 @@
 
     count = sizeof(val);
     if (!hConKey || RegQueryValueEx(hConKey, wszScreenBufferSize, 0, &type, (char*)&val, &count)) 
-        val = 0x000C0008;
+        val = 0x00190050;
     cfg->sb_height = HIWORD(val);
     cfg->sb_width  = LOWORD(val);
 
     count = sizeof(val);
     if (!hConKey || RegQueryValueEx(hConKey, wszScreenColors, 0, &type, (char*)&val, &count)) 
-        val = 0x0007;
+        val = 0x000F;
     cfg->def_attr = val;
 
     count = sizeof(val);
     if (!hConKey || RegQueryValueEx(hConKey, wszWindowSize, 0, &type, (char*)&val, &count)) 
-        val = 0x000C0008;
+        val = 0x00190050;
     cfg->win_height = HIWORD(val);
     cfg->win_width  = LOWORD(val);
 
Index: programs/wineconsole/wineconsole.c
===================================================================
RCS file: /usr/share/cvs/cvsroot/wine/wine/programs/wineconsole/wineconsole.c,v
retrieving revision 1.5
diff -u -u -r1.5 wineconsole.c
--- programs/wineconsole/wineconsole.c	2001/12/26 19:48:16	1.5
+++ programs/wineconsole/wineconsole.c	2002/01/02 21:55:03
@@ -307,7 +307,7 @@
     if (data->hConOut)		CloseHandle(data->hConOut);
     if (data->hSynchro)		CloseHandle(data->hSynchro);
     if (data->cells)		HeapFree(GetProcessHeap(), 0, data->cells);
-    data->fnDeleteBackend(data);
+    if (data->fnDeleteBackend)  data->fnDeleteBackend(data);
     HeapFree(GetProcessHeap(), 0, data);
 }
 


More information about the wine-patches mailing list