- Timestamp:
- May 26, 2000, 8:42:57 PM (25 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/hmmmap.cpp
r3599 r3609 1 /* $Id: hmmmap.cpp,v 1.1 2 2000-05-24 01:56:08 phallerExp $ */1 /* $Id: hmmmap.cpp,v 1.13 2000-05-26 18:42:55 sandervl Exp $ */ 2 2 3 3 /* … … 213 213 return ERROR_INVALID_HANDLE; 214 214 } 215 //Although an application may close the file handle used to create a file 216 //mapping object, the system holds the corresponding file open until the last 217 //view of the file is unmapped. 215 218 map = (Win32MemMap *)pHMHandleData->dwUserData; 216 map-> Release();219 map->close(); 217 220 218 221 return NO_ERROR; -
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 { -
trunk/src/kernel32/mmap.h
r2658 r3609 1 /* $Id: mmap.h,v 1.1 5 2000-02-05 14:09:32sandervl Exp $ */1 /* $Id: mmap.h,v 1.16 2000-05-26 18:42:56 sandervl Exp $ */ 2 2 3 3 /* … … 61 61 void Release() { if(--referenced == 0) delete this; }; 62 62 63 void close() { fClosed = TRUE; }; 64 BOOL isClosed() { return fClosed; }; 65 63 66 BOOL commitPage(ULONG offset, BOOL fWriteAccess, int nrpages = NRPAGES_TOCOMMIT); 64 67 … … 97 100 LPSTR lpszMapName; 98 101 void *pMapping; 102 BOOL fClosed; //handle is removed by CloseHandle 99 103 100 104 ULONG nrMappings; -
trunk/src/kernel32/winimagebase.cpp
r3483 r3609 1 /* $Id: winimagebase.cpp,v 1. 19 2000-05-02 20:53:14sandervl Exp $ */1 /* $Id: winimagebase.cpp,v 1.20 2000-05-26 18:42:56 sandervl Exp $ */ 2 2 3 3 /* … … 145 145 //dummy 146 146 return FALSE; 147 } 148 //****************************************************************************** 149 //****************************************************************************** 150 ULONG Win32ImageBase::getImageSize() 151 { 152 //dummy 153 return 0; 147 154 } 148 155 //****************************************************************************** -
trunk/src/kernel32/winimagebase.h
r3588 r3609 1 /* $Id: winimagebase.h,v 1. 8 2000-05-22 19:08:00sandervl Exp $ */1 /* $Id: winimagebase.h,v 1.9 2000-05-26 18:42:56 sandervl Exp $ */ 2 2 3 3 /* … … 105 105 virtual ULONG getApi(int ordinal) = 0; 106 106 107 virtual ULONG getImageSize(); 108 107 109 virtual BOOL isDll() = 0; 108 110 -
trunk/src/kernel32/winimagepeldr.cpp
r3483 r3609 1 /* $Id: winimagepeldr.cpp,v 1.4 2 2000-05-02 20:53:15sandervl Exp $ */1 /* $Id: winimagepeldr.cpp,v 1.43 2000-05-26 18:42:56 sandervl Exp $ */ 2 2 3 3 /* … … 1496 1496 //****************************************************************************** 1497 1497 //****************************************************************************** 1498 ULONG Win32PeLdrImage::getImageSize() 1499 { 1500 return imageSize; 1501 } 1502 //****************************************************************************** 1503 //****************************************************************************** 1498 1504 ULONG Win32PeLdrImage::getApi(char *name) 1499 1505 { -
trunk/src/kernel32/winimagepeldr.h
r3483 r3609 1 /* $Id: winimagepeldr.h,v 1. 2 2000-05-02 20:53:15sandervl Exp $ */1 /* $Id: winimagepeldr.h,v 1.3 2000-05-26 18:42:57 sandervl Exp $ */ 2 2 3 3 /* … … 81 81 //any dlls are loaded, so that exes without fixups can be loaded at a low 82 82 //address) 83 virtual BOOL init(ULONG reservedMem);83 virtual BOOL init(ULONG reservedMem); 84 84 85 85 virtual BOOL insideModule(ULONG address); … … 88 88 virtual ULONG getApi(char *name); 89 89 virtual ULONG getApi(int ordinal); 90 91 virtual ULONG getImageSize(); 90 92 91 93 //Returns required OS version for this image
Note:
See TracChangeset
for help on using the changeset viewer.