https://bugs.winehq.org/show_bug.cgi?id=56886
--- Comment #7 from Sven Baars sven.wine@gmail.com --- I still haven't figured out the exact implementation, but I found at least one issue with the current implementation.
if (CreateProcessA( "C:\windows\syswow64\msinfo32.exe", NULL, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi )) { [get the env from pi] query_env_var(env, L"PROCESSOR_ARCHITECTURE", is_win64 ? L"AMD64" : L"x86"); query_env_var(env, L"PROCESSOR_ARCHITEW6432", is_win64 ? NULL : L"AMD64"); }
The above test works for me on windows but fails for me on wine. The exact issue with this application is a bit different, but it's similar in the sense that the native machine is not reported where it should be.
Putting back the old code, but replacing
RtlInitUnicodeString( &nameW, L"x86" ); RtlSetEnvironmentVariable( env, &arch_strW, &nameW );
with RtlSetEnvironmentVariable( env, &arch_strW, get_machine_name( machine, &nameW ));
fixes the application and the above test.