Changeset 2525 for trunk/src/kernel32


Ignore:
Timestamp:
Jan 27, 2000, 12:19:06 AM (26 years ago)
Author:
sandervl
Message:

Added workaround for OS/2 DosSetMem bug in VirtualAlloc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/virtual.cpp

    r2264 r2525  
    1 /* $Id: virtual.cpp,v 1.26 1999-12-30 11:19:54 sandervl Exp $ */
     1/* $Id: virtual.cpp,v 1.27 2000-01-26 23:19:06 sandervl Exp $ */
    22
    33/*
     
    286286        flag = PAG_COMMIT;
    287287  }
    288 
     288 
     289  if(fdwAllocationType & MEM_RESERVE) {
     290        //SvL: DosRead crashes if memory is initially reserved with write
     291        //     access disabled (OS/2 bug) even if the commit sets the page
     292        //     flags to read/write:
     293        // DosSetMem does not alter the 16 bit selectors so if you change memory
     294        // attributes and then access the memory with a 16 bit API (such as DosRead),
     295        // it will have the old (alloc time) attributes
     296        flag |= PAG_READ|PAG_WRITE;
     297  }
    289298  if(fdwProtect & PAGE_READONLY)     flag |= PAG_READ;
    290299  if(fdwProtect & PAGE_NOACCESS)     flag |= PAG_READ; //can't do this in OS/2
Note: See TracChangeset for help on using the changeset viewer.