diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index c6e9a9b4a29..7007db0a00e 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -2684,6 +2684,7 @@ PRUNTIME_FUNCTION WINAPI RtlLookupFunctionEntry( ULONG64 pc, ULONG64 *base, UNWI func = lookup_function_info( pc, base, &module ); if (!func) { + *base = 0; if (module) WARN( "no exception table found in module %p pc %lx\n", module->BaseAddress, pc ); else diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c index 817a19c454e..8a80928954e 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -1487,8 +1487,8 @@ static void test_dynamic_unwind(void) func = pRtlLookupFunctionEntry( (ULONG_PTR)code_mem + code_offset + 16, &base, NULL ); ok( func == NULL, "RtlLookupFunctionEntry returned unexpected function, expected: NULL, got: %p\n", func ); - ok( base == 0xdeadbeef, - "RtlLookupFunctionEntry modified base address, expected: 0xdeadbeef, got: %lx\n", base ); + ok( !base || broken(base == 0xdeadbeef), + "RtlLookupFunctionEntry modified base address, expected: 0, got: %lx\n", base ); /* Test with pointer inside of our function */ base = 0xdeadbeef; @@ -1546,8 +1546,8 @@ static void test_dynamic_unwind(void) func = pRtlLookupFunctionEntry( (ULONG_PTR)code_mem + code_offset + 32, &base, NULL ); ok( func == NULL, "RtlLookupFunctionEntry returned unexpected function, expected: NULL, got: %p\n", func ); - ok( base == 0xdeadbeef, - "RtlLookupFunctionEntry modified base address, expected: 0xdeadbeef, got: %lx\n", base ); + ok( !base || broken(base == 0xdeadbeef), + "RtlLookupFunctionEntry modified base address, expected: 0, got: %lx\n", base ); ok( !count, "RtlLookupFunctionEntry issued %d unexpected calls to dynamic_unwind_callback\n", count );