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
4f8ede8e
Commit
4f8ede8e
authored
Apr 29, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Implement RtlWow64IsWowGuestMachineSupported().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6c2f19c0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
0 deletions
+50
-0
ntdll.spec
dlls/ntdll/ntdll.spec
+1
-0
process.c
dlls/ntdll/process.c
+22
-0
info.c
dlls/ntdll/tests/info.c
+26
-0
winternl.h
include/winternl.h
+1
-0
No files found.
dlls/ntdll/ntdll.spec
View file @
4f8ede8e
...
...
@@ -1071,6 +1071,7 @@
@ stdcall RtlWow64GetCurrentMachine()
@ stdcall RtlWow64GetProcessMachines(long ptr ptr)
@ stdcall -arch=x86_64 RtlWow64GetThreadContext(long ptr)
@ stdcall RtlWow64IsWowGuestMachineSupported(long ptr)
@ stdcall -arch=x86_64 RtlWow64SetThreadContext(long ptr)
@ stub RtlWriteMemoryStream
@ stdcall RtlWriteRegistryValue(long ptr ptr long ptr long)
...
...
dlls/ntdll/process.c
View file @
4f8ede8e
...
...
@@ -87,6 +87,28 @@ NTSTATUS WINAPI RtlWow64GetProcessMachines( HANDLE process, USHORT *current_ret,
/**********************************************************************
* RtlWow64IsWowGuestMachineSupported (NTDLL.@)
*/
NTSTATUS
WINAPI
RtlWow64IsWowGuestMachineSupported
(
USHORT
machine
,
BOOLEAN
*
supported
)
{
ULONG
i
,
machines
[
8
];
HANDLE
process
=
0
;
NTSTATUS
status
;
status
=
NtQuerySystemInformationEx
(
SystemSupportedProcessorArchitectures
,
&
process
,
sizeof
(
process
),
machines
,
sizeof
(
machines
),
NULL
);
if
(
status
)
return
status
;
*
supported
=
FALSE
;
for
(
i
=
0
;
machines
[
i
];
i
++
)
{
if
(
HIWORD
(
machines
[
i
])
&
4
/* native machine */
)
continue
;
if
(
machine
==
LOWORD
(
machines
[
i
]))
*
supported
=
TRUE
;
}
return
status
;
}
/**********************************************************************
* RtlCreateUserProcess (NTDLL.@)
*/
NTSTATUS
WINAPI
RtlCreateUserProcess
(
UNICODE_STRING
*
path
,
ULONG
attributes
,
...
...
dlls/ntdll/tests/info.c
View file @
4f8ede8e
...
...
@@ -27,6 +27,7 @@ static NTSTATUS (WINAPI * pNtSetSystemInformation)(SYSTEM_INFORMATION_CLASS, PVO
static
NTSTATUS
(
WINAPI
*
pRtlGetNativeSystemInformation
)(
SYSTEM_INFORMATION_CLASS
,
PVOID
,
ULONG
,
PULONG
);
static
USHORT
(
WINAPI
*
pRtlWow64GetCurrentMachine
)(
void
);
static
NTSTATUS
(
WINAPI
*
pRtlWow64GetProcessMachines
)(
HANDLE
,
WORD
*
,
WORD
*
);
static
NTSTATUS
(
WINAPI
*
pRtlWow64IsWowGuestMachineSupported
)(
USHORT
,
BOOLEAN
*
);
static
NTSTATUS
(
WINAPI
*
pNtQuerySystemInformationEx
)(
SYSTEM_INFORMATION_CLASS
,
void
*
,
ULONG
,
void
*
,
ULONG
,
ULONG
*
);
static
NTSTATUS
(
WINAPI
*
pNtPowerInformation
)(
POWER_INFORMATION_LEVEL
,
PVOID
,
ULONG
,
PVOID
,
ULONG
);
static
NTSTATUS
(
WINAPI
*
pNtQueryInformationProcess
)(
HANDLE
,
PROCESSINFOCLASS
,
PVOID
,
ULONG
,
PULONG
);
...
...
@@ -86,6 +87,7 @@ static BOOL InitFunctionPtrs(void)
NTDLL_GET_PROC
(
RtlGetNativeSystemInformation
);
NTDLL_GET_PROC
(
RtlWow64GetCurrentMachine
);
NTDLL_GET_PROC
(
RtlWow64GetProcessMachines
);
NTDLL_GET_PROC
(
RtlWow64IsWowGuestMachineSupported
);
NTDLL_GET_PROC
(
NtPowerInformation
);
NTDLL_GET_PROC
(
NtQueryInformationProcess
);
NTDLL_GET_PROC
(
NtQueryInformationThread
);
...
...
@@ -3017,6 +3019,30 @@ static void test_query_architectures(void)
USHORT
machine
=
pRtlWow64GetCurrentMachine
();
ok
(
machine
==
current_machine
,
"wrong machine %x / %x
\n
"
,
machine
,
current_machine
);
}
if
(
pRtlWow64IsWowGuestMachineSupported
)
{
BOOLEAN
ret
=
0xcc
;
status
=
pRtlWow64IsWowGuestMachineSupported
(
IMAGE_FILE_MACHINE_I386
,
&
ret
);
ok
(
!
status
,
"failed %x
\n
"
,
status
);
ok
(
ret
==
(
native_machine
==
IMAGE_FILE_MACHINE_AMD64
||
native_machine
==
IMAGE_FILE_MACHINE_ARM64
),
"wrong result %u
\n
"
,
ret
);
ret
=
0xcc
;
status
=
pRtlWow64IsWowGuestMachineSupported
(
IMAGE_FILE_MACHINE_ARMNT
,
&
ret
);
ok
(
!
status
,
"failed %x
\n
"
,
status
);
ok
(
ret
==
(
native_machine
==
IMAGE_FILE_MACHINE_ARM64
),
"wrong result %u
\n
"
,
ret
);
ret
=
0xcc
;
status
=
pRtlWow64IsWowGuestMachineSupported
(
IMAGE_FILE_MACHINE_AMD64
,
&
ret
);
ok
(
!
status
,
"failed %x
\n
"
,
status
);
ok
(
!
ret
,
"wrong result %u
\n
"
,
ret
);
ret
=
0xcc
;
status
=
pRtlWow64IsWowGuestMachineSupported
(
IMAGE_FILE_MACHINE_ARM64
,
&
ret
);
ok
(
!
status
,
"failed %x
\n
"
,
status
);
ok
(
!
ret
,
"wrong result %u
\n
"
,
ret
);
ret
=
0xcc
;
status
=
pRtlWow64IsWowGuestMachineSupported
(
0xdead
,
&
ret
);
ok
(
!
status
,
"failed %x
\n
"
,
status
);
ok
(
!
ret
,
"wrong result %u
\n
"
,
ret
);
}
}
static
void
test_thread_lookup
(
void
)
...
...
include/winternl.h
View file @
4f8ede8e
...
...
@@ -4258,6 +4258,7 @@ NTSYSAPI NTSTATUS WINAPI RtlWow64GetProcessMachines(HANDLE,USHORT*,USHORT*);
NTSYSAPI
NTSTATUS
WINAPI
RtlWow64GetThreadContext
(
HANDLE
,
WOW64_CONTEXT
*
);
NTSYSAPI
NTSTATUS
WINAPI
RtlWow64SetThreadContext
(
HANDLE
,
const
WOW64_CONTEXT
*
);
#endif
NTSYSAPI
NTSTATUS
WINAPI
RtlWow64IsWowGuestMachineSupported
(
USHORT
,
BOOLEAN
*
);
NTSYSAPI
NTSTATUS
WINAPI
RtlWriteRegistryValue
(
ULONG
,
PCWSTR
,
PCWSTR
,
ULONG
,
PVOID
,
ULONG
);
NTSYSAPI
NTSTATUS
WINAPI
RtlZombifyActivationContext
(
HANDLE
);
NTSYSAPI
NTSTATUS
WINAPI
RtlpNtCreateKey
(
PHANDLE
,
ACCESS_MASK
,
const
OBJECT_ATTRIBUTES
*
,
ULONG
,
const
UNICODE_STRING
*
,
ULONG
,
PULONG
);
...
...
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