HANDLER_ROUTINE fix

Francois Gouget fgouget at free.fr
Wed Sep 12 17:49:09 CDT 2001


   Btw, SetConsoleCtrlHandler uses a fixed size array for the list of
handler routines. Urgh!. Seems very ugly.
   New developpers, see:
   http://wine.codeweavers.com/bugzilla/show_bug.cgi?id=320


Changelog:

 * include/wincon.h,
   win32/console.c

   HANDLER_ROUTINE is in fact PHANDLER_ROUTINE


--
Francois Gouget         fgouget at free.fr        http://fgouget.free.fr/
      Any sufficiently advanced bug is indistinguishable from a feature.
                            -- from some indian guy
-------------- next part --------------
Index: include/wincon.h
===================================================================
RCS file: /home/wine/wine/include/wincon.h,v
retrieving revision 1.11
diff -u -r1.11 wincon.h
--- include/wincon.h	2001/04/12 21:07:25	1.11
+++ include/wincon.h	2001/09/12 18:18:33
@@ -18,7 +18,7 @@
 #define ENABLE_WRAP_AT_EOL_OUTPUT 0x02
 
 
-typedef BOOL HANDLER_ROUTINE(WORD);
+typedef BOOL (WINAPI *PHANDLER_ROUTINE)(DWORD);
 
 /* Attributes flags: */
 
@@ -222,7 +222,7 @@
 #define ScrollConsoleScreenBuffer WINELIB_NAME_AW(ScrollConsoleScreenBuffer)
 BOOL WINAPI SetConsoleActiveScreenBuffer( HANDLE hConsoleOutput);
 BOOL WINAPI SetConsoleCP(UINT cp);
-BOOL WINAPI SetConsoleCtrlHandler( HANDLER_ROUTINE *func, BOOL add);
+BOOL WINAPI SetConsoleCtrlHandler( PHANDLER_ROUTINE func, BOOL add);
 BOOL WINAPI SetConsoleCursorInfo( HANDLE hcon, LPCONSOLE_CURSOR_INFO cinfo);
 BOOL WINAPI SetConsoleMode( HANDLE hcon, DWORD mode);
 BOOL WINAPI SetConsoleOutputCP(UINT cp);
Index: win32/console.c
===================================================================
RCS file: /home/wine/wine/win32/console.c,v
retrieving revision 1.78
diff -u -r1.78 console.c
--- win32/console.c	2001/08/21 17:07:18	1.78
+++ win32/console.c	2001/09/12 18:18:37
@@ -364,10 +364,10 @@
  * This doesn't yet matter, since these handlers are not yet called...!
  */
 static unsigned int console_ignore_ctrl_c = 0;
-static HANDLER_ROUTINE *handlers[]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-BOOL WINAPI SetConsoleCtrlHandler( HANDLER_ROUTINE *func, BOOL add )
+static PHANDLER_ROUTINE handlers[]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+BOOL WINAPI SetConsoleCtrlHandler( PHANDLER_ROUTINE func, BOOL add )
 {
-  unsigned int alloc_loop = sizeof(handlers)/sizeof(HANDLER_ROUTINE *);
+  unsigned int alloc_loop = sizeof(handlers)/sizeof(PHANDLER_ROUTINE);
   unsigned int done = 0;
   FIXME("(%p,%i) - no error checking or testing yet\n", func, add);
   if (!func)


More information about the wine-patches mailing list