From: Jacek Caban <jacek@codeweavers.com> Fixes -Wunused-but-set-global warnings. --- dlls/ntdll/tests/directory.c | 2 -- dlls/ntdll/tests/file.c | 6 ------ dlls/ntdll/tests/large_int.c | 6 +++++- dlls/ntdll/tests/rtl.c | 6 +++++- dlls/ntdll/tests/rtlstr.c | 12 ------------ dlls/ntdll/tests/thread.c | 15 +++++++++------ dlls/ntdll/tests/time.c | 4 ++++ dlls/ntdll/tests/virtual.c | 21 ++++++++++++++++----- 8 files changed, 39 insertions(+), 33 deletions(-) diff --git a/dlls/ntdll/tests/directory.c b/dlls/ntdll/tests/directory.c index 4865ec5b0d0..0ec1fc26842 100644 --- a/dlls/ntdll/tests/directory.c +++ b/dlls/ntdll/tests/directory.c @@ -45,7 +45,6 @@ static NTSTATUS (WINAPI *pNtQueryDirectoryFile)(HANDLE,HANDLE,PIO_APC_ROUTINE,PV PVOID,ULONG,FILE_INFORMATION_CLASS,BOOLEAN,PUNICODE_STRING,BOOLEAN); static NTSTATUS (WINAPI *pNtQueryInformationFile)(HANDLE,PIO_STATUS_BLOCK,PVOID,LONG,FILE_INFORMATION_CLASS); static NTSTATUS (WINAPI *pNtSetInformationFile)(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS); -static BOOLEAN (WINAPI *pRtlCreateUnicodeStringFromAsciiz)(PUNICODE_STRING,LPCSTR); static BOOL (WINAPI *pRtlDosPathNameToNtPathName_U)( LPCWSTR, PUNICODE_STRING, PWSTR*, CURDIR* ); static VOID (WINAPI *pRtlInitUnicodeString)( PUNICODE_STRING, LPCWSTR ); static VOID (WINAPI *pRtlFreeUnicodeString)( PUNICODE_STRING ); @@ -1721,7 +1720,6 @@ START_TEST(directory) pNtQueryDirectoryFile = (void *)GetProcAddress(hntdll, "NtQueryDirectoryFile"); pNtQueryInformationFile = (void *)GetProcAddress(hntdll, "NtQueryInformationFile"); pNtSetInformationFile = (void *)GetProcAddress(hntdll, "NtSetInformationFile"); - pRtlCreateUnicodeStringFromAsciiz = (void *)GetProcAddress(hntdll, "RtlCreateUnicodeStringFromAsciiz"); pRtlDosPathNameToNtPathName_U = (void *)GetProcAddress(hntdll, "RtlDosPathNameToNtPathName_U"); pRtlInitUnicodeString = (void *)GetProcAddress(hntdll, "RtlInitUnicodeString"); pRtlFreeUnicodeString = (void *)GetProcAddress(hntdll, "RtlFreeUnicodeString"); diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index 69aac1506e7..6268870bc08 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -67,13 +67,10 @@ static NTSTATUS (WINAPI *pNtWriteFile)(HANDLE hFile, HANDLE hEvent, PIO_STATUS_BLOCK io_status, const void* buffer, ULONG length, PLARGE_INTEGER offset, PULONG key); -static NTSTATUS (WINAPI *pNtCancelIoFile)(HANDLE hFile, PIO_STATUS_BLOCK io_status); -static NTSTATUS (WINAPI *pNtCancelIoFileEx)(HANDLE hFile, PIO_STATUS_BLOCK iosb, PIO_STATUS_BLOCK io_status); static NTSTATUS (WINAPI *pNtClose)( PHANDLE ); static NTSTATUS (WINAPI *pNtFsControlFile) (HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, PVOID apc_context, PIO_STATUS_BLOCK io, ULONG code, PVOID in_buffer, ULONG in_size, PVOID out_buffer, ULONG out_size); static NTSTATUS (WINAPI *pNtCreateIoCompletion)(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, ULONG); -static NTSTATUS (WINAPI *pNtOpenIoCompletion)(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES); static NTSTATUS (WINAPI *pNtQueryIoCompletion)(HANDLE, IO_COMPLETION_INFORMATION_CLASS, PVOID, ULONG, PULONG); static NTSTATUS (WINAPI *pNtRemoveIoCompletion)(HANDLE, PULONG_PTR, PULONG_PTR, PIO_STATUS_BLOCK, PLARGE_INTEGER); static NTSTATUS (WINAPI *pNtRemoveIoCompletionEx)(HANDLE,FILE_IO_COMPLETION_INFORMATION*,ULONG,ULONG*,LARGE_INTEGER*,BOOLEAN); @@ -7390,12 +7387,9 @@ START_TEST(file) pNtDeleteFile = (void *)GetProcAddress(hntdll, "NtDeleteFile"); pNtReadFile = (void *)GetProcAddress(hntdll, "NtReadFile"); pNtWriteFile = (void *)GetProcAddress(hntdll, "NtWriteFile"); - pNtCancelIoFile = (void *)GetProcAddress(hntdll, "NtCancelIoFile"); - pNtCancelIoFileEx = (void *)GetProcAddress(hntdll, "NtCancelIoFileEx"); pNtClose = (void *)GetProcAddress(hntdll, "NtClose"); pNtFsControlFile = (void *)GetProcAddress(hntdll, "NtFsControlFile"); pNtCreateIoCompletion = (void *)GetProcAddress(hntdll, "NtCreateIoCompletion"); - pNtOpenIoCompletion = (void *)GetProcAddress(hntdll, "NtOpenIoCompletion"); pNtQueryIoCompletion = (void *)GetProcAddress(hntdll, "NtQueryIoCompletion"); pNtRemoveIoCompletion = (void *)GetProcAddress(hntdll, "NtRemoveIoCompletion"); pNtRemoveIoCompletionEx = (void *)GetProcAddress(hntdll, "NtRemoveIoCompletionEx"); diff --git a/dlls/ntdll/tests/large_int.c b/dlls/ntdll/tests/large_int.c index d6d9c824002..6490ee3c341 100644 --- a/dlls/ntdll/tests/large_int.c +++ b/dlls/ntdll/tests/large_int.c @@ -40,12 +40,14 @@ static NTSTATUS (WINAPI *pRtlInt64ToUnicodeString)(ULONGLONG, ULONG, UNICODE_STR static NTSTATUS (WINAPI *pRtlLargeIntegerToChar)(ULONGLONG *, ULONG, ULONG, PCHAR); static NTSTATUS (WINAPI *pRtlUnicodeStringToAnsiString)(STRING *, const UNICODE_STRING *, BOOLEAN); +#ifdef __i386__ static LONGLONG (WINAPI *p_alldiv)( LONGLONG a, LONGLONG b ); static LONGLONG (WINAPI *p_allrem)( LONGLONG a, LONGLONG b ); static LONGLONG (WINAPI *p_allmul)( LONGLONG a, LONGLONG b ); static ULONGLONG (WINAPI *p_aulldiv)( ULONGLONG a, ULONGLONG b ); static ULONGLONG (WINAPI *p_aullrem)( ULONGLONG a, ULONGLONG b ); static void *p_allshl, *p_allshr, *p_aullshr; +#endif static void InitFunctionPtrs(void) { @@ -58,6 +60,7 @@ static void InitFunctionPtrs(void) pRtlLargeIntegerToChar = (void *)GetProcAddress(hntdll, "RtlLargeIntegerToChar"); pRtlUnicodeStringToAnsiString = (void *)GetProcAddress(hntdll, "RtlUnicodeStringToAnsiString"); +#ifdef __i386__ p_alldiv = (void *)GetProcAddress(hntdll, "_alldiv"); p_allrem = (void *)GetProcAddress(hntdll, "_allrem"); p_allmul = (void *)GetProcAddress(hntdll, "_allmul"); @@ -66,7 +69,8 @@ static void InitFunctionPtrs(void) p_aulldiv = (void *)GetProcAddress(hntdll, "_aulldiv"); p_aullrem = (void *)GetProcAddress(hntdll, "_aullrem"); p_aullshr = (void *)GetProcAddress(hntdll, "_aullshr"); - } /* if */ +#endif + } } #define ULL(a,b) (((ULONGLONG)(a) << 32) | (b)) diff --git a/dlls/ntdll/tests/rtl.c b/dlls/ntdll/tests/rtl.c index 421d7e6afbe..3dedd78f6a9 100644 --- a/dlls/ntdll/tests/rtl.c +++ b/dlls/ntdll/tests/rtl.c @@ -99,9 +99,11 @@ static VOID (WINAPI *pRtlMoveMemory)(LPVOID,LPCVOID,SIZE_T); static VOID (WINAPI *pRtlFillMemory)(LPVOID,SIZE_T,BYTE); static VOID (WINAPI *pRtlFillMemoryUlong)(LPVOID,SIZE_T,ULONG); static VOID (WINAPI *pRtlZeroMemory)(LPVOID,SIZE_T); +#ifdef __i386__ static USHORT (FASTCALL *pRtlUshortByteSwap)(USHORT source); static ULONG (FASTCALL *pRtlUlongByteSwap)(ULONG source); static ULONGLONG (FASTCALL *pRtlUlonglongByteSwap)(ULONGLONG source); +#endif static void * (WINAPI *pRtlGetElementGenericTable)(PRTL_GENERIC_TABLE, ULONG); static DWORD (WINAPI *pRtlGetThreadErrorMode)(void); static NTSTATUS (WINAPI *pRtlSetThreadErrorMode)(DWORD, LPDWORD); @@ -173,9 +175,11 @@ static void InitFunctionPtrs(void) pRtlFillMemory = (void *)GetProcAddress(hntdll, "RtlFillMemory"); pRtlFillMemoryUlong = (void *)GetProcAddress(hntdll, "RtlFillMemoryUlong"); pRtlZeroMemory = (void *)GetProcAddress(hntdll, "RtlZeroMemory"); +#ifdef __i386__ pRtlUshortByteSwap = (void *)GetProcAddress(hntdll, "RtlUshortByteSwap"); pRtlUlongByteSwap = (void *)GetProcAddress(hntdll, "RtlUlongByteSwap"); pRtlUlonglongByteSwap = (void *)GetProcAddress(hntdll, "RtlUlonglongByteSwap"); +#endif pRtlGetElementGenericTable = (void *)GetProcAddress(hntdll, "RtlGetElementGenericTable"); pRtlGetThreadErrorMode = (void *)GetProcAddress(hntdll, "RtlGetThreadErrorMode"); pRtlSetThreadErrorMode = (void *)GetProcAddress(hntdll, "RtlSetThreadErrorMode"); @@ -426,7 +430,7 @@ static void test_RtlByteSwap(void) ULONG lresult; USHORT sresult; -#ifdef _WIN64 +#ifndef __i386__ /* the Rtl*ByteSwap() are always inlined and not exported from ntdll on 64bit */ sresult = RtlUshortByteSwap( 0x1234 ); ok( 0x3412 == sresult, diff --git a/dlls/ntdll/tests/rtlstr.c b/dlls/ntdll/tests/rtlstr.c index 3faf7b36a97..287072f9b74 100644 --- a/dlls/ntdll/tests/rtlstr.c +++ b/dlls/ntdll/tests/rtlstr.c @@ -38,7 +38,6 @@ /* Function ptrs for ntdll calls */ static HMODULE hntdll = 0; -static NTSTATUS (WINAPI *pRtlAnsiStringToUnicodeString)(PUNICODE_STRING, PCANSI_STRING, BOOLEAN); static NTSTATUS (WINAPI *pRtlAppendAsciizToString)(STRING *, LPCSTR); static NTSTATUS (WINAPI *pRtlAppendStringToString)(STRING *, const STRING *); static NTSTATUS (WINAPI *pRtlAppendUnicodeStringToString)(UNICODE_STRING *, const UNICODE_STRING *); @@ -47,11 +46,8 @@ static NTSTATUS (WINAPI *pRtlCharToInteger)(PCSZ, ULONG, int *); static LONG (WINAPI *pRtlCompareUnicodeString)(const UNICODE_STRING*, const UNICODE_STRING*, BOOLEAN); static LONG (WINAPI *pRtlCompareUnicodeStrings)(const WCHAR *,SIZE_T,const WCHAR *,SIZE_T,BOOLEAN); static VOID (WINAPI *pRtlCopyString)(STRING *, const STRING *); -static BOOLEAN (WINAPI *pRtlCreateUnicodeString)(PUNICODE_STRING, LPCWSTR); -static BOOLEAN (WINAPI *pRtlCreateUnicodeStringFromAsciiz)(PUNICODE_STRING, LPCSTR); static NTSTATUS (WINAPI *pRtlDowncaseUnicodeString)(UNICODE_STRING *, const UNICODE_STRING *, BOOLEAN); static NTSTATUS (WINAPI *pRtlDuplicateUnicodeString)(int, UNICODE_STRING *, UNICODE_STRING *); -static BOOLEAN (WINAPI *pRtlEqualUnicodeString)(const UNICODE_STRING *, const UNICODE_STRING *, BOOLEAN); static NTSTATUS (WINAPI *pRtlFindCharInUnicodeString)(int, const UNICODE_STRING *, const UNICODE_STRING *, USHORT *); static VOID (WINAPI *pRtlFreeAnsiString)(PSTRING); static VOID (WINAPI *pRtlFreeUnicodeString)(PUNICODE_STRING); @@ -61,14 +57,12 @@ static VOID (WINAPI *pRtlInitUnicodeString)(PUNICODE_STRING, LPCWSTR); static NTSTATUS (WINAPI *pRtlInitUnicodeStringEx)(PUNICODE_STRING, LPCWSTR); static NTSTATUS (WINAPI *pRtlIntegerToChar)(ULONG, ULONG, ULONG, PCHAR); static NTSTATUS (WINAPI *pRtlIntegerToUnicodeString)(ULONG, ULONG, UNICODE_STRING *); -static NTSTATUS (WINAPI *pRtlMultiAppendUnicodeStringBuffer)(UNICODE_STRING *, LONG, UNICODE_STRING *); static NTSTATUS (WINAPI *pRtlUnicodeStringToAnsiString)(STRING *, const UNICODE_STRING *, BOOLEAN); static NTSTATUS (WINAPI *pRtlUnicodeStringToInteger)(const UNICODE_STRING *, int, int *); static WCHAR (WINAPI *pRtlUpcaseUnicodeChar)(WCHAR); static NTSTATUS (WINAPI *pRtlUpcaseUnicodeString)(UNICODE_STRING *, const UNICODE_STRING *, BOOLEAN); static CHAR (WINAPI *pRtlUpperChar)(CHAR); static NTSTATUS (WINAPI *pRtlUpperString)(STRING *, const STRING *); -static NTSTATUS (WINAPI *pRtlValidateUnicodeString)(LONG, UNICODE_STRING *); static NTSTATUS (WINAPI *pRtlGUIDFromString)(const UNICODE_STRING*,GUID*); static NTSTATUS (WINAPI *pRtlStringFromGUID)(const GUID*, UNICODE_STRING*); static BOOLEAN (WINAPI *pRtlIsTextUnicode)(LPVOID, INT, INT *); @@ -111,7 +105,6 @@ static void InitFunctionPtrs(void) hntdll = LoadLibraryA("ntdll.dll"); ok(hntdll != 0, "LoadLibrary failed\n"); if (hntdll) { - pRtlAnsiStringToUnicodeString = (void *)GetProcAddress(hntdll, "RtlAnsiStringToUnicodeString"); pRtlAppendAsciizToString = (void *)GetProcAddress(hntdll, "RtlAppendAsciizToString"); pRtlAppendStringToString = (void *)GetProcAddress(hntdll, "RtlAppendStringToString"); pRtlAppendUnicodeStringToString = (void *)GetProcAddress(hntdll, "RtlAppendUnicodeStringToString"); @@ -120,11 +113,8 @@ static void InitFunctionPtrs(void) pRtlCompareUnicodeString = (void *)GetProcAddress(hntdll, "RtlCompareUnicodeString"); pRtlCompareUnicodeStrings = (void *)GetProcAddress(hntdll, "RtlCompareUnicodeStrings"); pRtlCopyString = (void *)GetProcAddress(hntdll, "RtlCopyString"); - pRtlCreateUnicodeString = (void *)GetProcAddress(hntdll, "RtlCreateUnicodeString"); - pRtlCreateUnicodeStringFromAsciiz = (void *)GetProcAddress(hntdll, "RtlCreateUnicodeStringFromAsciiz"); pRtlDowncaseUnicodeString = (void *)GetProcAddress(hntdll, "RtlDowncaseUnicodeString"); pRtlDuplicateUnicodeString = (void *)GetProcAddress(hntdll, "RtlDuplicateUnicodeString"); - pRtlEqualUnicodeString = (void *)GetProcAddress(hntdll, "RtlEqualUnicodeString"); pRtlFindCharInUnicodeString = (void *)GetProcAddress(hntdll, "RtlFindCharInUnicodeString"); pRtlFreeAnsiString = (void *)GetProcAddress(hntdll, "RtlFreeAnsiString"); pRtlFreeUnicodeString = (void *)GetProcAddress(hntdll, "RtlFreeUnicodeString"); @@ -134,14 +124,12 @@ static void InitFunctionPtrs(void) pRtlInitUnicodeStringEx = (void *)GetProcAddress(hntdll, "RtlInitUnicodeStringEx"); pRtlIntegerToChar = (void *)GetProcAddress(hntdll, "RtlIntegerToChar"); pRtlIntegerToUnicodeString = (void *)GetProcAddress(hntdll, "RtlIntegerToUnicodeString"); - pRtlMultiAppendUnicodeStringBuffer = (void *)GetProcAddress(hntdll, "RtlMultiAppendUnicodeStringBuffer"); pRtlUnicodeStringToAnsiString = (void *)GetProcAddress(hntdll, "RtlUnicodeStringToAnsiString"); pRtlUnicodeStringToInteger = (void *)GetProcAddress(hntdll, "RtlUnicodeStringToInteger"); pRtlUpcaseUnicodeChar = (void *)GetProcAddress(hntdll, "RtlUpcaseUnicodeChar"); pRtlUpcaseUnicodeString = (void *)GetProcAddress(hntdll, "RtlUpcaseUnicodeString"); pRtlUpperChar = (void *)GetProcAddress(hntdll, "RtlUpperChar"); pRtlUpperString = (void *)GetProcAddress(hntdll, "RtlUpperString"); - pRtlValidateUnicodeString = (void *)GetProcAddress(hntdll, "RtlValidateUnicodeString"); pRtlGUIDFromString = (void *)GetProcAddress(hntdll, "RtlGUIDFromString"); pRtlStringFromGUID = (void *)GetProcAddress(hntdll, "RtlStringFromGUID"); pRtlIsTextUnicode = (void *)GetProcAddress(hntdll, "RtlIsTextUnicode"); diff --git a/dlls/ntdll/tests/thread.c b/dlls/ntdll/tests/thread.c index 580870bc747..7416fd6d18c 100644 --- a/dlls/ntdll/tests/thread.c +++ b/dlls/ntdll/tests/thread.c @@ -36,8 +36,6 @@ static NTSTATUS (WINAPI *pNtAllocateReserveObject)( HANDLE *, const OBJECT_ATTRI static NTSTATUS (WINAPI *pNtCreateThreadEx)( HANDLE *, ACCESS_MASK, OBJECT_ATTRIBUTES *, HANDLE, PRTL_THREAD_START_ROUTINE, void *, ULONG, ULONG_PTR, SIZE_T, SIZE_T, PS_ATTRIBUTE_LIST * ); -static NTSTATUS (WINAPI *pNtAllocateVirtualMemoryEx)(HANDLE, PVOID *, SIZE_T *, ULONG, ULONG, - MEM_EXTENDED_PARAMETER *, ULONG); static NTSTATUS (WINAPI *pNtSuspendProcess)(HANDLE process); static NTSTATUS (WINAPI *pNtResumeProcess)(HANDLE process); static NTSTATUS (WINAPI *pNtQueueApcThreadEx)(HANDLE handle, HANDLE reserve_handle, PNTAPCFUNC func, @@ -46,6 +44,11 @@ static NTSTATUS (WINAPI *pNtQueueApcThreadEx2)(HANDLE handle, HANDLE reserve_ha ULONG_PTR arg1, ULONG_PTR arg2, ULONG_PTR arg3); static NTSTATUS (WINAPI *pRtlWow64GetProcessMachines)(HANDLE, WORD*, WORD*); +#ifdef __x86_64__ +static NTSTATUS (WINAPI *pNtAllocateVirtualMemoryEx)(HANDLE, PVOID *, SIZE_T *, ULONG, ULONG, + MEM_EXTENDED_PARAMETER *, ULONG); +#endif + static int * (CDECL *p_errno)(void); static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL); @@ -57,7 +60,6 @@ static void init_function_pointers(void) hdll = GetModuleHandleA( "ntdll.dll" ); GET_FUNC( NtAllocateReserveObject ); GET_FUNC( NtCreateThreadEx ); - GET_FUNC( NtAllocateVirtualMemoryEx ); GET_FUNC( NtSuspendProcess ); GET_FUNC( NtQueueApcThreadEx ); GET_FUNC( NtQueueApcThreadEx2 ); @@ -65,6 +67,10 @@ static void init_function_pointers(void) GET_FUNC( RtlWow64GetProcessMachines ); GET_FUNC( _errno ); +#ifdef __x86_64__ + GET_FUNC( NtAllocateVirtualMemoryEx ); +#endif + hdll = GetModuleHandleA( "kernel32.dll" ); GET_FUNC( IsWow64Process ); #undef GET_FUNC @@ -304,11 +310,8 @@ static void test_thread_bypass_process_freeze(void) CloseHandle( thread ); } -static int apc_count; - static void CALLBACK apc_func( ULONG_PTR arg1, ULONG_PTR arg2, ULONG_PTR arg3 ) { - ++apc_count; } static void test_NtQueueApcThreadEx(void) diff --git a/dlls/ntdll/tests/time.c b/dlls/ntdll/tests/time.c index 7b7daae2a3d..a885254b4af 100644 --- a/dlls/ntdll/tests/time.c +++ b/dlls/ntdll/tests/time.c @@ -42,8 +42,10 @@ static NTSTATUS (WINAPI *pRtlQueryTimeZoneInformation)( RTL_TIME_ZONE_INFORMATIO static NTSTATUS (WINAPI *pRtlQueryDynamicTimeZoneInformation)( RTL_DYNAMIC_TIME_ZONE_INFORMATION *); static BOOL (WINAPI *pRtlQueryUnbiasedInterruptTime)( ULONGLONG *time ); +#if (defined(__i386__) || defined(__x86_64__)) && !defined(__arm64ec__) static BOOL (WINAPI *pRtlQueryPerformanceCounter)(LARGE_INTEGER*); static BOOL (WINAPI *pRtlQueryPerformanceFrequency)(LARGE_INTEGER*); +#endif static NTSTATUS (WINAPI *pNtConvertBetweenAuxiliaryCounterAndPerformanceCounter)(ULONG, ULONGLONG *, ULONGLONG *, ULONGLONG *); static HRESULT (WINAPI *pConvertAuxiliaryCounterToPerformanceCounter)(ULONGLONG, ULONGLONG *, ULONGLONG *); @@ -539,8 +541,10 @@ START_TEST(time) pRtlQueryDynamicTimeZoneInformation = (void *)GetProcAddress(mod, "RtlQueryDynamicTimeZoneInformation"); pRtlQueryUnbiasedInterruptTime = (void *)GetProcAddress(mod, "RtlQueryUnbiasedInterruptTime"); +#if (defined(__i386__) || defined(__x86_64__)) && !defined(__arm64ec__) pRtlQueryPerformanceCounter = (void *)GetProcAddress(mod, "RtlQueryPerformanceCounter"); pRtlQueryPerformanceFrequency = (void *)GetProcAddress(mod, "RtlQueryPerformanceFrequency"); +#endif pNtConvertBetweenAuxiliaryCounterAndPerformanceCounter = (void *)GetProcAddress(mod, "NtConvertBetweenAuxiliaryCounterAndPerformanceCounter"); diff --git a/dlls/ntdll/tests/virtual.c b/dlls/ntdll/tests/virtual.c index 809c45e278d..5d34639cf7c 100644 --- a/dlls/ntdll/tests/virtual.c +++ b/dlls/ntdll/tests/virtual.c @@ -37,8 +37,6 @@ static ULONG64 (WINAPI *pRtlGetEnabledExtendedFeatures)(ULONG64); static NTSTATUS (WINAPI *pRtlFreeUserStack)(void *); static void * (WINAPI *pRtlFindExportedRoutineByName)(HMODULE,const char*); static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL); -static NTSTATUS (WINAPI *pRtlGetNativeSystemInformation)(SYSTEM_INFORMATION_CLASS, PVOID, ULONG, PULONG); -static BOOLEAN (WINAPI *pRtlIsEcCode)(const void *); static NTSTATUS (WINAPI *pNtAllocateVirtualMemoryEx)(HANDLE, PVOID *, SIZE_T *, ULONG, ULONG, MEM_EXTENDED_PARAMETER *, ULONG); static NTSTATUS (WINAPI *pNtMapViewOfSectionEx)(HANDLE, HANDLE, PVOID *, const LARGE_INTEGER *, SIZE_T *, @@ -47,6 +45,14 @@ static NTSTATUS (WINAPI *pNtSetInformationVirtualMemory)(HANDLE, VIRTUAL_MEMORY_ ULONG_PTR, PMEMORY_RANGE_ENTRY, PVOID, ULONG); +#ifndef __aarch64__ +static NTSTATUS (WINAPI *pRtlGetNativeSystemInformation)(SYSTEM_INFORMATION_CLASS, PVOID, ULONG, PULONG); +#endif + +#ifdef __x86_64__ +static BOOLEAN (WINAPI *pRtlIsEcCode)(const void *); +#endif + static const BOOL is_win64 = sizeof(void*) != sizeof(int); static BOOL is_wow64; @@ -3329,7 +3335,7 @@ static void test_exec_memory_writes(void) SYSTEM_CPU_INFORMATION info; ULONG len; - RtlGetNativeSystemInformation( SystemCpuInformation, &info, sizeof(info), &len ); + pRtlGetNativeSystemInformation( SystemCpuInformation, &info, sizeof(info), &len ); ok (info.ProcessorArchitecture == PROCESSOR_ARCHITECTURE_ARM64, "succeeded on non-ARM64\n" ); mem.ProcessEnableWriteExceptions = 1; NtSetInformationProcess( GetCurrentProcess(), ProcessManageWritesToExecutableMemory, @@ -3577,12 +3583,17 @@ START_TEST(virtual) pRtlFreeUserStack = (void *)GetProcAddress(mod, "RtlFreeUserStack"); pRtlFindExportedRoutineByName = (void *)GetProcAddress(mod, "RtlFindExportedRoutineByName"); pRtlGetEnabledExtendedFeatures = (void *)GetProcAddress(mod, "RtlGetEnabledExtendedFeatures"); - pRtlGetNativeSystemInformation = (void *)GetProcAddress(mod, "RtlGetNativeSystemInformation"); - pRtlIsEcCode = (void *)GetProcAddress(mod, "RtlIsEcCode"); pNtAllocateVirtualMemoryEx = (void *)GetProcAddress(mod, "NtAllocateVirtualMemoryEx"); pNtMapViewOfSectionEx = (void *)GetProcAddress(mod, "NtMapViewOfSectionEx"); pNtSetInformationVirtualMemory = (void *)GetProcAddress(mod, "NtSetInformationVirtualMemory"); +#ifndef __aarch64__ + pRtlGetNativeSystemInformation = (void *)GetProcAddress(mod, "RtlGetNativeSystemInformation"); +#endif +#ifdef __x86_64__ + pRtlIsEcCode = (void *)GetProcAddress(mod, "RtlIsEcCode"); +#endif + NtQuerySystemInformation(SystemBasicInformation, &sbi, sizeof(sbi), NULL); trace("system page size %#lx\n", sbi.PageSize); page_size = sbi.PageSize; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10861