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
b5215075
Commit
b5215075
authored
Aug 28, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Implement RtlOpenCrossProcessEmulatorWorkConnection().
parent
f6ccadda
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
1 deletion
+58
-1
ntdll.spec
dlls/ntdll/ntdll.spec
+1
-0
process.c
dlls/ntdll/process.c
+28
-0
wow64.c
dlls/ntdll/tests/wow64.c
+28
-1
winternl.h
include/winternl.h
+1
-0
No files found.
dlls/ntdll/ntdll.spec
View file @
b5215075
...
...
@@ -901,6 +901,7 @@
@ stdcall RtlOemStringToUnicodeSize(ptr)
@ stdcall RtlOemStringToUnicodeString(ptr ptr long)
@ stdcall RtlOemToUnicodeN(ptr long ptr ptr long)
@ stdcall -arch=win64 RtlOpenCrossProcessEmulatorWorkConnection(long ptr ptr)
@ stdcall RtlOpenCurrentUser(long ptr)
@ stdcall RtlPcToFileHeader(ptr ptr)
@ stdcall RtlPinAtomInAtomTable(ptr long)
...
...
dlls/ntdll/process.c
View file @
b5215075
...
...
@@ -304,6 +304,34 @@ done:
/**********************************************************************
* RtlOpenCrossProcessEmulatorWorkConnection (NTDLL.@)
*/
void
WINAPI
RtlOpenCrossProcessEmulatorWorkConnection
(
HANDLE
process
,
HANDLE
*
section
,
void
**
addr
)
{
WOW64INFO
wow64info
;
BOOLEAN
is_wow64
;
SIZE_T
size
=
0
;
*
addr
=
NULL
;
*
section
=
0
;
if
(
RtlWow64GetSharedInfoProcess
(
process
,
&
is_wow64
,
&
wow64info
))
return
;
if
(
!
is_wow64
)
return
;
if
(
!
wow64info
.
SectionHandle
)
return
;
if
(
NtDuplicateObject
(
process
,
(
HANDLE
)(
ULONG_PTR
)
wow64info
.
SectionHandle
,
GetCurrentProcess
(),
section
,
0
,
0
,
DUPLICATE_SAME_ACCESS
))
return
;
if
(
!
NtMapViewOfSection
(
*
section
,
GetCurrentProcess
(),
addr
,
0
,
0
,
NULL
,
&
size
,
ViewShare
,
0
,
PAGE_READWRITE
))
return
;
NtClose
(
*
section
);
*
section
=
0
;
}
/**********************************************************************
* RtlWow64PopAllCrossProcessWorkFromWorkList (NTDLL.@)
*/
CROSS_PROCESS_WORK_ENTRY
*
WINAPI
RtlWow64PopAllCrossProcessWorkFromWorkList
(
CROSS_PROCESS_WORK_HDR
*
list
,
BOOLEAN
*
flush
)
...
...
dlls/ntdll/tests/wow64.c
View file @
b5215075
...
...
@@ -27,6 +27,7 @@
static
NTSTATUS
(
WINAPI
*
pNtQuerySystemInformation
)(
SYSTEM_INFORMATION_CLASS
,
void
*
,
ULONG
,
ULONG
*
);
static
NTSTATUS
(
WINAPI
*
pNtQuerySystemInformationEx
)(
SYSTEM_INFORMATION_CLASS
,
void
*
,
ULONG
,
void
*
,
ULONG
,
ULONG
*
);
static
NTSTATUS
(
WINAPI
*
pRtlGetNativeSystemInformation
)(
SYSTEM_INFORMATION_CLASS
,
void
*
,
ULONG
,
ULONG
*
);
static
void
(
WINAPI
*
pRtlOpenCrossProcessEmulatorWorkConnection
)(
HANDLE
,
HANDLE
*
,
void
**
);
static
USHORT
(
WINAPI
*
pRtlWow64GetCurrentMachine
)(
void
);
static
NTSTATUS
(
WINAPI
*
pRtlWow64GetProcessMachines
)(
HANDLE
,
WORD
*
,
WORD
*
);
static
NTSTATUS
(
WINAPI
*
pRtlWow64GetSharedInfoProcess
)(
HANDLE
,
BOOLEAN
*
,
WOW64INFO
*
);
...
...
@@ -92,6 +93,7 @@ static void init(void)
GET_PROC
(
NtQuerySystemInformation
);
GET_PROC
(
NtQuerySystemInformationEx
);
GET_PROC
(
RtlGetNativeSystemInformation
);
GET_PROC
(
RtlOpenCrossProcessEmulatorWorkConnection
);
GET_PROC
(
RtlWow64GetCurrentMachine
);
GET_PROC
(
RtlWow64GetProcessMachines
);
GET_PROC
(
RtlWow64GetSharedInfoProcess
);
...
...
@@ -443,8 +445,33 @@ static void test_peb_teb(void)
ok
(
ret
,
"ReadProcessMemory failed %lu
\n
"
,
GetLastError
()
);
ok
(
!
memcmp
(
data
,
addr
,
size
),
"wrong data
\n
"
);
free
(
data
);
UnmapViewOfFile
(
addr
);
CloseHandle
(
handle
);
if
(
pRtlOpenCrossProcessEmulatorWorkConnection
)
{
pRtlOpenCrossProcessEmulatorWorkConnection
(
pi
.
hProcess
,
&
handle
,
&
data
);
ok
(
handle
!=
0
,
"got 0 handle
\n
"
);
ok
(
data
!=
NULL
,
"got NULL data
\n
"
);
ok
(
!
memcmp
(
data
,
addr
,
size
),
"wrong data
\n
"
);
UnmapViewOfFile
(
data
);
data
=
NULL
;
size
=
0
;
status
=
NtMapViewOfSection
(
handle
,
GetCurrentProcess
(),
&
data
,
0
,
0
,
NULL
,
&
size
,
ViewShare
,
0
,
PAGE_READWRITE
);
ok
(
!
status
,
"NtMapViewOfSection failed %lx
\n
"
,
status
);
ok
(
!
memcmp
(
data
,
addr
,
size
),
"wrong data
\n
"
);
ok
(
CloseHandle
(
handle
),
"invalid handle
\n
"
);
UnmapViewOfFile
(
data
);
handle
=
(
HANDLE
)
0xdead
;
data
=
(
void
*
)
0xdeadbeef
;
pRtlOpenCrossProcessEmulatorWorkConnection
(
GetCurrentProcess
(),
&
handle
,
&
data
);
ok
(
!
handle
,
"got handle %p
\n
"
,
handle
);
ok
(
!
data
,
"got data %p
\n
"
,
data
);
}
else
skip
(
"RtlOpenCrossProcessEmulatorWorkConnection not supported
\n
"
);
UnmapViewOfFile
(
addr
);
}
else
trace
(
"no WOW64INFO section handle
\n
"
);
}
...
...
include/winternl.h
View file @
b5215075
...
...
@@ -5017,6 +5017,7 @@ NTSYSAPI NTSTATUS WINAPI vDbgPrintExWithPrefix(LPCSTR,ULONG,ULONG,LPCSTR,__ms_v
/* 32-bit or 64-bit only functions */
#ifdef _WIN64
NTSYSAPI
void
WINAPI
RtlOpenCrossProcessEmulatorWorkConnection
(
HANDLE
,
HANDLE
*
,
void
**
);
NTSYSAPI
NTSTATUS
WINAPI
RtlWow64GetCpuAreaInfo
(
WOW64_CPURESERVED
*
,
ULONG
,
WOW64_CPU_AREA_INFO
*
);
NTSYSAPI
NTSTATUS
WINAPI
RtlWow64GetCurrentCpuArea
(
USHORT
*
,
void
**
,
void
**
);
NTSYSAPI
NTSTATUS
WINAPI
RtlWow64GetThreadContext
(
HANDLE
,
WOW64_CONTEXT
*
);
...
...
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