Hello, I've been stuck on this issue, where code compiled in Visual Studio (C++) and code compiled via the cross-compiler, MinGW, in a Wine test are behaving differently (I'm using Ubuntu 16.04). It is surprising me, because these are a few virtually identical API level calls and I assumed that would result in the same behavior. This is code from dlls/comctl32/tests/combo.c, compiled in the mirrored 64-bit build folder . I wrote a small test function in Wine, compiled and ran it. I wrote the same test in Visual Studio. These are all API level calls.
It is with Visual Studio that I boiled the bug I'm working on to a few sequential API calls, but, strangely, the cross-compiled code doesn't give the same results. I ran them both on Windows 10 and Windows 7. I can provide details, but I wonder if anyone has any insights concern these differences? Thanks!...John Alway
Am 12.11.19 um 19:38 schrieb Thales:
Hello,
I've been stuck on this issue, where code compiled in Visual Studio (C++) and code compiled via the cross-compiler, MinGW, in a Wine test are behaving differently (I'm using Ubuntu 16.04). It is surprising me, because these are a few virtually identical API level calls and I assumed that would result in the same behavior.
I ran into a similar issue in the dxgi tests, and what ultimately made the difference is the subsystem version in the PE header. Mingw sets it to NT 4.0 or 5.0, whereas Visual Studio 2017 (which I used at that time) set it to NT 6.0.
I don't remember the exact name of the fields in question, but if you compare the PE header with a tool like PE explorer you'll probably spot them.
Hey, thanks Stefan. I'll check that out! On Tuesday, November 12, 2019, 03:18:29 PM CST, Stefan Dösinger stefandoesinger@gmail.com wrote:
Am 12.11.19 um 19:38 schrieb Thales:
Hello,
I've been stuck on this issue, where code compiled in Visual Studio (C++) and code compiled via the cross-compiler, MinGW, in a Wine test are behaving differently (I'm using Ubuntu 16.04). It is surprising me, because these are a few virtually identical API level calls and I assumed that would result in the same behavior.
I ran into a similar issue in the dxgi tests, and what ultimately made the difference is the subsystem version in the PE header. Mingw sets it to NT 4.0 or 5.0, whereas Visual Studio 2017 (which I used at that time) set it to NT 6.0.
I don't remember the exact name of the fields in question, but if you compare the PE header with a tool like PE explorer you'll probably spot them.
Just for the record, in the "Optional Header," under the category "MajorSubsystemVersion," the mingw created PE binary has NT version 4 (released 1996), whereas the Visual Studio 2015 PE binary has it set to NT version 6 (released 2008). So, it's exactly as you said! Regards,...John Alway On Tuesday, November 12, 2019, 03:18:29 PM CST, Stefan Dösinger stefandoesinger@gmail.com wrote:
Am 12.11.19 um 19:38 schrieb Thales:
Hello,
I've been stuck on this issue, where code compiled in Visual Studio (C++) and code compiled via the cross-compiler, MinGW, in a Wine test are behaving differently (I'm using Ubuntu 16.04). It is surprising me, because these are a few virtually identical API level calls and I assumed that would result in the same behavior.
I ran into a similar issue in the dxgi tests, and what ultimately made the difference is the subsystem version in the PE header. Mingw sets it to NT 4.0 or 5.0, whereas Visual Studio 2017 (which I used at that time) set it to NT 6.0.
I don't remember the exact name of the fields in question, but if you compare the PE header with a tool like PE explorer you'll probably spot them.
Am 15.11.19 um 03:03 schrieb Thales:
Just for the record, in the "Optional Header," under the category "MajorSubsystemVersion," the mingw created PE binary has NT version 4 (released 1996), whereas the Visual Studio 2015 PE binary has it set to NT version 6 (released 2008).
So, it's exactly as you said!
Does this cause the behavior difference you see? If you edit the header manually, does the mingw build get the msvc behavior and vice versa?
Stefan, Coincidentally, I happen to have been working on that. I noticed that mingw is defaulting to Windows version 5 on Ubuntu for my little project. I'll let you know when I've written the app and tested it. Regards,...John Alway On Friday, November 15, 2019, 04:13:10 PM CST, Stefan Dösinger stefandoesinger@gmail.com wrote:
Am 15.11.19 um 03:03 schrieb Thales:
Just for the record, in the "Optional Header," under the category "MajorSubsystemVersion," the mingw created PE binary has NT version 4 (released 1996), whereas the Visual Studio 2015 PE binary has it set to NT version 6 (released 2008).
So, it's exactly as you said!
Does this cause the behavior difference you see? If you edit the header manually, does the mingw build get the msvc behavior and vice versa?
Stefan, When I change the MajorOperatingSystemVersion field in the PE files (I mistakenly referred to MajorSubsystemVersion above) for both the wine cross compiled and the Windows Visual Studio 2015 version, the performance of neither changed. Also, I realized that the version of mingw does default to 4. I read the wrong field. I'm pursuing another approach now. On Friday, November 15, 2019, 04:13:10 PM CST, Stefan Dösinger stefandoesinger@gmail.com wrote:
Am 15.11.19 um 03:03 schrieb Thales:
Just for the record, in the "Optional Header," under the category "MajorSubsystemVersion," the mingw created PE binary has NT version 4 (released 1996), whereas the Visual Studio 2015 PE binary has it set to NT version 6 (released 2008).
So, it's exactly as you said!
Does this cause the behavior difference you see? If you edit the header manually, does the mingw build get the msvc behavior and vice versa?
Okay, I decided to build my Visual Studio 2015 test application using mingw in Ubuntu as a separate project. When I did this, the test successfully showed the problem when run in Wine, whereas with Windows it worked fine. This means that with NT version 4 the problem also arises. I don't know exactly what accounts for the difference between that and the test as I set it up in dlls/comctl32/tests/combo.c. That's what I'll look into now. Regards,...John Alway On Friday, November 15, 2019, 11:30:53 PM CST, Thales thaleslv@yahoo.com wrote:
Stefan, When I change the MajorOperatingSystemVersion field in the PE files (I mistakenly referred to MajorSubsystemVersion above) for both the wine cross compiled and the Windows Visual Studio 2015 version, the performance of neither changed. Also, I realized that the version of mingw does default to 4. I read the wrong field. I'm pursuing another approach now. On Friday, November 15, 2019, 04:13:10 PM CST, Stefan Dösinger stefandoesinger@gmail.com wrote:
Am 15.11.19 um 03:03 schrieb Thales:
Just for the record, in the "Optional Header," under the category "MajorSubsystemVersion," the mingw created PE binary has NT version 4 (released 1996), whereas the Visual Studio 2015 PE binary has it set to NT version 6 (released 2008).
So, it's exactly as you said!
Does this cause the behavior difference you see? If you edit the header manually, does the mingw build get the msvc behavior and vice versa?