kernel32/tests: Don't crash the test if GetThreadContext fails.
This commit is contained in:
parent
1f8ba96128
commit
58b85bba3e
|
@ -795,6 +795,7 @@ static void test_SetThreadContext(void)
|
|||
HANDLE thread;
|
||||
DWORD threadid;
|
||||
DWORD prevcount;
|
||||
BOOL ret;
|
||||
|
||||
SetLastError(0xdeadbeef);
|
||||
event = CreateEvent( NULL, TRUE, FALSE, NULL );
|
||||
|
@ -811,8 +812,11 @@ static void test_SetThreadContext(void)
|
|||
|
||||
ctx.ContextFlags = CONTEXT_FULL;
|
||||
SetLastError(0xdeadbeef);
|
||||
ok( GetThreadContext( thread, &ctx ), "GetThreadContext failed : (%d)\n", GetLastError() );
|
||||
ret = GetThreadContext( thread, &ctx );
|
||||
ok( ret, "GetThreadContext failed : (%u)\n", GetLastError() );
|
||||
|
||||
if (ret)
|
||||
{
|
||||
/* simulate a call to set_test_val(10) */
|
||||
stack = (int *)ctx.Esp;
|
||||
stack[-1] = 10;
|
||||
|
@ -821,6 +825,7 @@ static void test_SetThreadContext(void)
|
|||
ctx.Eip = (DWORD)set_test_val;
|
||||
SetLastError(0xdeadbeef);
|
||||
ok( SetThreadContext( thread, &ctx ), "SetThreadContext failed : (%d)\n", GetLastError() );
|
||||
}
|
||||
|
||||
SetLastError(0xdeadbeef);
|
||||
prevcount = ResumeThread( thread );
|
||||
|
|
Loading…
Reference in New Issue