Huw Davies : rpcrt4/tests: Fix some tests on Win 8.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Apr 24 08:48:51 CDT 2015


Module: wine
Branch: master
Commit: 9f2c668c99cba9f4dc905810f4c290a587162c6c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9f2c668c99cba9f4dc905810f4c290a587162c6c

Author: Huw Davies <huw at codeweavers.com>
Date:   Thu Apr 23 13:17:32 2015 +0100

rpcrt4/tests: Fix some tests on Win 8.

---

 dlls/rpcrt4/tests/cstub.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/dlls/rpcrt4/tests/cstub.c b/dlls/rpcrt4/tests/cstub.c
index de0c224..d098d60 100644
--- a/dlls/rpcrt4/tests/cstub.c
+++ b/dlls/rpcrt4/tests/cstub.c
@@ -397,6 +397,8 @@ static BOOL check_address(void *actual, void *expected)
 {
     static void *ole32_start = NULL;
     static void *ole32_end = NULL;
+    static void *combase_start = NULL;
+    static void *combase_end = NULL;
 
     if (actual == expected)
         return TRUE;
@@ -412,7 +414,21 @@ static BOOL check_address(void *actual, void *expected)
         ole32_end = (void *)((char *) ole32_start + nt_headers->OptionalHeader.SizeOfImage);
     }
 
-    return ole32_start <= actual && actual < ole32_end;
+    if (ole32_start <= actual && actual < ole32_end)
+        return TRUE;
+
+    /* On Win8, actual can be located inside combase.dll */
+    if (combase_start == NULL || combase_end == NULL)
+    {
+        PIMAGE_NT_HEADERS nt_headers;
+        combase_start = (void *) GetModuleHandleA("combase.dll");
+        if (combase_start == NULL)
+            return FALSE;
+        nt_headers = (PIMAGE_NT_HEADERS)((char *) combase_start + ((PIMAGE_DOS_HEADER) combase_start)->e_lfanew);
+        combase_end = (void *)((char *) combase_start + nt_headers->OptionalHeader.SizeOfImage);
+    }
+
+    return (combase_start <= actual && actual < combase_end);
 }
 
 static const ExtendedProxyFileInfo my_proxy_file_info =




More information about the wine-cvs mailing list