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
d91d05b8
Commit
d91d05b8
authored
Aug 10, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add a Wine-specific NtQueryVirtualMemory() query to retrieve the Unix call table.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c29f6504
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
2 deletions
+43
-2
virtual.c
dlls/ntdll/unix/virtual.c
+40
-1
winternl.h
include/winternl.h
+3
-1
No files found.
dlls/ntdll/unix/virtual.c
View file @
d91d05b8
...
...
@@ -658,6 +658,29 @@ void *get_builtin_so_handle( void *module )
/***********************************************************************
* get_builtin_unix_funcs
*/
NTSTATUS
get_builtin_unix_funcs
(
void
*
module
,
BOOL
wow
,
void
**
funcs
)
{
const
char
*
ptr_name
=
wow
?
"__wine_unix_call_wow64_funcs"
:
"__wine_unix_call_funcs"
;
sigset_t
sigset
;
NTSTATUS
status
=
STATUS_DLL_NOT_FOUND
;
struct
builtin_module
*
builtin
;
server_enter_uninterrupted_section
(
&
virtual_mutex
,
&
sigset
);
LIST_FOR_EACH_ENTRY
(
builtin
,
&
builtin_modules
,
struct
builtin_module
,
entry
)
{
if
(
builtin
->
module
!=
module
)
continue
;
*
funcs
=
dlsym
(
builtin
->
unix_handle
,
ptr_name
);
status
=
STATUS_SUCCESS
;
break
;
}
server_leave_uninterrupted_section
(
&
virtual_mutex
,
&
sigset
);
return
status
;
}
/***********************************************************************
* get_builtin_unix_info
*/
NTSTATUS
get_builtin_unix_info
(
void
*
module
,
const
char
**
name
,
void
**
handle
,
void
**
entry
)
...
...
@@ -4289,6 +4312,8 @@ NTSTATUS WINAPI NtQueryVirtualMemory( HANDLE process, LPCVOID addr,
MEMORY_INFORMATION_CLASS
info_class
,
PVOID
buffer
,
SIZE_T
len
,
SIZE_T
*
res_len
)
{
NTSTATUS
status
;
TRACE
(
"(%p, %p, info_class=%d, %p, %ld, %p)
\n
"
,
process
,
addr
,
info_class
,
buffer
,
len
,
res_len
);
...
...
@@ -4311,13 +4336,27 @@ NTSTATUS WINAPI NtQueryVirtualMemory( HANDLE process, LPCVOID addr,
if
(
handle
)
{
NTSTATUS
status
=
get_builtin_init_funcs
(
handle
,
buffer
,
len
,
res_len
);
status
=
get_builtin_init_funcs
(
handle
,
buffer
,
len
,
res_len
);
release_builtin_module
(
module
);
return
status
;
}
}
return
STATUS_INVALID_HANDLE
;
case
MemoryWineUnixFuncs
:
case
MemoryWineUnixWow64Funcs
:
if
(
len
!=
sizeof
(
UINT64
))
return
STATUS_INFO_LENGTH_MISMATCH
;
if
(
process
==
GetCurrentProcess
())
{
void
*
module
=
(
void
*
)
addr
;
void
*
funcs
=
NULL
;
status
=
get_builtin_unix_funcs
(
module
,
info_class
==
MemoryWineUnixWow64Funcs
,
&
funcs
);
if
(
!
status
)
*
(
UINT64
*
)
buffer
=
(
UINT_PTR
)
funcs
;
return
status
;
}
return
STATUS_INVALID_HANDLE
;
default:
FIXME
(
"(%p,%p,info_class=%d,%p,%ld,%p) Unknown information class
\n
"
,
process
,
addr
,
info_class
,
buffer
,
len
,
res_len
);
...
...
include/winternl.h
View file @
d91d05b8
...
...
@@ -1919,7 +1919,9 @@ typedef enum _MEMORY_INFORMATION_CLASS {
MemoryBasicInformationCapped
,
MemoryPhysicalContiguityInformation
,
#ifdef __WINESRC__
MemoryWineImageInitFuncs
=
1000
MemoryWineImageInitFuncs
=
1000
,
MemoryWineUnixFuncs
,
MemoryWineUnixWow64Funcs
,
#endif
}
MEMORY_INFORMATION_CLASS
;
...
...
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