https://bugs.winehq.org/show_bug.cgi?id=40350
--- Comment #1 from Henri Verbeet hverbeet@gmail.com --- (In reply to Dmitry from comment #0)
The main question: Why it works correctly in windows and how to workaround this in wine?
Well, the issue is the difference in calling convention between gcc and msvc that you mention. My guess would be that you're just getting lucky with the stack layout with MinGW on Windows. You can tweak the function prototype to make it more or less work, which is what the "#ifdef DLL_LOADER" bit does (although I don't think it's quite right either, PM_PlayerTraceExt() has the same issue). It would be much better to just avoid returning aggregates.