Changeset 2072 for trunk/src


Ignore:
Timestamp:
Dec 14, 1999, 1:50:46 PM (26 years ago)
Author:
sandervl
Message:

memory map fixes

Location:
trunk/src/kernel32
Files:
3 edited

Legend:

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

    r2066 r2072  
    1 /* $Id: mmap.cpp,v 1.28 1999-12-13 19:28:14 sandervl Exp $ */
     1/* $Id: mmap.cpp,v 1.29 1999-12-14 12:50:45 sandervl Exp $ */
    22
    33/*
     
    237237  }
    238238  else {
    239         for(i=0;i<nrpages;i++) {
    240                 if(VirtualQuery((LPSTR)pageAddr, &memInfo, PAGE_SIZE) == 0) {
    241                         dprintf(("Win32MemMap::commitPage: VirtualQuery (%x,%x) failed for %x", pageAddr, PAGE_SIZE));
     239        ULONG sizeleft = nrpages*PAGE_SIZE;
     240        while(sizeleft) {
     241                if(VirtualQuery((LPSTR)pageAddr, &memInfo, sizeleft) == 0) {
     242                        dprintf(("Win32MemMap::commitPage: VirtualQuery (%x,%x) failed", pageAddr, sizeleft));
    242243                        goto fail;
    243244                }
     
    247248                                goto fail;
    248249                }
    249                 pageAddr += PAGE_SIZE;
     250                memInfo.RegionSize = (memInfo.RegionSize+PAGE_SIZE-1) & ~0xfff;
     251                pageAddr += memInfo.RegionSize;
     252                sizeleft -= memInfo.RegionSize;
    250253        }
    251254  }
  • trunk/src/kernel32/mmap.h

    r1811 r2072  
    1 /* $Id: mmap.h,v 1.12 1999-11-22 20:35:50 sandervl Exp $ */
     1/* $Id: mmap.h,v 1.13 1999-12-14 12:50:46 sandervl Exp $ */
    22
    33/*
     
    2121
    2222//commit 4 pages at once when the app accesses it
    23 #define NRPAGES_TOCOMMIT        200
     23#define NRPAGES_TOCOMMIT        16
    2424
    2525#define MEMMAP_ACCESS_READ      1
  • trunk/src/kernel32/winimagepeldr.cpp

    r2066 r2072  
    1 /* $Id: winimagepeldr.cpp,v 1.23 1999-12-13 19:28:15 sandervl Exp $ */
     1/* $Id: winimagepeldr.cpp,v 1.24 1999-12-14 12:50:46 sandervl Exp $ */
    22
    33/*
     
    241241  memmap = new Win32MemMap(this, realBaseAddress, imageSize);
    242242  if(memmap == NULL || !memmap->Init(0)) {
    243         strcpy(szErrorModule, OSLibStripPath(szFileName));
    244243        goto failure;
    245244  }
     
    13561355                if(rc) {
    13571356                        dprintf((LOG, "DosLoadModule returned %X for %s\n", rc, szModuleFailure));
    1358                         sprintf(szErrorModule, "%s.DLL", szModuleFailure);
     1357                        sprintf(szErrorModule, "%s.DLL", szModuleFailure);
    13591358                        errorState = rc;
    13601359                        return(FALSE);
     
    13811380                if(WinDll->init(0) == FALSE) {
    13821381                    dprintf((LOG, "Internal WinDll error ", WinDll->getError() ));
    1383                     strcpy(szErrorModule, OSLibStripPath(modname));
    13841382                    return(FALSE);
    13851383                }
Note: See TracChangeset for help on using the changeset viewer.