From: Eric Pouech epouech@codeweavers.com
Signed-off-by: Eric Pouech epouech@codeweavers.com --- dlls/kernel32/tests/loader.c | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-)
diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c index 19f112efcd8..c354ba8f24d 100644 --- a/dlls/kernel32/tests/loader.c +++ b/dlls/kernel32/tests/loader.c @@ -4047,10 +4047,15 @@ static void test_InMemoryOrderModuleList(void) ok(entry2 == mark2, "expected entry2 == mark2, got %p and %p\n", entry2, mark2); }
-static void test_wow64_redirection_for_dll(const char *libname) +static void test_wow64_redirection_for_dll(const char *libname, BOOL will_fail) { HMODULE lib; char buf[256]; + static const char *system32dir = "c:\windows\system32\"; + static const char *syswow64dir = "c:\windows\syswow64\"; + const size_t sysdirlen = strlen(system32dir); + const size_t syswowlen = strlen(syswow64dir); + const char *modname;
if (!GetModuleHandleA(libname)) { @@ -4066,6 +4071,13 @@ static void test_wow64_redirection_for_dll(const char *libname) ok(lib != NULL, "Loading %s from full path should succeed with WOW64 redirection disabled\n", libname); if (lib) FreeLibrary(lib); + modname = strrchr(libname, '\'); + modname = modname ? modname + 1 : libname; + todo_wine_if(will_fail) + ok((!strncasecmp(buf, system32dir, sysdirlen) && !strcasecmp(buf + sysdirlen, modname)) || + /* Win7 report from syswow64 */ + broken(!strncasecmp(buf, syswow64dir, syswowlen) && !strcasecmp(buf + syswowlen, modname)), + "Unexpected loaded DLL name %s for %s\n", buf, libname); } } else @@ -4085,10 +4097,20 @@ static void test_wow64_redirection(void) * already be loaded in this process). */ ok(pWow64DisableWow64FsRedirection(&OldValue), "Disabling FS redirection failed\n"); - test_wow64_redirection_for_dll("wlanapi.dll"); - test_wow64_redirection_for_dll("dxgi.dll"); - test_wow64_redirection_for_dll("dwrite.dll"); + test_wow64_redirection_for_dll("wlanapi.dll", FALSE); + test_wow64_redirection_for_dll("dxgi.dll", FALSE); + test_wow64_redirection_for_dll("dwrite.dll", FALSE); + test_wow64_redirection_for_dll("c:\windows\syswow64\wlanapi.dll", TRUE); + test_wow64_redirection_for_dll("c:\windows\syswow64\dxgi.dll", TRUE); + test_wow64_redirection_for_dll("c:\windows\syswow64\dwrite.dll", TRUE); ok(pWow64RevertWow64FsRedirection(OldValue), "Re-enabling FS redirection failed\n"); + /* and results don't depend whether redirection is enabled or not */ + test_wow64_redirection_for_dll("wlanapi.dll", FALSE); + test_wow64_redirection_for_dll("dxgi.dll", FALSE); + test_wow64_redirection_for_dll("dwrite.dll", FALSE); + test_wow64_redirection_for_dll("c:\windows\syswow64\wlanapi.dll", TRUE); + test_wow64_redirection_for_dll("c:\windows\syswow64\dxgi.dll", TRUE); + test_wow64_redirection_for_dll("c:\windows\syswow64\dwrite.dll", TRUE); }
static void test_dll_file( const char *name )