1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

ntdll/tests: Directly link to setjmp().

This commit is contained in:
Alexandre Julliard 2024-03-12 17:45:18 +01:00
parent fd865a8386
commit 99aee076e5

View file

@ -147,7 +147,6 @@ static NTSTATUS (WINAPI *pRtlWow64GetThreadContext)(HANDLE, WOW64_CONTEXT *);
static NTSTATUS (WINAPI *pRtlWow64SetThreadContext)(HANDLE, const WOW64_CONTEXT *);
static NTSTATUS (WINAPI *pRtlWow64GetCpuAreaInfo)(WOW64_CPURESERVED*,ULONG,WOW64_CPU_AREA_INFO*);
static NTSTATUS (WINAPI *pRtlGetNativeSystemInformation)(SYSTEM_INFORMATION_CLASS,void*,ULONG,ULONG*);
static int (CDECL *p_setjmp)(_JUMP_BUFFER*);
#endif
enum debugger_stages
@ -2201,9 +2200,9 @@ static void test_restore_context(void)
int i;
LONG pass;
if (!pRtlUnwindEx || !pRtlRestoreContext || !pRtlCaptureContext || !p_setjmp)
if (!pRtlUnwindEx || !pRtlRestoreContext || !pRtlCaptureContext)
{
skip("RtlUnwindEx/RtlCaptureContext/RtlRestoreContext/_setjmp not found\n");
skip("RtlUnwindEx/RtlCaptureContext/RtlRestoreContext not found\n");
return;
}
@ -2221,12 +2220,12 @@ static void test_restore_context(void)
else
ok(pass < 4, "unexpected pass %ld\n", pass);
/* test with jmp using RltRestoreContext */
/* test with jmp using RtlRestoreContext */
pass = 0;
InterlockedIncrement(&pass);
RtlCaptureContext(&ctx);
InterlockedIncrement(&pass); /* only called once */
p_setjmp(&buf);
setjmp((_JBTYPE *)&buf);
InterlockedIncrement(&pass);
if (pass == 3)
{
@ -2285,7 +2284,7 @@ static void test_restore_context(void)
InterlockedIncrement(&pass);
pRtlCaptureContext(&ctx);
InterlockedIncrement(&pass); /* only called once */
p_setjmp(&buf);
setjmp((_JBTYPE *)&buf);
InterlockedIncrement(&pass);
if (pass == 3)
{
@ -2294,7 +2293,7 @@ static void test_restore_context(void)
rec.ExceptionInformation[0] = (DWORD64)&buf;
/* uses buf.Rip instead of bogus 0xdeadbeef */
pRtlUnwindEx((void*)buf.Rsp, (void*)0xdeadbeef, &rec, NULL, &ctx, NULL);
pRtlUnwindEx((void*)buf.Frame, (void*)0xdeadbeef, &rec, NULL, &ctx, NULL);
ok(0, "shouldn't be reached\n");
}
else
@ -10314,9 +10313,6 @@ static void test_backtrace(void)
START_TEST(exception)
{
HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
#if defined(__x86_64__)
HMODULE hmsvcrt = LoadLibraryA("msvcrt.dll");
#endif
hntdll = GetModuleHandleA("ntdll.dll");
my_argc = winetest_get_mainargs( &my_argv );
@ -10509,7 +10505,6 @@ START_TEST(exception)
X(RtlWow64GetCpuAreaInfo);
X(RtlGetNativeSystemInformation);
#undef X
p_setjmp = (void *)GetProcAddress( hmsvcrt, "_setjmp" );
if (pRtlGetNativeSystemInformation)
{