http://bugs.winehq.org/show_bug.cgi?id=58082
--- Comment #1 from Rastislav Stanik winehq@rastos.org --- Created attachment 78405 --> http://bugs.winehq.org/attachment.cgi?id=78405 program that exhibits the problem
The .zip file contains source code file, Visual Studio 2017 project file and resulting .exe. When the .exe is started without any arguments, it creates a thread and both the thread and main() call GlobalMemoryStatusEx() at the same time. On my system this results in following output:
C:\tmp>winebug58082.exe main found total memory 0 thread found total memory 270026698752
C:\tmp>winebug58082.exe thread found total memory 0 main found total memory 270026698752
There one of the calls returns incorrectly 0.
When started with an argument the argument is passed to Sleep() and causes the thread to wait a bit before calling GlobalMemoryStatusEx(). This on my system results in correct output:
C:\tmp>winebug58082.exe 1 main found total memory 270026698752 thread found total memory 270026698752