recent vs2022 upgrade bypasses _Mtx_init* calls
-- v2: msvcp140: Fix field order in _Mtx_t. msvcp140/tests: Add more tests for _Mtx_t.
From: Daniel Lehman dlehman25@gmail.com
--- dlls/msvcp140/tests/msvcp140.c | 16 +++++++++++++--- dlls/msvcp90/misc.c | 3 +++ 2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/dlls/msvcp140/tests/msvcp140.c b/dlls/msvcp140/tests/msvcp140.c index d2bcd192f45..7b6dfa1af3b 100644 --- a/dlls/msvcp140/tests/msvcp140.c +++ b/dlls/msvcp140/tests/msvcp140.c @@ -166,11 +166,15 @@ typedef struct void *tail; } critical_section;
-typedef struct -{ +typedef union { + critical_section conc; + SRWLOCK win; +} cs; + +typedef struct { DWORD flags; - critical_section cs; ULONG_PTR unknown; + cs cs; DWORD thread_id; DWORD count; } *_Mtx_t; @@ -1682,15 +1686,21 @@ static void test__Mtx(void)
ok(mtx->thread_id == -1, "mtx.thread_id = %lx\n", mtx->thread_id); ok(mtx->count == 0, "mtx.count = %lx\n", mtx->count); + todo_wine + ok(mtx->cs.win.Ptr == 0, "mtx.cs == %p\n", mtx->cs.win.Ptr); p__Mtx_lock(mtx); ok(mtx->thread_id == GetCurrentThreadId(), "mtx.thread_id = %lx\n", mtx->thread_id); ok(mtx->count == 1, "mtx.count = %lx\n", mtx->count); + ok(mtx->cs.win.Ptr != 0, "mtx.cs == %p\n", mtx->cs.win.Ptr); p__Mtx_lock(mtx); ok(mtx->thread_id == GetCurrentThreadId(), "mtx.thread_id = %lx\n", mtx->thread_id); ok(mtx->count == 1, "mtx.count = %lx\n", mtx->count); + ok(mtx->cs.win.Ptr != 0, "mtx.cs == %p\n", mtx->cs.win.Ptr); p__Mtx_unlock(mtx); ok(mtx->thread_id == -1, "mtx.thread_id = %lx\n", mtx->thread_id); ok(mtx->count == 0, "mtx.count = %lx\n", mtx->count); + todo_wine + ok(mtx->cs.win.Ptr == 0, "mtx.cs == %p\n", mtx->cs.win.Ptr); p__Mtx_unlock(mtx); ok(mtx->thread_id == -1, "mtx.thread_id = %lx\n", mtx->thread_id); ok(mtx->count == -1, "mtx.count = %lx\n", mtx->count); diff --git a/dlls/msvcp90/misc.c b/dlls/msvcp90/misc.c index a1c9c7f0646..ba94fe03eec 100644 --- a/dlls/msvcp90/misc.c +++ b/dlls/msvcp90/misc.c @@ -739,6 +739,9 @@ void __cdecl _Mtx_init_in_situ(_Mtx_t mtx, int flags) FIXME("unknown flags ignored: %x\n", flags);
mtx->flags = flags; +#if _MSVCP_VER >= 140 + mtx->unknown = 0; +#endif cs_init(&mtx->cs); mtx->thread_id = -1; mtx->count = 0;
From: Daniel Lehman dlehman25@gmail.com
--- dlls/msvcp140/tests/msvcp140.c | 2 -- dlls/msvcp90/misc.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/dlls/msvcp140/tests/msvcp140.c b/dlls/msvcp140/tests/msvcp140.c index 7b6dfa1af3b..0688239a1fc 100644 --- a/dlls/msvcp140/tests/msvcp140.c +++ b/dlls/msvcp140/tests/msvcp140.c @@ -1686,7 +1686,6 @@ static void test__Mtx(void)
ok(mtx->thread_id == -1, "mtx.thread_id = %lx\n", mtx->thread_id); ok(mtx->count == 0, "mtx.count = %lx\n", mtx->count); - todo_wine ok(mtx->cs.win.Ptr == 0, "mtx.cs == %p\n", mtx->cs.win.Ptr); p__Mtx_lock(mtx); ok(mtx->thread_id == GetCurrentThreadId(), "mtx.thread_id = %lx\n", mtx->thread_id); @@ -1699,7 +1698,6 @@ static void test__Mtx(void) p__Mtx_unlock(mtx); ok(mtx->thread_id == -1, "mtx.thread_id = %lx\n", mtx->thread_id); ok(mtx->count == 0, "mtx.count = %lx\n", mtx->count); - todo_wine ok(mtx->cs.win.Ptr == 0, "mtx.cs == %p\n", mtx->cs.win.Ptr); p__Mtx_unlock(mtx); ok(mtx->thread_id == -1, "mtx.thread_id = %lx\n", mtx->thread_id); diff --git a/dlls/msvcp90/misc.c b/dlls/msvcp90/misc.c index ba94fe03eec..088ecc9976c 100644 --- a/dlls/msvcp90/misc.c +++ b/dlls/msvcp90/misc.c @@ -715,10 +715,10 @@ unsigned int __cdecl _Random_device(void) typedef struct { DWORD flags; - cs cs; #if _MSVCP_VER >= 140 ULONG_PTR unknown; #endif + cs cs; DWORD thread_id; DWORD count; } *_Mtx_t;
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=151063
Your paranoid android.
=== debian11b (64 bit WoW report) ===
user32: input.c:4306: Test succeeded inside todo block: button_down_hwnd_todo 1: got MSG_TEST_WIN hwnd 0000000000D700F6, msg WM_LBUTTONDOWN, wparam 0x1, lparam 0x320032
This merge request was approved by Piotr Caban.