Changeset 10073 for trunk/src/kernel32/mmap.cpp
- Timestamp:
- May 6, 2003, 2:06:11 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/mmap.cpp
r9971 r10073 1 /* $Id: mmap.cpp,v 1.6 5 2003-04-02 11:03:31sandervl Exp $ */1 /* $Id: mmap.cpp,v 1.66 2003-05-06 12:06:10 sandervl Exp $ */ 2 2 3 3 /* … … 75 75 Win32MemMap::Win32MemMap(HANDLE hfile, ULONG size, ULONG fdwProtect, LPSTR lpszName) 76 76 : nrMappings(0), pMapping(NULL), mMapAccess(0), referenced(0), 77 image(0), pWriteBitmap(NULL) 77 image(0), pWriteBitmap(NULL), lpszFileName(NULL) 78 78 { 79 79 DosEnterCriticalSection(&globalmapcritsect); … … 101 101 Win32MemMap::Win32MemMap(Win32PeLdrImage *pImage, ULONG baseAddress, ULONG size) 102 102 : nrMappings(0), pMapping(NULL), mMapAccess(0), referenced(0), 103 image(0), pWriteBitmap(NULL) 103 image(0), pWriteBitmap(NULL), lpszFileName(NULL) 104 104 { 105 105 DosEnterCriticalSection(&globalmapcritsect); … … 127 127 if(hMemFile != -1) 128 128 { 129 lpszFileName = (char *)_smalloc(MMAP_MAX_FILENAME_LENGTH); 130 if(HMGetFileNameFromHandle(hMemFile, lpszFileName, MMAP_MAX_FILENAME_LENGTH) == FALSE) { 131 return FALSE; 132 } 129 133 #if 0 130 134 if(DuplicateHandle(GetCurrentProcess(), hMemFile, GetCurrentProcess(), … … 181 185 if(lpszMapName) { 182 186 free(lpszMapName); 187 } 188 if(lpszFileName) { 189 free(lpszFileName); 183 190 } 184 191 if(pMapping && !image) { … … 917 924 Win32MemMap *Win32MemMap::findMapByFile(HANDLE hFile) 918 925 { 926 DWORD processId = GetCurrentProcessId(); 927 char szFileName[260]; 928 919 929 if(hFile == -1) 930 return NULL; 931 932 if(HMGetFileNameFromHandle(hFile, szFileName, sizeof(szFileName)) == FALSE) 920 933 return NULL; 921 934 … … 926 939 { 927 940 while(map) { 928 if(map->hOrgMemFile == hFile) 929 break; 941 //TODO: we currently don't support sharing file maps between processes 942 if(map->mProcessId == processId && map->lpszFileName) 943 { 944 if(!strcmp(map->lpszFileName, szFileName)) 945 break; 946 } 930 947 map = map->next; 931 948 }
Note:
See TracChangeset
for help on using the changeset viewer.