Changeset 21667 for trunk/src/kernel32/hmfile.cpp
- Timestamp:
- Jul 7, 2011, 1:44:25 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/hmfile.cpp
r21655 r21667 556 556 dprintf(("Flush memory maps to disk before reading!!")); 557 557 map->flushView(MMAP_FLUSHVIEW_ALL, curpos, nNumberOfBytesToRead); 558 map->Release(); 558 559 } 559 560 … … 644 645 else lpRealBuf = (LPVOID)lpBuffer; 645 646 646 //If this file is also used in a memory map somewhere, then we need647 //to tell the map to flush all modified contents to disk right NOW648 DWORD curfilepos;649 map = Win32MemMap::findMapByFile(pHMHandleData->hWin32Handle);650 if(map && map->getFileHandle() != pHMHandleData->hWin32Handle) {651 curfilepos = SetFilePointer(pHMHandleData, 0, NULL, FILE_CURRENT);652 653 dprintf(("Flush memory maps to disk before writing!!"));654 map->flushView(MMAP_FLUSHVIEW_ALL, curfilepos, nNumberOfBytesToWrite);655 }656 657 647 if(pHMHandleData->dwFlags & FILE_FLAG_OVERLAPPED) { 658 648 dprintf(("ERROR: Overlapped IO not yet implememented!!")); … … 665 655 // } 666 656 667 if(map && bRC) { 668 dprintf(("Invalidate memory map after file writing!!")); 669 map->invalidatePages(curfilepos, *lpNumberOfBytesWritten); 657 if (bRC) { 658 //If this file is also used in a memory map somewhere, then we need 659 //to invalidate memory pages that we just wrote 660 DWORD curfilepos; 661 map = Win32MemMap::findMapByFile(pHMHandleData->hWin32Handle); 662 if(map) { 663 curfilepos = SetFilePointer(pHMHandleData, 0, NULL, FILE_CURRENT); 664 665 dprintf(("Invalidate memory map after file writing!!")); 666 map->invalidatePages(curfilepos, *lpNumberOfBytesWritten); 667 map->Release(); 668 } 670 669 } 671 670
Note:
See TracChangeset
for help on using the changeset viewer.