PKGBUILDS/wine-tkg-git/wine-tkg-git/wine-tkg-patches/game-specific/f4skyrimse-fix/legacy/f4skyrimse-fix-2-4c750a3.patch

24 lines
1.7 KiB
Diff

This is one of two patches to get Fallout 4 Script Extender working in wine. f4se allocates memory for trampolines in the spaces before the Fallout4 exe image and the f4se dll image. This patch:
Switches dlls not loaded at their preferred address to be loaded at high addresses rather than low ones to work around code in f4se that gives up allocating the trampolines (it compares the address being queried to a lowest acceptable address computed by subtracting 0x78000000 from the module address, which will wrap around and fail with lower addresses even if there's free space).
Apparently it also get SkyrimSE script extender working, but I don't own that so I can't test that.
https://github.com/hdmap/wine-hackery
--- a/dlls/ntdll/virtual.c 2018-05-15 12:07:53.839882299 -0400
+++ a/dlls/ntdll/virtual.c 2018-05-16 16:29:00.753042766 -0400
@@ -1387,11 +1387,11 @@ static NTSTATUS map_image( HANDLE hmappi
server_enter_uninterrupted_section( &csVirtual, &sigset );
if (base >= (char *)address_space_start) /* make sure the DOS area remains free */
- status = map_view( &view, base, total_size, get_mask( 0 ), FALSE, SEC_IMAGE | SEC_FILE |
+ status = map_view( &view, base, total_size, get_mask( 0 ), TRUE, SEC_IMAGE | SEC_FILE |
VPROT_COMMITTED | VPROT_READ | VPROT_EXEC | VPROT_WRITECOPY, zero_bits );
if (status != STATUS_SUCCESS)
- status = map_view( &view, NULL, total_size, get_mask( 0 ), FALSE, SEC_IMAGE | SEC_FILE |
+ status = map_view( &view, NULL, total_size, get_mask( 0 ), TRUE, SEC_IMAGE | SEC_FILE |
VPROT_COMMITTED | VPROT_READ | VPROT_EXEC | VPROT_WRITECOPY, zero_bits );