ChangeLog entry: win32/console.c, dlls/winedos/vga.c, dlls/winedos/vga.h, dlls/winedos/int10.c, loader/module.c, dlls/winmm/winearts/audio.c: Chris Morgan <cmorgan@alum.wpi.edu> Some dos VGA error handling. Misc TRACE changes.
Index: win32/console.c =================================================================== RCS file: /home/wine/wine/win32/console.c,v retrieving revision 1.97 diff -u -r1.97 console.c --- win32/console.c 23 Jul 2002 20:54:18 -0000 1.97 +++ win32/console.c 27 Jul 2002 18:11:36 -0000 @@ -758,13 +758,18 @@ * RETURNS * Success: TRUE * Failure: FALSE + * + * mode: + * ENABLE_PROCESSED_INPUT 0x01 + * ENABLE_LINE_INPUT 0x02 + * ENABLE_ECHO_INPUT 0x04 + * ENABLE_WINDOW_INPUT 0x08 + * ENABLE_MOUSE_INPUT 0x10 */ BOOL WINAPI SetConsoleMode(HANDLE hcon, DWORD mode) { BOOL ret; - TRACE("(%x,%lx)\n", hcon, mode); - SERVER_START_REQ(set_console_mode) { req->handle = hcon; @@ -775,6 +780,9 @@ /* FIXME: when resetting a console input to editline mode, I think we should * empty the S_EditString buffer */ + + TRACE("(%x,%lx) retval == %d\n", hcon, mode, ret); + return ret; } Index: dlls/winedos/vga.c =================================================================== RCS file: /home/wine/wine/dlls/winedos/vga.c,v retrieving revision 1.17 diff -u -r1.17 vga.c --- dlls/winedos/vga.c 3 Jul 2002 21:04:44 -0000 1.17 +++ dlls/winedos/vga.c 27 Jul 2002 18:11:36 -0000 @@ -487,12 +487,17 @@ return 0; } -void VGA_GetAlphaMode(unsigned*Xres,unsigned*Yres) +BOOL VGA_GetAlphaMode(unsigned*Xres,unsigned*Yres) { CONSOLE_SCREEN_BUFFER_INFO info; - GetConsoleScreenBufferInfo(VGA_AlphaConsole(),&info); - if (Xres) *Xres=info.dwSize.X; - if (Yres) *Yres=info.dwSize.Y; + if(!GetConsoleScreenBufferInfo(VGA_AlphaConsole(),&info)) + { + return FALSE; + } else { + if (Xres) *Xres=info.dwSize.X; + if (Yres) *Yres=info.dwSize.Y; + return TRUE; + } } void VGA_SetCursorShape(unsigned char start_options, unsigned char end) @@ -635,7 +640,7 @@ SetConsoleTextAttribute(VGA_AlphaConsole(), attr); } -void VGA_ClearText(unsigned row1, unsigned col1, +BOOL VGA_ClearText(unsigned row1, unsigned col1, unsigned row2, unsigned col2, BYTE attr) { @@ -643,7 +648,15 @@ COORD off; char *dat = VGA_AlphaBuffer(); HANDLE con = VGA_AlphaConsole(); - VGA_GetAlphaMode(&width, &height); + + /* return if we fail to get the height and width of the window */ + if(!VGA_GetAlphaMode(&width, &height)) + { + ERR("failed\n"); + return FALSE; + } + + TRACE("dat = 0x%x, width = %d, height = %d\n", dat, width, height); EnterCriticalSection(&vga_lock); @@ -661,6 +674,8 @@ } LeaveCriticalSection(&vga_lock); + + return TRUE; } void VGA_ScrollUpText(unsigned row1, unsigned col1, Index: dlls/winedos/vga.h =================================================================== RCS file: /home/wine/wine/dlls/winedos/vga.h,v retrieving revision 1.9 diff -u -r1.9 vga.h --- dlls/winedos/vga.h 1 Jul 2002 18:13:52 -0000 1.9 +++ dlls/winedos/vga.h 27 Jul 2002 18:11:36 -0000 @@ -39,14 +39,14 @@ /* text mode */ int VGA_SetAlphaMode(unsigned Xres,unsigned Yres); -void VGA_GetAlphaMode(unsigned*Xres,unsigned*Yres); +BOOL VGA_GetAlphaMode(unsigned*Xres,unsigned*Yres); void VGA_SetCursorShape(unsigned char start_options,unsigned char end); void VGA_SetCursorPos(unsigned X,unsigned Y); void VGA_GetCursorPos(unsigned*X,unsigned*Y); void VGA_WriteChars(unsigned X,unsigned Y,unsigned ch,int attr,int count); void VGA_PutChar(BYTE ascii); void VGA_SetTextAttribute(BYTE attr); -void VGA_ClearText(unsigned row1, unsigned col1, +BOOL VGA_ClearText(unsigned row1, unsigned col1, unsigned row2, unsigned col2, BYTE attr); void VGA_ScrollUpText(unsigned row1, unsigned col1, Index: dlls/winedos/int10.c =================================================================== RCS file: /home/wine/wine/dlls/winedos/int10.c,v retrieving revision 1.14 diff -u -r1.14 int10.c --- dlls/winedos/int10.c 1 Jul 2002 18:13:52 -0000 1.14 +++ dlls/winedos/int10.c 27 Jul 2002 18:11:36 -0000 @@ -769,7 +769,8 @@ { if (!lines) /* Actually, clear the window */ { - VGA_ClearText(row1, col1, row2, col2, attribute); + if(!VGA_ClearText(row1, col1, row2, col2, attribute)) + ERR("VGA_ClearText failed!\n"); } else if (direction == SCROLL_UP) { @@ -792,7 +793,7 @@ BIOSDATA *data = DOSMEM_BiosData(); unsigned xpos, ypos; - TRACE("char: 0x%02x\n", ascii); + TRACE("char: 0x%02x(%c)\n", ascii, ascii); VGA_PutChar(ascii); VGA_GetCursorPos(&xpos, &ypos); Index: loader/module.c =================================================================== RCS file: /home/wine/wine/loader/module.c,v retrieving revision 1.157 diff -u -r1.157 module.c --- loader/module.c 24 Jul 2002 19:04:41 -0000 1.157 +++ loader/module.c 27 Jul 2002 18:11:37 -0000 @@ -583,6 +583,8 @@ char magic[4]; DWORD len; + TRACE("\n"); + /* Seek to the start of the file and read the header information. */ if (SetFilePointer( hfile, 0, NULL, SEEK_SET ) == -1) return BINARY_UNKNOWN; Index: dlls/winmm/winearts/audio.c =================================================================== RCS file: /home/wine/wine/dlls/winmm/winearts/audio.c,v retrieving revision 1.4 diff -u -r1.4 audio.c --- dlls/winmm/winearts/audio.c 31 May 2002 23:40:57 -0000 1.4 +++ dlls/winmm/winearts/audio.c 27 Jul 2002 18:11:38 -0000 @@ -58,9 +58,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(wave); -/* Allow 1% deviation for sample rates (some ES137x cards) */ -#define NEAR_MATCH(rate1,rate2) (((100*((int)(rate1)-(int)(rate2)))/(rate1))==0) - #ifdef HAVE_ARTS #include <artsc.h>