Fix Bug in int 21

Tony Lambregts tony.lambregts at gmail.com
Sat Sep 17 22:10:55 CDT 2005


This Patch fixes a bug in int 21 as described in bug 2960 (patch is against 
current cvs)

http://bugs.winehq.org/show_bug.cgi?id=2960

> An old windows 3.1 program (compiled with a watcom compiler) was failing with
> the message Read Error in a window called WATCOM Win386. I found the problem was
> due to count being set to 0 in int21, function 3f. In my case the
> GetSelectorLimit16 was set at 0xffff (DX was set 0) and would make maxcount 0. 
> 
> Below is a simple fix (making maxcount a double).

Change log: Christian Lupien <lupien at physique.usherbrooke.ca>
             Make maxcount a double

Files changed: dlls/winedos/int21.c

Index: dlls/winedos/int21.c
===================================================================
RCS file: /home/wine/wine/dlls/winedos/int21.c,v
retrieving revision 1.80
diff -u -r1.80 int21.c
--- dlls/winedos/int21.c	12 Sep 2005 10:52:38 -0000	1.80
+++ dlls/winedos/int21.c	18 Sep 2005 03:08:48 -0000
@@ -4746,7 +4746,7 @@
              /* Some programs pass a count larger than the allocated buffer */
              if (DOSVM_IsWin16())
              {
-                WORD maxcount = GetSelectorLimit16( context->SegDs )
+                DWORD maxcount = GetSelectorLimit16( context->SegDs )
                      - DX_reg(context) + 1;
                  if (count > maxcount)
                      count = maxcount;



More information about the wine-patches mailing list