https://bugs.winehq.org/show_bug.cgi?id=47075
--- Comment #6 from Vincent Povirk madewokherd@gmail.com --- We can't assume that ERROR_BAD_EXE_FORMAT indicates wrong CPU architecture. We want to avoid infinite recursion if we attempt to re-exec in both directions.
If we have a way to read the architecture from a PE image, we could check whether the dll architecture matches the exe, and if not check it against rundll32.exe in sysnative and syswow64.