Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
5a1d431b
Commit
5a1d431b
authored
Mar 15, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Implement NtWow64IsProcessorFeaturePresent().
parent
61149441
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
52 additions
and
0 deletions
+52
-0
ntdll.spec
dlls/ntdll/ntdll.spec
+2
-0
rtl.c
dlls/ntdll/rtl.c
+4
-0
wow64.c
dlls/ntdll/tests/wow64.c
+18
-0
loader.c
dlls/ntdll/unix/loader.c
+1
-0
virtual.c
dlls/ntdll/unix/virtual.c
+10
-0
syscall.c
dlls/wow64/syscall.c
+11
-0
syscall.h
dlls/wow64/syscall.h
+1
-0
winnt.h
include/winnt.h
+4
-0
winternl.h
include/winternl.h
+1
-0
No files found.
dlls/ntdll/ntdll.spec
View file @
5a1d431b
...
...
@@ -446,6 +446,7 @@
# @ stub NtWaitLowEventPair
@ stdcall -syscall -arch=win32 NtWow64AllocateVirtualMemory64(long ptr int64 ptr long long)
@ 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 NtWow64WriteVirtualMemory64(long int64 ptr int64 ptr)
@ stdcall -syscall NtWriteFile(long long ptr ptr ptr ptr long ptr ptr)
...
...
@@ -1478,6 +1479,7 @@
# @ stub ZwWaitLowEventPair
@ 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 ZwWow64IsProcessorFeaturePresent(long) NtWow64IsProcessorFeaturePresent
@ stdcall -syscall -arch=win32 ZwWow64ReadVirtualMemory64(long int64 ptr int64 ptr) NtWow64ReadVirtualMemory64
@ 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
...
...
dlls/ntdll/rtl.c
View file @
5a1d431b
...
...
@@ -2128,7 +2128,11 @@ void WINAPI RtlGetCurrentProcessorNumberEx(PROCESSOR_NUMBER *processor)
*/
BOOLEAN
WINAPI
RtlIsProcessorFeaturePresent
(
UINT
feature
)
{
#ifdef _WIN64
return
feature
<
PROCESSOR_FEATURE_MAX
&&
user_shared_data
->
ProcessorFeatures
[
feature
];
#else
return
NtWow64IsProcessorFeaturePresent
(
feature
);
#endif
}
/***********************************************************************
...
...
dlls/ntdll/tests/wow64.c
View file @
5a1d431b
...
...
@@ -35,6 +35,7 @@ static NTSTATUS (WINAPI *pRtlWow64GetThreadSelectorEntry)(HANDLE,THREAD_DESCRIPT
#else
static
NTSTATUS
(
WINAPI
*
pNtWow64AllocateVirtualMemory64
)(
HANDLE
,
ULONG64
*
,
ULONG64
,
ULONG64
*
,
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
*
pNtWow64WriteVirtualMemory64
)(
HANDLE
,
ULONG64
,
const
void
*
,
ULONG64
,
ULONG64
*
);
#endif
...
...
@@ -80,6 +81,7 @@ static void init(void)
#else
GET_PROC
(
NtWow64AllocateVirtualMemory64
);
GET_PROC
(
NtWow64GetNativeSystemInformation
);
GET_PROC
(
NtWow64IsProcessorFeaturePresent
);
GET_PROC
(
NtWow64ReadVirtualMemory64
);
GET_PROC
(
NtWow64WriteVirtualMemory64
);
#endif
...
...
@@ -991,6 +993,22 @@ static void test_nt_wow64(void)
}
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
);
}
...
...
dlls/ntdll/unix/loader.c
View file @
5a1d431b
...
...
@@ -350,6 +350,7 @@ static void * const syscalls[] =
#ifndef _WIN64
NtWow64AllocateVirtualMemory64
,
NtWow64GetNativeSystemInformation
,
NtWow64IsProcessorFeaturePresent
,
NtWow64ReadVirtualMemory64
,
NtWow64WriteVirtualMemory64
,
#endif
...
...
dlls/ntdll/unix/virtual.c
View file @
5a1d431b
...
...
@@ -69,6 +69,7 @@
#include "windef.h"
#include "winnt.h"
#include "winternl.h"
#include "ddk/wdm.h"
#include "wine/list.h"
#include "wine/rbtree.h"
#include "unix_private.h"
...
...
@@ -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 */
dlls/wow64/syscall.c
View file @
5a1d431b
...
...
@@ -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
*/
static
DWORD
get_syscall_num
(
const
BYTE
*
syscall
)
...
...
dlls/wow64/syscall.h
View file @
5a1d431b
...
...
@@ -251,6 +251,7 @@
SYSCALL_ENTRY( NtWaitForSingleObject ) \
SYSCALL_ENTRY( NtWow64AllocateVirtualMemory64 ) \
SYSCALL_ENTRY( NtWow64GetNativeSystemInformation ) \
SYSCALL_ENTRY( NtWow64IsProcessorFeaturePresent ) \
SYSCALL_ENTRY( NtWow64ReadVirtualMemory64 ) \
SYSCALL_ENTRY( NtWow64WriteVirtualMemory64 ) \
SYSCALL_ENTRY( NtWriteFile ) \
...
...
include/winnt.h
View file @
5a1d431b
...
...
@@ -1072,6 +1072,10 @@ typedef enum _HEAP_INFORMATION_CLASS {
#define PF_AVX_INSTRUCTIONS_AVAILABLE 39
#define PF_AVX2_INSTRUCTIONS_AVAILABLE 40
#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 */
...
...
include/winternl.h
View file @
5a1d431b
...
...
@@ -4675,6 +4675,7 @@ NTSYSAPI NTSTATUS WINAPI RtlWow64SetThreadContext(HANDLE,const WOW64_CONTEXT*);
#else
NTSYSAPI
NTSTATUS
WINAPI
NtWow64AllocateVirtualMemory64
(
HANDLE
,
ULONG64
*
,
ULONG64
,
ULONG64
*
,
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
NtWow64WriteVirtualMemory64
(
HANDLE
,
ULONG64
,
const
void
*
,
ULONG64
,
ULONG64
*
);
NTSYSAPI
LONGLONG
WINAPI
RtlConvertLongToLargeInteger
(
LONG
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment