msvcp140: Pad _Mtx_t struct to match Windows.
This commit is contained in:
parent
c3ee5751d5
commit
8536af685a
2 changed files with 34 additions and 0 deletions
|
@ -168,6 +168,7 @@ typedef struct
|
|||
{
|
||||
DWORD flags;
|
||||
critical_section cs;
|
||||
ULONG_PTR unknown;
|
||||
DWORD thread_id;
|
||||
DWORD count;
|
||||
} *_Mtx_t;
|
||||
|
@ -1640,6 +1641,35 @@ static void test_Copy_file(void)
|
|||
ok(SetCurrentDirectoryW(origin_path), "SetCurrentDirectoryW to origin_path failed\n");
|
||||
}
|
||||
|
||||
static void test__Mtx(void)
|
||||
{
|
||||
_Mtx_t mtx = NULL;
|
||||
int r;
|
||||
|
||||
r = p__Mtx_init(&mtx, 0);
|
||||
ok(!r, "failed to init mtx\n");
|
||||
|
||||
ok(mtx->thread_id == -1, "mtx.thread_id = %lx\n", mtx->thread_id);
|
||||
ok(mtx->count == 0, "mtx.count = %lx\n", mtx->count);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
p__Mtx_unlock(mtx);
|
||||
ok(mtx->thread_id == -1, "mtx.thread_id = %lx\n", mtx->thread_id);
|
||||
ok(mtx->count == -2, "mtx.count = %lx\n", mtx->count);
|
||||
|
||||
p__Mtx_destroy(mtx);
|
||||
}
|
||||
|
||||
START_TEST(msvcp140)
|
||||
{
|
||||
if(!init()) return;
|
||||
|
@ -1667,5 +1697,6 @@ START_TEST(msvcp140)
|
|||
test_Equivalent();
|
||||
test_cnd();
|
||||
test_Copy_file();
|
||||
test__Mtx();
|
||||
FreeLibrary(msvcp);
|
||||
}
|
||||
|
|
|
@ -716,6 +716,9 @@ typedef struct
|
|||
{
|
||||
DWORD flags;
|
||||
cs cs;
|
||||
#if _MSVCP_VER >= 140
|
||||
ULONG_PTR unknown;
|
||||
#endif
|
||||
DWORD thread_id;
|
||||
DWORD count;
|
||||
} *_Mtx_t;
|
||||
|
|
Loading…
Add table
Reference in a new issue