Commit 5a1d431b authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Implement NtWow64IsProcessorFeaturePresent().

parent 61149441
...@@ -446,6 +446,7 @@ ...@@ -446,6 +446,7 @@
# @ stub NtWaitLowEventPair # @ stub NtWaitLowEventPair
@ stdcall -syscall -arch=win32 NtWow64AllocateVirtualMemory64(long ptr int64 ptr long long) @ stdcall -syscall -arch=win32 NtWow64AllocateVirtualMemory64(long ptr int64 ptr long long)
@ stdcall -syscall -arch=win32 NtWow64GetNativeSystemInformation(long ptr long ptr) @ stdcall -syscall -arch=win32 NtWow64GetNativeSystemInformation(long ptr long ptr)
@ stdcall -syscall -arch=win32 NtWow64IsProcessorFeaturePresent(long)
@ stdcall -syscall -arch=win32 NtWow64ReadVirtualMemory64(long int64 ptr int64 ptr) @ stdcall -syscall -arch=win32 NtWow64ReadVirtualMemory64(long int64 ptr int64 ptr)
@ stdcall -syscall -arch=win32 NtWow64WriteVirtualMemory64(long int64 ptr int64 ptr) @ stdcall -syscall -arch=win32 NtWow64WriteVirtualMemory64(long int64 ptr int64 ptr)
@ stdcall -syscall NtWriteFile(long long ptr ptr ptr ptr long ptr ptr) @ stdcall -syscall NtWriteFile(long long ptr ptr ptr ptr long ptr ptr)
...@@ -1478,6 +1479,7 @@ ...@@ -1478,6 +1479,7 @@
# @ stub ZwWaitLowEventPair # @ stub ZwWaitLowEventPair
@ stdcall -syscall -arch=win32 ZwWow64AllocateVirtualMemory64(long ptr int64 ptr long long) NtWow64AllocateVirtualMemory64 @ stdcall -syscall -arch=win32 ZwWow64AllocateVirtualMemory64(long ptr int64 ptr long long) NtWow64AllocateVirtualMemory64
@ stdcall -syscall -arch=win32 ZwWow64GetNativeSystemInformation(long ptr long ptr) NtWow64GetNativeSystemInformation @ stdcall -syscall -arch=win32 ZwWow64GetNativeSystemInformation(long ptr long ptr) NtWow64GetNativeSystemInformation
@ stdcall -syscall -arch=win32 ZwWow64IsProcessorFeaturePresent(long) NtWow64IsProcessorFeaturePresent
@ stdcall -syscall -arch=win32 ZwWow64ReadVirtualMemory64(long int64 ptr int64 ptr) NtWow64ReadVirtualMemory64 @ stdcall -syscall -arch=win32 ZwWow64ReadVirtualMemory64(long int64 ptr int64 ptr) NtWow64ReadVirtualMemory64
@ stdcall -syscall -arch=win32 ZwWow64WriteVirtualMemory64(long int64 ptr int64 ptr) NtWow64WriteVirtualMemory64 @ stdcall -syscall -arch=win32 ZwWow64WriteVirtualMemory64(long int64 ptr int64 ptr) NtWow64WriteVirtualMemory64
@ stdcall -private -syscall ZwWriteFile(long long ptr ptr ptr ptr long ptr ptr) NtWriteFile @ stdcall -private -syscall ZwWriteFile(long long ptr ptr ptr ptr long ptr ptr) NtWriteFile
......
...@@ -2128,7 +2128,11 @@ void WINAPI RtlGetCurrentProcessorNumberEx(PROCESSOR_NUMBER *processor) ...@@ -2128,7 +2128,11 @@ void WINAPI RtlGetCurrentProcessorNumberEx(PROCESSOR_NUMBER *processor)
*/ */
BOOLEAN WINAPI RtlIsProcessorFeaturePresent( UINT feature ) BOOLEAN WINAPI RtlIsProcessorFeaturePresent( UINT feature )
{ {
#ifdef _WIN64
return feature < PROCESSOR_FEATURE_MAX && user_shared_data->ProcessorFeatures[feature]; return feature < PROCESSOR_FEATURE_MAX && user_shared_data->ProcessorFeatures[feature];
#else
return NtWow64IsProcessorFeaturePresent( feature );
#endif
} }
/*********************************************************************** /***********************************************************************
......
...@@ -35,6 +35,7 @@ static NTSTATUS (WINAPI *pRtlWow64GetThreadSelectorEntry)(HANDLE,THREAD_DESCRIPT ...@@ -35,6 +35,7 @@ static NTSTATUS (WINAPI *pRtlWow64GetThreadSelectorEntry)(HANDLE,THREAD_DESCRIPT
#else #else
static NTSTATUS (WINAPI *pNtWow64AllocateVirtualMemory64)(HANDLE,ULONG64*,ULONG64,ULONG64*,ULONG,ULONG); static NTSTATUS (WINAPI *pNtWow64AllocateVirtualMemory64)(HANDLE,ULONG64*,ULONG64,ULONG64*,ULONG,ULONG);
static NTSTATUS (WINAPI *pNtWow64GetNativeSystemInformation)(SYSTEM_INFORMATION_CLASS,void*,ULONG,ULONG*); static NTSTATUS (WINAPI *pNtWow64GetNativeSystemInformation)(SYSTEM_INFORMATION_CLASS,void*,ULONG,ULONG*);
static NTSTATUS (WINAPI *pNtWow64IsProcessorFeaturePresent)(ULONG);
static NTSTATUS (WINAPI *pNtWow64ReadVirtualMemory64)(HANDLE,ULONG64,void*,ULONG64,ULONG64*); static NTSTATUS (WINAPI *pNtWow64ReadVirtualMemory64)(HANDLE,ULONG64,void*,ULONG64,ULONG64*);
static NTSTATUS (WINAPI *pNtWow64WriteVirtualMemory64)(HANDLE,ULONG64,const void *,ULONG64,ULONG64*); static NTSTATUS (WINAPI *pNtWow64WriteVirtualMemory64)(HANDLE,ULONG64,const void *,ULONG64,ULONG64*);
#endif #endif
...@@ -80,6 +81,7 @@ static void init(void) ...@@ -80,6 +81,7 @@ static void init(void)
#else #else
GET_PROC( NtWow64AllocateVirtualMemory64 ); GET_PROC( NtWow64AllocateVirtualMemory64 );
GET_PROC( NtWow64GetNativeSystemInformation ); GET_PROC( NtWow64GetNativeSystemInformation );
GET_PROC( NtWow64IsProcessorFeaturePresent );
GET_PROC( NtWow64ReadVirtualMemory64 ); GET_PROC( NtWow64ReadVirtualMemory64 );
GET_PROC( NtWow64WriteVirtualMemory64 ); GET_PROC( NtWow64WriteVirtualMemory64 );
#endif #endif
...@@ -991,6 +993,22 @@ static void test_nt_wow64(void) ...@@ -991,6 +993,22 @@ static void test_nt_wow64(void)
} }
else win_skip( "NtWow64GetNativeSystemInformation not supported\n" ); else win_skip( "NtWow64GetNativeSystemInformation not supported\n" );
if (pNtWow64IsProcessorFeaturePresent)
{
ULONG i;
for (i = 0; i < 64; i++)
ok( pNtWow64IsProcessorFeaturePresent( i ) == IsProcessorFeaturePresent( i ),
"mismatch %lu wow64 returned %lx\n", i, pNtWow64IsProcessorFeaturePresent( i ));
if (native_machine == IMAGE_FILE_MACHINE_ARM64)
{
ok( !pNtWow64IsProcessorFeaturePresent( PF_ARM_V8_INSTRUCTIONS_AVAILABLE ), "ARM_V8 present\n" );
ok( pNtWow64IsProcessorFeaturePresent( PF_MMX_INSTRUCTIONS_AVAILABLE ), "MMX not present\n" );
}
}
else win_skip( "NtWow64IsProcessorFeaturePresent not supported\n" );
NtClose( process ); NtClose( process );
} }
......
...@@ -350,6 +350,7 @@ static void * const syscalls[] = ...@@ -350,6 +350,7 @@ static void * const syscalls[] =
#ifndef _WIN64 #ifndef _WIN64
NtWow64AllocateVirtualMemory64, NtWow64AllocateVirtualMemory64,
NtWow64GetNativeSystemInformation, NtWow64GetNativeSystemInformation,
NtWow64IsProcessorFeaturePresent,
NtWow64ReadVirtualMemory64, NtWow64ReadVirtualMemory64,
NtWow64WriteVirtualMemory64, NtWow64WriteVirtualMemory64,
#endif #endif
......
...@@ -69,6 +69,7 @@ ...@@ -69,6 +69,7 @@
#include "windef.h" #include "windef.h"
#include "winnt.h" #include "winnt.h"
#include "winternl.h" #include "winternl.h"
#include "ddk/wdm.h"
#include "wine/list.h" #include "wine/list.h"
#include "wine/rbtree.h" #include "wine/rbtree.h"
#include "unix_private.h" #include "unix_private.h"
...@@ -5334,4 +5335,13 @@ NTSTATUS WINAPI NtWow64GetNativeSystemInformation( SYSTEM_INFORMATION_CLASS clas ...@@ -5334,4 +5335,13 @@ NTSTATUS WINAPI NtWow64GetNativeSystemInformation( SYSTEM_INFORMATION_CLASS clas
} }
} }
/***********************************************************************
* NtWow64IsProcessorFeaturePresent (NTDLL.@)
* ZwWow64IsProcessorFeaturePresent (NTDLL.@)
*/
NTSTATUS WINAPI NtWow64IsProcessorFeaturePresent( UINT feature )
{
return feature < PROCESSOR_FEATURE_MAX && user_shared_data->ProcessorFeatures[feature];
}
#endif /* _WIN64 */ #endif /* _WIN64 */
...@@ -623,6 +623,17 @@ NTSTATUS WINAPI wow64_NtSetDefaultUILanguage( UINT *args ) ...@@ -623,6 +623,17 @@ NTSTATUS WINAPI wow64_NtSetDefaultUILanguage( UINT *args )
/********************************************************************** /**********************************************************************
* wow64_NtWow64IsProcessorFeaturePresent
*/
NTSTATUS WINAPI wow64_NtWow64IsProcessorFeaturePresent( UINT *args )
{
UINT feature = get_ulong( &args );
return RtlIsProcessorFeaturePresent( feature );
}
/**********************************************************************
* get_syscall_num * get_syscall_num
*/ */
static DWORD get_syscall_num( const BYTE *syscall ) static DWORD get_syscall_num( const BYTE *syscall )
......
...@@ -251,6 +251,7 @@ ...@@ -251,6 +251,7 @@
SYSCALL_ENTRY( NtWaitForSingleObject ) \ SYSCALL_ENTRY( NtWaitForSingleObject ) \
SYSCALL_ENTRY( NtWow64AllocateVirtualMemory64 ) \ SYSCALL_ENTRY( NtWow64AllocateVirtualMemory64 ) \
SYSCALL_ENTRY( NtWow64GetNativeSystemInformation ) \ SYSCALL_ENTRY( NtWow64GetNativeSystemInformation ) \
SYSCALL_ENTRY( NtWow64IsProcessorFeaturePresent ) \
SYSCALL_ENTRY( NtWow64ReadVirtualMemory64 ) \ SYSCALL_ENTRY( NtWow64ReadVirtualMemory64 ) \
SYSCALL_ENTRY( NtWow64WriteVirtualMemory64 ) \ SYSCALL_ENTRY( NtWow64WriteVirtualMemory64 ) \
SYSCALL_ENTRY( NtWriteFile ) \ SYSCALL_ENTRY( NtWriteFile ) \
......
...@@ -1072,6 +1072,10 @@ typedef enum _HEAP_INFORMATION_CLASS { ...@@ -1072,6 +1072,10 @@ typedef enum _HEAP_INFORMATION_CLASS {
#define PF_AVX_INSTRUCTIONS_AVAILABLE 39 #define PF_AVX_INSTRUCTIONS_AVAILABLE 39
#define PF_AVX2_INSTRUCTIONS_AVAILABLE 40 #define PF_AVX2_INSTRUCTIONS_AVAILABLE 40
#define PF_AVX512F_INSTRUCTIONS_AVAILABLE 41 #define PF_AVX512F_INSTRUCTIONS_AVAILABLE 41
#define PF_ERMS_AVAILABLE 42
#define PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE 43
#define PF_ARM_V83_JSCVT_INSTRUCTIONS_AVAILABLE 44
#define PF_ARM_V83_LRCPC_INSTRUCTIONS_AVAILABLE 45
/* Execution state flags */ /* Execution state flags */
......
...@@ -4675,6 +4675,7 @@ NTSYSAPI NTSTATUS WINAPI RtlWow64SetThreadContext(HANDLE,const WOW64_CONTEXT*); ...@@ -4675,6 +4675,7 @@ NTSYSAPI NTSTATUS WINAPI RtlWow64SetThreadContext(HANDLE,const WOW64_CONTEXT*);
#else #else
NTSYSAPI NTSTATUS WINAPI NtWow64AllocateVirtualMemory64(HANDLE,ULONG64*,ULONG64,ULONG64*,ULONG,ULONG); NTSYSAPI NTSTATUS WINAPI NtWow64AllocateVirtualMemory64(HANDLE,ULONG64*,ULONG64,ULONG64*,ULONG,ULONG);
NTSYSAPI NTSTATUS WINAPI NtWow64GetNativeSystemInformation(SYSTEM_INFORMATION_CLASS,void*,ULONG,ULONG*); NTSYSAPI NTSTATUS WINAPI NtWow64GetNativeSystemInformation(SYSTEM_INFORMATION_CLASS,void*,ULONG,ULONG*);
NTSYSAPI NTSTATUS WINAPI NtWow64IsProcessorFeaturePresent(UINT);
NTSYSAPI NTSTATUS WINAPI NtWow64ReadVirtualMemory64(HANDLE,ULONG64,void*,ULONG64,ULONG64*); NTSYSAPI NTSTATUS WINAPI NtWow64ReadVirtualMemory64(HANDLE,ULONG64,void*,ULONG64,ULONG64*);
NTSYSAPI NTSTATUS WINAPI NtWow64WriteVirtualMemory64(HANDLE,ULONG64,const void*,ULONG64,ULONG64*); NTSYSAPI NTSTATUS WINAPI NtWow64WriteVirtualMemory64(HANDLE,ULONG64,const void*,ULONG64,ULONG64*);
NTSYSAPI LONGLONG WINAPI RtlConvertLongToLargeInteger(LONG); NTSYSAPI LONGLONG WINAPI RtlConvertLongToLargeInteger(LONG);
......
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