[PATCH] kernel32/tests: Test loading system DLLs with WoW64 redirection disabled

Alexandre Julliard julliard at winehq.org
Wed Oct 9 03:00:16 CDT 2019


Brendan Shanks <bshanks at codeweavers.com> writes:

> +    /* Only run tests on Win7/2008R2 (NT 6.1) and newer. The LoadLibrary calls fail on Vista/2008. */
> +    memset(&info, 0, sizeof(info));
> +    info.dwOSVersionInfoSize = sizeof(info);
> +    info.dwMajorVersion = 6;
> +    info.dwMinorVersion = 1;
> +    if (VerifyVersionInfoA(&info, VER_MAJORVERSION|VER_MINORVERSION|VER_SERVICEPACKMAJOR,
> +        VerSetConditionMask(VerSetConditionMask(VerSetConditionMask(0,
> +            VER_MAJORVERSION,VER_GREATER_EQUAL),
> +            VER_MINORVERSION,VER_GREATER_EQUAL),
> +            VER_SERVICEPACKMAJOR,VER_GREATER_EQUAL)) == 0)
> +        return;

Please don't do version checks in tests. You can mark results as broken
instead.

> +    /* Use system libraries that shouldn't already be loaded in this process. */
> +    lib = LoadLibraryExA("bcrypt.dll", NULL, 0);
> +    todo_wine ok (lib != NULL, "Loading bcrypt.dll should succeed with WOW64 redirection disabled\n");
> +    if (lib) FreeLibrary(lib);

It would be good to confirm that it wasn't previously loaded, using
GetModuleHandle(). Also testing the loaded module path with
GetModuleFileNameA() may be interesting.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list