From 5f08af690648f655f4502f681404db1ca5e1a424 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Wed, 20 Aug 2014 19:30:14 +0200 Subject: [PATCH] Add patch to move NtProtectVirtualMemory and NtCreateSection to separate pages. --- README.md | 3 +- patches/Makefile | 19 ++++++++++++ ...tectVirtualMemory-and-NtCreateSectio.patch | 31 +++++++++++++++++++ patches/ntdll-Fix_Alignment/definition | 4 +++ 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 patches/ntdll-Fix_Alignment/0001-ntdll-Move-NtProtectVirtualMemory-and-NtCreateSectio.patch create mode 100644 patches/ntdll-Fix_Alignment/definition diff --git a/README.md b/README.md index 59b123b5..c7f2a157 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,9 @@ which are not present in regular wine, and always report such issues to us Included bugfixes and improvements ---------------------------------- -**Bugfixes and features included in the next upcoming release [10]:** +**Bugfixes and features included in the next upcoming release [11]:** +* Adobe Reader requires NtProtectVirtualMemory and NtCreateSection to be on separate pages ([Wine Bug #33162](http://bugs.winehq.org/show_bug.cgi?id=33162 "Acrobat Reader 11 crashes on start (native API application virtualization, NtProtectVirtualMemory removes execute page protection on its own code)")) * Fix ITERATE_MoveFiles when no source- and destname is specified ([Wine Bug #10085](http://bugs.winehq.org/show_bug.cgi?id=10085 "Adobe Bridge CS2 complains that it can't start due to licensing restrictions (affects photoshop)")) * Fix issue with invisible dragimages in ImageList ([Wine Bug #36761](http://bugs.winehq.org/show_bug.cgi?id=36761 "Imagelist invisible dragimage")) * Gothic 2 demo expects an error when opening a terminating process ([Wine Bug #37087](http://bugs.winehq.org/show_bug.cgi?id=37087 "Gothic 2 english demo fails with 'Conflict: a hook process was found. Please deactivate all Antivirus and Anti-Trojan programs and debuggers.'")) diff --git a/patches/Makefile b/patches/Makefile index 07c5de28..82d47761 100644 --- a/patches/Makefile +++ b/patches/Makefile @@ -29,6 +29,7 @@ PATCHLIST := \ ntdll-Dynamic_DST.ok \ ntdll-FD_Cache.ok \ ntdll-FileDispositionInformation.ok \ + ntdll-Fix_Alignment.ok \ ntdll-Junction_Points.ok \ ntdll-Pipe_SpecialCharacters.ok \ ntdll-loader_EntryPoint.ok \ @@ -482,6 +483,24 @@ ntdll-FileDispositionInformation.ok: echo '+ { "ntdll-FileDispositionInformation", "Dmitry Timoshkov / Erich E. Hoover", "Add support for setting file disposition information." },'; \ ) > ntdll-FileDispositionInformation.ok +# Patchset ntdll-Fix_Alignment +# | +# | Included patches: +# | * Move NtProtectVirtualMemory and NtCreateSection to separate pages in ntdll on x86. [by Michael Müller] +# | +# | This patchset fixes the following Wine bugs: +# | * [#33162] Adobe Reader requires NtProtectVirtualMemory and NtCreateSection to be on separate pages +# | +# | Modified files: +# | * dlls/ntdll/virtual.c +# | +.INTERMEDIATE: ntdll-Fix_Alignment.ok +ntdll-Fix_Alignment.ok: + $(call APPLY_FILE,ntdll-Fix_Alignment/0001-ntdll-Move-NtProtectVirtualMemory-and-NtCreateSectio.patch) + @( \ + echo '+ { "ntdll-Fix_Alignment", "Michael Müller", "Move NtProtectVirtualMemory and NtCreateSection to separate pages in ntdll on x86." },'; \ + ) > ntdll-Fix_Alignment.ok + # Patchset ntdll-Junction_Points # | # | Included patches: diff --git a/patches/ntdll-Fix_Alignment/0001-ntdll-Move-NtProtectVirtualMemory-and-NtCreateSectio.patch b/patches/ntdll-Fix_Alignment/0001-ntdll-Move-NtProtectVirtualMemory-and-NtCreateSectio.patch new file mode 100644 index 00000000..ff395a27 --- /dev/null +++ b/patches/ntdll-Fix_Alignment/0001-ntdll-Move-NtProtectVirtualMemory-and-NtCreateSectio.patch @@ -0,0 +1,31 @@ +From 9f83442a212635a7921420c56c217df0c0e46fc4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Wed, 20 Aug 2014 19:21:18 +0200 +Subject: ntdll: Move NtProtectVirtualMemory and NtCreateSection to separate + pages on x86 + +--- + dlls/ntdll/virtual.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c +index 4819d2d..63ba0a3 100644 +--- a/dlls/ntdll/virtual.c ++++ b/dlls/ntdll/virtual.c +@@ -150,6 +150,13 @@ static void *preload_reserve_end; + static BOOL use_locks; + static BOOL force_exec_prot; /* whether to force PROT_EXEC on all PROT_READ mmaps */ + ++#if defined(__i386__) && defined(__GNUC__) ++NTSTATUS WINAPI NtProtectVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T *size_ptr, ++ ULONG new_prot, ULONG *old_prot ) __attribute__((aligned(4096))); ++NTSTATUS WINAPI NtCreateSection( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, ++ const LARGE_INTEGER *size, ULONG protect, ++ ULONG sec_flags, HANDLE file ) __attribute__((aligned(4096))); ++#endif + + /*********************************************************************** + * VIRTUAL_GetProtStr +-- +1.9.1 + diff --git a/patches/ntdll-Fix_Alignment/definition b/patches/ntdll-Fix_Alignment/definition new file mode 100644 index 00000000..6f59b806 --- /dev/null +++ b/patches/ntdll-Fix_Alignment/definition @@ -0,0 +1,4 @@ +Author: Michael Müller +Subject: Move NtProtectVirtualMemory and NtCreateSection to separate pages in ntdll on x86. +Revision: 1 +Fixes: [33162] Adobe Reader requires NtProtectVirtualMemory and NtCreateSection to be on separate pages