- Timestamp:
- May 20, 2002, 3:47:59 PM (23 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/hmmmap.cpp
r8119 r8456 1 /* $Id: hmmmap.cpp,v 1. 19 2002-03-24 11:59:45sandervl Exp $ */1 /* $Id: hmmmap.cpp,v 1.20 2002-05-20 13:47:58 sandervl Exp $ */ 2 2 3 3 /* … … 51 51 //****************************************************************************** 52 52 DWORD HMDeviceMemMapClass::CreateFileMapping(PHMHANDLEDATA pHMHandleData, 53 HFILE hFile, 53 HFILE hFile, 54 54 SECURITY_ATTRIBUTES *sa, /* [in] Optional security attributes*/ 55 55 DWORD protect, /* [in] Protection for mapping object */ 56 56 DWORD size_high, /* [in] High-order 32 bits of object size */ 57 57 DWORD size_low, /* [in] Low-order 32 bits of object size */ 58 LPCSTR name) /* [in] Name of file-mapping object */ 58 LPCSTR name) /* [in] Name of file-mapping object */ 59 59 { 60 60 Win32MemMap *map; … … 64 64 (protect & (PAGE_READONLY|PAGE_READWRITE|PAGE_WRITECOPY)) == 0 || 65 65 // (hFile == -1 && (protect & SEC_COMMIT)) || 66 ((protect & SEC_COMMIT) && (protect & SEC_RESERVE))) 66 ((protect & SEC_COMMIT) && (protect & SEC_RESERVE))) 67 67 { 68 68 … … 109 109 dprintf(("CreateFileMappingA: can't create Win32MemMap object!")); 110 110 return ERROR_OUTOFMEMORY; 111 } 112 113 if(map->Init() == FALSE) {111 } 112 113 if(map->Init(size_low) == FALSE) { 114 114 dprintf(("CreateFileMappingA: init failed!")); 115 115 delete map; … … 177 177 dwFileOffsetHigh, 178 178 dwFileOffsetLow, 179 dwNumberOfBytesToMap, 179 dwNumberOfBytesToMap, 180 180 lpBaseAddress)); 181 181 182 if(lpBaseAddress != NULL) 182 if(lpBaseAddress != NULL) 183 183 { 184 184 #if 0 -
trunk/src/kernel32/mmap.cpp
r8203 r8456 1 /* $Id: mmap.cpp,v 1.5 5 2002-04-07 15:44:11sandervl Exp $ */1 /* $Id: mmap.cpp,v 1.56 2002-05-20 13:47:59 sandervl Exp $ */ 2 2 3 3 /* … … 105 105 //****************************************************************************** 106 106 //****************************************************************************** 107 BOOL Win32MemMap::Init( )107 BOOL Win32MemMap::Init(DWORD aMSize) 108 108 { 109 109 mapMutex.enter(); … … 134 134 goto fail; 135 135 } 136 if (mSize < aMSize) 137 { 138 dprintf(("Win32MemMap::init: file size %d, memory map size %d", mSize, aMSize)); 139 //Froloff: Need to check if exist the possibility of file to memory 140 // mapping not from the beginning of file 141 mSize = SetFilePointer(hMemFile, aMSize, NULL, FILE_BEGIN); 142 // Commit filesize changes onto disk 143 SetEndOfFile(hMemFile); 144 } 145 #if 0 136 146 //SvL: Temporary limitation of size (Warp Server Advanced doesn't allow 137 147 // one to reserve more than 450 MB (unless you override the virtual … … 140 150 mSize = 64*1024*1024; 141 151 } 152 #endif 142 153 } 143 154 … … 611 622 //Named file mappings from other processes are always shared; 612 623 //map into our address space 613 if(map->getMemName() != NULL && map->getProcessId() != mProcessId) 624 if(map->getMemName() != NULL && map->getProcessId() != mProcessId) 614 625 { 615 626 //shared memory map, so map it into our address space … … 756 767 } 757 768 while(view); 758 769 759 770 //failure if we get here 760 771 view = NULL; -
trunk/src/kernel32/mmap.h
r8203 r8456 1 /* $Id: mmap.h,v 1.2 1 2002-04-07 15:44:11sandervl Exp $ */1 /* $Id: mmap.h,v 1.22 2002-05-20 13:47:59 sandervl Exp $ */ 2 2 3 3 /* … … 45 45 ~Win32MemMap(); 46 46 47 BOOL Init( );47 BOOL Init(DWORD aMSize=0); 48 48 BOOL flushView(ULONG offset, ULONG cbFlush); 49 49 LPVOID mapViewOfFile(ULONG size, ULONG offset, ULONG fdwAccess);
Note:
See TracChangeset
for help on using the changeset viewer.