From: Hugh McMaster hugh.mcmaster@outlook.com
--- dlls/kernel32/tests/process.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c index 9faec85badf..74d61bdfa30 100644 --- a/dlls/kernel32/tests/process.c +++ b/dlls/kernel32/tests/process.c @@ -71,6 +71,7 @@ static HANDLE (WINAPI *pCreateJobObjectW)(LPSECURITY_ATTRIBUTES sa, LPCWSTR name static HANDLE (WINAPI *pCreateToolhelp32Snapshot)(DWORD, DWORD); static void (WINAPI *pDeleteProcThreadAttributeList)(struct _PROC_THREAD_ATTRIBUTE_LIST*); static DWORD (WINAPI *pGetActiveProcessorCount)(WORD); +static BOOL (WINAPI *pGetFileInformationByHandleEx)(HANDLE, FILE_INFO_BY_HANDLE_CLASS, LPVOID, DWORD); static SIZE_T (WINAPI *pGetLargePageMinimum)(void); static BOOL (WINAPI *pGetLogicalProcessorInformationEx)(LOGICAL_PROCESSOR_RELATIONSHIP,SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX*,DWORD*); static DWORD (WINAPI *pGetMaximumProcessorCount)(WORD); @@ -252,6 +253,7 @@ static BOOL init(void) hkernel32 = GetModuleHandleA("kernel32"); hntdll = GetModuleHandleA("ntdll.dll");
+ pGetFileInformationByHandleEx = (void *)GetProcAddress(hkernel32, "GetFileInformationByHandleEx"); pGetNativeSystemInfo = (void *) GetProcAddress(hkernel32, "GetNativeSystemInfo"); pGetSystemRegistryQuota = (void *) GetProcAddress(hkernel32, "GetSystemRegistryQuota"); pIsWow64Process = (void *) GetProcAddress(hkernel32, "IsWow64Process"); @@ -4267,6 +4269,12 @@ static void test_handle_list_attribute(BOOL child, HANDLE handle1, HANDLE handle BOOL ret; SECURITY_ATTRIBUTES sa;
+ if (!pGetFileInformationByHandleEx) + { + win_skip("GetFileInformationByHandleEx not available.\n"); + return; + } + if (child) { char name1[256], name2[256]; @@ -4276,7 +4284,7 @@ static void test_handle_list_attribute(BOOL child, HANDLE handle1, HANDLE handle ret = GetHandleInformation(handle1, &flags); ok(ret, "Failed to get handle info, error %ld.\n", GetLastError()); ok(flags == HANDLE_FLAG_INHERIT, "Unexpected flags %#lx.\n", flags); - ret = GetFileInformationByHandleEx(handle1, FileNameInfo, name1, sizeof(name1)); + ret = pGetFileInformationByHandleEx(handle1, FileNameInfo, name1, sizeof(name1)); ok(ret, "Failed to get pipe name, error %ld\n", GetLastError()); CloseHandle(handle1); flags = 0; @@ -4284,7 +4292,7 @@ static void test_handle_list_attribute(BOOL child, HANDLE handle1, HANDLE handle if (ret) { ok(!(flags & HANDLE_FLAG_INHERIT), "Parent's handle shouldn't have been inherited\n"); - ret = GetFileInformationByHandleEx(handle2, FileNameInfo, name2, sizeof(name2)); + ret = pGetFileInformationByHandleEx(handle2, FileNameInfo, name2, sizeof(name2)); ok(!ret || strcmp(name1, name2), "Parent's handle shouldn't have been inherited\n"); } else