http://bugs.winehq.org/show_bug.cgi?id=2905
Nico Bendlin nicode@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |nicode@gmx.net
--- Comment #26 from Nico Bendlin nicode@gmx.net --- Loading a saved game worked after hooking the API in a run-time patch:
/************************************************************************/ /* Make sure UnmapViewOfFile is only called for the view's base address */ /* (the game has a global cleanup function for StreamIO objects that is */ /* using a dynamic_cast<MemRWStream *> to unmap file views - BUT during */ /* savegame loading MemRWStream objects are created for sub-chunks, and */ /* therefore the game depends on the Windows 9x API behavior of failing */ /* for addresses that are not the base address of a mapped file view... */ /* Windows XP and newer provide an AppCompat shim "KingsQuestMask" that */ /* hooks MapViewOfFile/UnmapViewOfFile and maintains an address list to */ /* make sure that only previously mapped views are unmapped by the API) */ /************************************************************************/
BOOL WINAPI KERNEL32_UnmapViewOfFile(LPCVOID lpBaseAddress) { MEMORY_BASIC_INFORMATION MemInfo; if (lpBaseAddress && VirtualQuery(lpBaseAddress, &MemInfo, sizeof(MEMORY_BASIC_INFORMATION))) { if ((lpBaseAddress != MemInfo.BaseAddress) || (lpBaseAddress != MemInfo.AllocationBase)) { SetLastError(ERROR_INVALID_ADDRESS); return FALSE; } } return UnmapViewOfFile(lpBaseAddress); }