Commit 6775a20f authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

ntdll/tests: Fix test_user_apc() on i386.

parent 021eefde
......@@ -8784,7 +8784,27 @@ static void test_user_apc(void)
pass = 0;
InterlockedIncrement(&pass);
#ifdef __i386__
{
/* RtlCaptureContext puts the return address of the caller's stack
* frame into %eip, so we need a thunk to get it to return here */
static const BYTE code[] =
{
0x55, /* pushl %ebp */
0x89, 0xe5, /* movl %esp, %ebp */
0xff, 0x75, 0x0c, /* pushl 0xc(%ebp) */
0xff, 0x55, 0x08, /* call *0x8(%ebp) */
0xc9, /* leave */
0xc3, /* ret */
};
void (__cdecl *func)(void *capture, CONTEXT *context) = code_mem;
memcpy(code_mem, code, sizeof(code));
func(RtlCaptureContext, &context);
}
#else
RtlCaptureContext(&context);
#endif
InterlockedIncrement(&pass);
if (pass == 2)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment