Alexandre Julliard : winetest: Also check for builtin dll signature.

Alexandre Julliard julliard at winehq.org
Mon Apr 22 16:30:38 CDT 2019


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Apr 22 19:47:56 2019 +0200

winetest: Also check for builtin dll signature.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/winetest/main.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/programs/winetest/main.c b/programs/winetest/main.c
index 3d6cc66..ec2f6a7 100644
--- a/programs/winetest/main.c
+++ b/programs/winetest/main.c
@@ -295,6 +295,7 @@ static int running_elevated (void)
 /* check for native dll when running under wine */
 static BOOL is_native_dll( HMODULE module )
 {
+    static const char builtin_signature[] = "Wine builtin DLL";
     static const char fakedll_signature[] = "Wine placeholder DLL";
     const IMAGE_DOS_HEADER *dos;
 
@@ -303,8 +304,11 @@ static BOOL is_native_dll( HMODULE module )
     /* builtin dlls can't be loaded as datafile, so we must have native or fake dll */
     dos = (const IMAGE_DOS_HEADER *)((const char *)module - 1);
     if (dos->e_magic != IMAGE_DOS_SIGNATURE) return FALSE;
-    if (dos->e_lfanew >= sizeof(*dos) + sizeof(fakedll_signature) &&
-        !memcmp( dos + 1, fakedll_signature, sizeof(fakedll_signature) )) return FALSE;
+    if (dos->e_lfanew >= sizeof(*dos) + 32)
+    {
+        if (!memcmp( dos + 1, builtin_signature, sizeof(builtin_signature) )) return FALSE;
+        if (!memcmp( dos + 1, fakedll_signature, sizeof(fakedll_signature) )) return FALSE;
+    }
     return TRUE;
 }
 




More information about the wine-cvs mailing list