Changeset 695 for trunk/src/kernel32/mmap.cpp
- Timestamp:
- Aug 25, 1999, 5:27:20 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/mmap.cpp
r690 r695 1 /* $Id: mmap.cpp,v 1.1 1 1999-08-25 14:27:07sandervl Exp $ */1 /* $Id: mmap.cpp,v 1.12 1999-08-25 15:27:19 sandervl Exp $ */ 2 2 3 3 /* … … 150 150 151 151 dprintf(("Win32MemMap::commitPage %x (faultaddr %x), nr of pages %d", pageAddr, lpPageFaultAddr, nrpages)); 152 if(VirtualAlloc((LPVOID)pageAddr, nrpages*PAGE_SIZE, MEM_COMMIT, newProt) == FALSE) {153 goto fail;154 }155 152 if(hMemFile != -1) { 153 if(VirtualAlloc((LPVOID)pageAddr, nrpages*PAGE_SIZE, MEM_COMMIT, PAGE_READWRITE) == FALSE) { 154 goto fail; 155 } 156 156 offset = pageAddr - (ULONG)pMapping; 157 157 size = nrpages*PAGE_SIZE; … … 171 171 goto fail; 172 172 } 173 if(mProtFlags & PAGE_READONLY) { 174 //DosSetMem returns flags with EXECUTE bit set, even though the initial allocation is without this bit set! 175 //Also returns access denied when trying to set it back to READONLY 176 VirtualProtect((LPVOID)pageAddr, nrpages*PAGE_SIZE, newProt, &oldProt); 177 // if(VirtualProtect((LPVOID)pageAddr, nrpages*PAGE_SIZE, newProt, &oldProt) == FALSE) { 178 // goto fail; 179 // } 180 } 181 } 182 else { 183 if(VirtualAlloc((LPVOID)pageAddr, nrpages*PAGE_SIZE, MEM_COMMIT, newProt) == FALSE) { 184 goto fail; 185 } 173 186 } 174 187 … … 224 237 225 238 if(fMapped == FALSE) {//if not mapped, reserve/commit entire view 226 pMapping = VirtualAlloc(0, mSize, fAlloc, m ProtFlags);239 pMapping = VirtualAlloc(0, mSize, fAlloc, memFlags); 227 240 if(pMapping == NULL) { 228 241 dprintf(("Win32MemMap::mapFileView: VirtualAlloc %x %x %x failed!", mSize, fAlloc, memFlags)); … … 255 268 256 269 // mapMutex.enter(); 270 dprintf(("Win32MemMap::flushView: %x %x", lpvBase, cbFlush)); 257 271 if(fMapped == FALSE) 258 272 goto parmfail;
Note:
See TracChangeset
for help on using the changeset viewer.