[Bug 2905] Kings Quest 8 crashes while loading a saved game
http://bugs.winehq.org/show_bug.cgi?id=2905 Nico Bendlin <nicode(a)gmx.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nicode(a)gmx.net --- Comment #26 from Nico Bendlin <nicode(a)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); } -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
wine-bugs@winehq.org