Commit 9783ce36 authored by Paul Vriens's avatar Paul Vriens Committed by Alexandre Julliard

ntdll/tests: Do GetModuleHandle only once and add a few skip's.

parent 12ff6788
...@@ -537,7 +537,7 @@ static void test_exceptions(void) ...@@ -537,7 +537,7 @@ static void test_exceptions(void)
if (!pNtGetContextThread || !pNtSetContextThread) if (!pNtGetContextThread || !pNtSetContextThread)
{ {
trace( "NtGetContextThread/NtSetContextThread not found, skipping tests\n" ); skip( "NtGetContextThread/NtSetContextThread not found\n" );
return; return;
} }
...@@ -797,19 +797,21 @@ static void test_simd_exceptions(void) ...@@ -797,19 +797,21 @@ static void test_simd_exceptions(void)
START_TEST(exception) START_TEST(exception)
{ {
#ifdef __i386__ #ifdef __i386__
pNtCurrentTeb = (void *)GetProcAddress( GetModuleHandleA("ntdll.dll"), "NtCurrentTeb" ); HMODULE hntdll = GetModuleHandleA("ntdll.dll");
pNtGetContextThread = (void *)GetProcAddress( GetModuleHandleA("ntdll.dll"), "NtGetContextThread" );
pNtSetContextThread = (void *)GetProcAddress( GetModuleHandleA("ntdll.dll"), "NtSetContextThread" ); pNtCurrentTeb = (void *)GetProcAddress( hntdll, "NtCurrentTeb" );
pNtReadVirtualMemory = (void *)GetProcAddress( GetModuleHandleA("ntdll.dll"), "NtReadVirtualMemory" ); pNtGetContextThread = (void *)GetProcAddress( hntdll, "NtGetContextThread" );
pRtlRaiseException = (void *)GetProcAddress( GetModuleHandleA("ntdll.dll"), "RtlRaiseException" ); pNtSetContextThread = (void *)GetProcAddress( hntdll, "NtSetContextThread" );
pNtTerminateProcess = (void *)GetProcAddress( GetModuleHandleA("ntdll.dll"), "NtTerminateProcess" ); pNtReadVirtualMemory = (void *)GetProcAddress( hntdll, "NtReadVirtualMemory" );
pRtlAddVectoredExceptionHandler = (void *)GetProcAddress( GetModuleHandleA("ntdll.dll"), pRtlRaiseException = (void *)GetProcAddress( hntdll, "RtlRaiseException" );
pNtTerminateProcess = (void *)GetProcAddress( hntdll, "NtTerminateProcess" );
pRtlAddVectoredExceptionHandler = (void *)GetProcAddress( hntdll,
"RtlAddVectoredExceptionHandler" ); "RtlAddVectoredExceptionHandler" );
pRtlRemoveVectoredExceptionHandler = (void *)GetProcAddress( GetModuleHandleA("ntdll.dll"), pRtlRemoveVectoredExceptionHandler = (void *)GetProcAddress( hntdll,
"RtlRemoveVectoredExceptionHandler" ); "RtlRemoveVectoredExceptionHandler" );
if (!pNtCurrentTeb) if (!pNtCurrentTeb)
{ {
trace( "NtCurrentTeb not found, skipping tests\n" ); skip( "NtCurrentTeb not found\n" );
return; return;
} }
......
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