Return value of XMS free block routine

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch prevents several DOS installers
from hanging when they check how much
XMS memory is available.

Changelog:
  When freeing XMS memory block, return
  an error if block has not been previously allocated.

Index: dlls/winedos/xms.c
===================================================================
RCS file: /home/wine/wine/dlls/winedos/xms.c,v
retrieving revision 1.2
diff -u -r1.2 xms.c
--- dlls/winedos/xms.c  9 Mar 2002 23:44:32 -0000       1.2
+++ dlls/winedos/xms.c  28 Apr 2002 16:12:49 -0000
@@ -84,7 +84,11 @@
        break;
     case 0x0a:   /* Free Extended Memory Block */
        TRACE("free extended memory block %04x\n",DX_reg(context));
-       GlobalFree16(DX_reg(context));
+       if(!DX_reg(context) || GlobalFree16(DX_reg(context))) {
+         AX_reg(context) = 0;    /* failure */
+         BL_reg(context) = 0xa2; /* invalid handle */
+       } else
+         AX_reg(context) = 1;    /* success */
        break;
     case 0x0b:   /* Move Extended Memory Block */
     {

-- 
Jukka Heinonen <http://www.iki.fi/jhei/>



[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux