Ignore:
Timestamp:
Nov 10, 1999, 3:16:01 PM (26 years ago)
Author:
sandervl
Message:

VirtualAlloc fixes & changes

File:
1 edited

Legend:

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

    r1432 r1687  
    1 /* $Id: virtual.cpp,v 1.21 1999-10-24 22:51:22 sandervl Exp $ */
     1/* $Id: virtual.cpp,v 1.22 1999-11-10 14:16:01 sandervl Exp $ */
    22
    33/*
     
    3131ODINDEBUGCHANNEL(KERNEL32-VIRTUAL)
    3232
     33#define PAGE_SHIFT 12
    3334
    3435/***********************************************************************
     
    305306    dprintf(("VirtualAlloc: Unknown protection flags, default to read/write"));
    306307    flag |= PAG_READ | PAG_WRITE;
     308  }
     309
     310  if(lpvAddress)
     311  {
     312   Win32MemMap *map;
     313   ULONG offset, nrpages;
     314
     315        nrpages = cbSize >> PAGE_SHIFT;
     316        if(cbSize & 0xFFF)
     317                nrpages++;
     318
     319        map = Win32MemMapView::findMapByView((ULONG)lpvAddress, &offset, fdwProtect);
     320        if(map) {
     321                //TODO: We don't allow protection flag changes for mmaped files now
     322                map->commitPage(offset, FALSE, nrpages);
     323                return lpvAddress;
     324        }
    307325  }
    308326
Note: See TracChangeset for help on using the changeset viewer.