[PATCH 1/2] rundll32: Re-exec as 32-bit or 64-bit if necessary.

Alexandre Julliard julliard at winehq.org
Mon Sep 23 12:48:38 CDT 2019


Vincent Povirk <vincent at codeweavers.com> writes:

> +    /* Figure out what type of dll it is. */
> +    dll_type = get_image_type(szDllName);
> +
> +    /* Re-exec with another architecture if necessary. */
> +#ifdef __i386__
> +    if (dll_type == IMAGE_FILE_MACHINE_AMD64) {
> +        BOOL is_wow64;
> +        if (IsWow64Process(GetCurrentProcess(), &is_wow64) && is_wow64 && reexec_self(TRUE))
> +            goto CLEANUP;
> +    }
> +#endif
> +#ifdef __x86_64__
> +    if ((dll_type == IMAGE_FILE_MACHINE_I386 || dll_type == IMAGE_OS2_SIGNATURE) &&
> +        reexec_self(FALSE))
> +        goto CLEANUP;
> +#endif

You should probably use GetBinaryType(), so that you don't need
CPU-specific checks. Also I'd suggest doing this only when loading the
dll has failed.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list