Changeset 3609 for trunk/src/kernel32/mmap.cpp
- Timestamp:
- May 26, 2000, 8:42:57 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/mmap.cpp
r3602 r3609 1 /* $Id: mmap.cpp,v 1.4 0 2000-05-24 19:28:26sandervl Exp $ */1 /* $Id: mmap.cpp,v 1.41 2000-05-26 18:42:55 sandervl Exp $ */ 2 2 3 3 /* … … 17 17 * TODO: Sharing memory mapped files between multiple processes 18 18 * TODO: Memory mapped files with views that extend the file (not 100% correct now) 19 * TODO: Suspend all threads when a page is committed (possible that another thread 20 * accesses the same memory before the page is read from disk 19 21 * 20 22 * Project Odin Software License can be found in LICENSE.TXT … … 52 54 //****************************************************************************** 53 55 Win32MemMap::Win32MemMap(HFILE hfile, ULONG size, ULONG fdwProtect, LPSTR lpszName) 54 : nrMappings(0), pMapping(NULL), mMapAccess(0), referenced(0), image(0) 56 : nrMappings(0), pMapping(NULL), mMapAccess(0), referenced(0), image(0), 57 fClosed(FALSE) 55 58 { 56 59 globalmapMutex.enter(VMUTEX_WAIT_FOREVER, &hGlobalMapMutex); … … 75 78 //****************************************************************************** 76 79 Win32MemMap::Win32MemMap(Win32PeLdrImage *pImage, ULONG baseAddress, ULONG size) 77 : nrMappings(0), pMapping(NULL), mMapAccess(0), referenced(0) 80 : nrMappings(0), pMapping(NULL), mMapAccess(0), referenced(0), image(0), 81 fClosed(FALSE) 78 82 { 79 83 globalmapMutex.enter(VMUTEX_WAIT_FOREVER, &hGlobalMapMutex); … … 292 296 } 293 297 mapMutex.leave(); 298 299 //if there are no more mappings left and the memory map's handle has been 300 //closed, then delete the object 301 if(nrMappings == 0 && fClosed) { 302 delete this; 303 } 294 304 return TRUE; 295 305 fail: … … 526 536 delete map; 527 537 } 528 else CloseHandle(memmaps->hMemMap); 538 else { 539 if(!map->isClosed()) 540 CloseHandle(memmaps->hMemMap); 541 delete map; 542 } 529 543 } 530 544 else {
Note:
See TracChangeset
for help on using the changeset viewer.