- Timestamp:
- Mar 24, 2002, 2:10:30 PM (23 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/hmfile.cpp
r7550 r8121 1 /* $Id: hmfile.cpp,v 1.3 3 2001-12-05 18:06:01sandervl Exp $ */1 /* $Id: hmfile.cpp,v 1.34 2002-03-24 13:10:30 sandervl Exp $ */ 2 2 3 3 /* … … 473 473 map = Win32MemMapView::findMapByView((ULONG)lpBuffer, &offset, MEMMAP_ACCESS_WRITE); 474 474 if(map) { 475 lpRealBuf = (LPVOID)((ULONG)map->getMappingAddr() + offset);476 DWORD nrpages = nNumberOfBytesToRead/4096;477 if(offset & 0xfff)478 nrpages++;479 if(nNumberOfBytesToRead & 0xfff)480 nrpages++;481 482 map->commitPage(offset & ~0xfff, TRUE, nrpages);483 } 484 else 475 lpRealBuf = (LPVOID)((ULONG)map->getMappingAddr() + offset); 476 DWORD nrpages = nNumberOfBytesToRead/4096; 477 if(offset & 0xfff) 478 nrpages++; 479 if(nNumberOfBytesToRead & 0xfff) 480 nrpages++; 481 482 map->commitPage(offset & ~0xfff, TRUE, nrpages); 483 } 484 else lpRealBuf = (LPVOID)lpBuffer; 485 485 486 486 if(pHMHandleData->dwFlags & FILE_FLAG_OVERLAPPED) { … … 560 560 map = Win32MemMapView::findMapByView((ULONG)lpBuffer, &offset, MEMMAP_ACCESS_READ); 561 561 if(map) { 562 lpRealBuf = (LPVOID)((ULONG)map->getMappingAddr() + offset);563 DWORD nrpages = nNumberOfBytesToWrite/4096;564 if(offset & 0xfff)565 nrpages++;566 if(nNumberOfBytesToWrite & 0xfff)567 nrpages++;568 569 map->commitPage(offset & ~0xfff, TRUE, nrpages);570 } 571 else 562 lpRealBuf = (LPVOID)((ULONG)map->getMappingAddr() + offset); 563 DWORD nrpages = nNumberOfBytesToWrite/4096; 564 if(offset & 0xfff) 565 nrpages++; 566 if(nNumberOfBytesToWrite & 0xfff) 567 nrpages++; 568 569 map->commitPage(offset & ~0xfff, TRUE, nrpages); 570 } 571 else lpRealBuf = (LPVOID)lpBuffer; 572 572 573 573 if(pHMHandleData->dwFlags & FILE_FLAG_OVERLAPPED) { -
trunk/src/kernel32/mmap.cpp
r7272 r8121 1 /* $Id: mmap.cpp,v 1.5 3 2001-10-30 00:46:17sandervl Exp $ */1 /* $Id: mmap.cpp,v 1.54 2002-03-24 13:10:30 sandervl Exp $ */ 2 2 3 3 /* … … 382 382 // when allocating memory with the PAG_ANY bit set. (without this 383 383 // flag it will also crash) 384 if(hMemFile == -1 && lpszMapName) { 384 //All named file mappings are shared (files & memory only) 385 if(lpszMapName) { 385 386 pMapping = VirtualAllocShared(mSize, fAlloc, PAGE_READWRITE, lpszMapName); 386 387 } … … 601 602 break; 602 603 } 603 if(map->getMemName() != NULL && map->getFileHandle() == -1 && 604 map->getProcessId() != mProcessId) 604 //Named file mappings from other processes are always shared; 605 //map into our address space 606 if(map->getMemName() != NULL && map->getProcessId() != mProcessId) 605 607 { 606 608 //shared memory map, so map it into our address space
Note:
See TracChangeset
for help on using the changeset viewer.