Paul Gofman : kernel32: Correctly restore protection in set_entry_point().

Alexandre Julliard julliard at winehq.org
Tue Nov 2 17:27:45 CDT 2021


Module: wine
Branch: master
Commit: 3be3f0c0f89f98c8a6bf9da770f8683670351127
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=3be3f0c0f89f98c8a6bf9da770f8683670351127

Author: Paul Gofman <pgofman at codeweavers.com>
Date:   Tue Nov  2 15:29:57 2021 +0300

kernel32: Correctly restore protection in set_entry_point().

Signed-off-by: Paul Gofman <pgofman at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/kernel32/kernel_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/kernel32/kernel_main.c b/dlls/kernel32/kernel_main.c
index 89394e16430..4467af739e0 100644
--- a/dlls/kernel32/kernel_main.c
+++ b/dlls/kernel32/kernel_main.c
@@ -65,7 +65,7 @@ static void set_entry_point( HMODULE module, const char *name, DWORD rva )
                 TRACE( "setting %s at %p to %08x\n", name, &functions[ordinal], rva );
                 VirtualProtect( functions + ordinal, sizeof(*functions), PAGE_READWRITE, &oldprot );
                 functions[ordinal] = rva;
-                VirtualProtect( functions + ordinal, sizeof(*functions), oldprot, NULL );
+                VirtualProtect( functions + ordinal, sizeof(*functions), oldprot, &oldprot );
                 return;
             }
             if (res > 0) max = pos - 1;




More information about the wine-cvs mailing list