Commit 446243b1 authored by Paul Vriens's avatar Paul Vriens Committed by Alexandre Julliard

ntdll/tests: Free library after use.

parent 362f2cee
...@@ -118,8 +118,9 @@ static BOOL init_function_ptrs(void) ...@@ -118,8 +118,9 @@ static BOOL init_function_ptrs(void)
{ {
hntdll = LoadLibraryA("ntdll.dll"); hntdll = LoadLibraryA("ntdll.dll");
if (hntdll) if (!hntdll)
{ return FALSE;
pNtCompleteConnectPort = (void *)GetProcAddress(hntdll, "NtCompleteConnectPort"); pNtCompleteConnectPort = (void *)GetProcAddress(hntdll, "NtCompleteConnectPort");
pNtAcceptConnectPort = (void *)GetProcAddress(hntdll, "NtAcceptConnectPort"); pNtAcceptConnectPort = (void *)GetProcAddress(hntdll, "NtAcceptConnectPort");
pNtReplyPort = (void *)GetProcAddress(hntdll, "NtReplyPort"); pNtReplyPort = (void *)GetProcAddress(hntdll, "NtReplyPort");
...@@ -131,13 +132,13 @@ static BOOL init_function_ptrs(void) ...@@ -131,13 +132,13 @@ static BOOL init_function_ptrs(void)
pNtConnectPort = (void *)GetProcAddress(hntdll, "NtConnectPort"); pNtConnectPort = (void *)GetProcAddress(hntdll, "NtConnectPort");
pRtlInitUnicodeString = (void *)GetProcAddress(hntdll, "RtlInitUnicodeString"); pRtlInitUnicodeString = (void *)GetProcAddress(hntdll, "RtlInitUnicodeString");
pNtWaitForSingleObject = (void *)GetProcAddress(hntdll, "NtWaitForSingleObject"); pNtWaitForSingleObject = (void *)GetProcAddress(hntdll, "NtWaitForSingleObject");
}
if (!pNtCompleteConnectPort || !pNtAcceptConnectPort || if (!pNtCompleteConnectPort || !pNtAcceptConnectPort ||
!pNtReplyWaitReceivePort || !pNtCreatePort || !pNtRequestWaitReplyPort || !pNtReplyWaitReceivePort || !pNtCreatePort || !pNtRequestWaitReplyPort ||
!pNtRequestPort || !pNtRegisterThreadTerminatePort || !pNtRequestPort || !pNtRegisterThreadTerminatePort ||
!pNtConnectPort || !pRtlInitUnicodeString) !pNtConnectPort || !pRtlInitUnicodeString)
{ {
FreeLibrary(hntdll);
return FALSE; return FALSE;
} }
...@@ -309,4 +310,6 @@ START_TEST(port) ...@@ -309,4 +310,6 @@ START_TEST(port)
test_ports_server(); test_ports_server();
CloseHandle(thread); CloseHandle(thread);
FreeLibrary(hntdll);
} }
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