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
e3e477e6
Commit
e3e477e6
authored
Jul 16, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use syscall thunks for virtual memory functions.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3b4c2ffb
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1 addition
and
236 deletions
+1
-236
ntdll.spec
dlls/ntdll/ntdll.spec
+0
-0
loader.c
dlls/ntdll/unix/loader.c
+0
-17
unixlib.h
dlls/ntdll/unixlib.h
+1
-35
virtual.c
dlls/ntdll/virtual.c
+0
-184
No files found.
dlls/ntdll/ntdll.spec
View file @
e3e477e6
This diff is collapsed.
Click to expand it.
dlls/ntdll/unix/loader.c
View file @
e3e477e6
...
...
@@ -1358,35 +1358,18 @@ static double CDECL ntdll_tan( double d ) { return tan( d ); }
*/
static
struct
unix_funcs
unix_funcs
=
{
NtAllocateVirtualMemory
,
NtAreMappedFilesTheSame
,
NtClose
,
NtCreateSection
,
NtCurrentTeb
,
NtDuplicateObject
,
NtFlushVirtualMemory
,
NtFreeVirtualMemory
,
NtGetContextThread
,
NtGetWriteWatch
,
NtLockVirtualMemory
,
NtMapViewOfSection
,
NtOpenSection
,
NtPowerInformation
,
NtProtectVirtualMemory
,
NtQueryObject
,
NtQueryPerformanceCounter
,
NtQuerySection
,
NtQuerySystemInformation
,
NtQuerySystemInformationEx
,
NtQuerySystemTime
,
NtQueryVirtualMemory
,
NtReadVirtualMemory
,
NtResetWriteWatch
,
NtSetInformationObject
,
NtSetSystemTime
,
NtUnlockVirtualMemory
,
NtUnmapViewOfSection
,
NtWriteVirtualMemory
,
DbgUiIssueRemoteBreakin
,
RtlGetSystemTimePrecise
,
RtlWaitOnAddress
,
...
...
dlls/ntdll/unixlib.h
View file @
e3e477e6
...
...
@@ -28,65 +28,31 @@ struct msghdr;
struct
_DISPATCHER_CONTEXT
;
/* increment this when you change the function table */
#define NTDLL_UNIXLIB_VERSION 8
5
#define NTDLL_UNIXLIB_VERSION 8
6
struct
unix_funcs
{
/* Nt* functions */
NTSTATUS
(
WINAPI
*
NtAllocateVirtualMemory
)(
HANDLE
process
,
PVOID
*
ret
,
ULONG_PTR
zero_bits
,
SIZE_T
*
size_ptr
,
ULONG
type
,
ULONG
protect
);
NTSTATUS
(
WINAPI
*
NtAreMappedFilesTheSame
)(
PVOID
addr1
,
PVOID
addr2
);
NTSTATUS
(
WINAPI
*
NtClose
)(
HANDLE
handle
);
NTSTATUS
(
WINAPI
*
NtCreateSection
)(
HANDLE
*
handle
,
ACCESS_MASK
access
,
const
OBJECT_ATTRIBUTES
*
attr
,
const
LARGE_INTEGER
*
size
,
ULONG
protect
,
ULONG
sec_flags
,
HANDLE
file
);
TEB
*
(
WINAPI
*
NtCurrentTeb
)(
void
);
NTSTATUS
(
WINAPI
*
NtDuplicateObject
)(
HANDLE
source_process
,
HANDLE
source
,
HANDLE
dest_process
,
HANDLE
*
dest
,
ACCESS_MASK
access
,
ULONG
attributes
,
ULONG
options
);
NTSTATUS
(
WINAPI
*
NtFlushVirtualMemory
)(
HANDLE
process
,
LPCVOID
*
addr_ptr
,
SIZE_T
*
size_ptr
,
ULONG
unknown
);
NTSTATUS
(
WINAPI
*
NtFreeVirtualMemory
)(
HANDLE
process
,
PVOID
*
addr_ptr
,
SIZE_T
*
size_ptr
,
ULONG
type
);
NTSTATUS
(
WINAPI
*
NtGetContextThread
)(
HANDLE
handle
,
CONTEXT
*
context
);
NTSTATUS
(
WINAPI
*
NtGetWriteWatch
)(
HANDLE
process
,
ULONG
flags
,
PVOID
base
,
SIZE_T
size
,
PVOID
*
addresses
,
ULONG_PTR
*
count
,
ULONG
*
granularity
);
NTSTATUS
(
WINAPI
*
NtLockVirtualMemory
)(
HANDLE
process
,
PVOID
*
addr
,
SIZE_T
*
size
,
ULONG
unknown
);
NTSTATUS
(
WINAPI
*
NtMapViewOfSection
)(
HANDLE
handle
,
HANDLE
process
,
PVOID
*
addr_ptr
,
ULONG_PTR
zero_bits
,
SIZE_T
commit_size
,
const
LARGE_INTEGER
*
offset_ptr
,
SIZE_T
*
size_ptr
,
SECTION_INHERIT
inherit
,
ULONG
alloc_type
,
ULONG
protect
);
NTSTATUS
(
WINAPI
*
NtOpenSection
)(
HANDLE
*
handle
,
ACCESS_MASK
access
,
const
OBJECT_ATTRIBUTES
*
attr
);
NTSTATUS
(
WINAPI
*
NtPowerInformation
)(
POWER_INFORMATION_LEVEL
level
,
void
*
input
,
ULONG
in_size
,
void
*
output
,
ULONG
out_size
);
NTSTATUS
(
WINAPI
*
NtProtectVirtualMemory
)(
HANDLE
process
,
PVOID
*
addr_ptr
,
SIZE_T
*
size_ptr
,
ULONG
new_prot
,
ULONG
*
old_prot
);
NTSTATUS
(
WINAPI
*
NtQueryObject
)(
HANDLE
handle
,
OBJECT_INFORMATION_CLASS
info_class
,
void
*
ptr
,
ULONG
len
,
ULONG
*
used_len
);
NTSTATUS
(
WINAPI
*
NtQueryPerformanceCounter
)(
LARGE_INTEGER
*
counter
,
LARGE_INTEGER
*
frequency
);
NTSTATUS
(
WINAPI
*
NtQuerySection
)(
HANDLE
handle
,
SECTION_INFORMATION_CLASS
class
,
void
*
ptr
,
SIZE_T
size
,
SIZE_T
*
ret_size
);
NTSTATUS
(
WINAPI
*
NtQuerySystemInformation
)(
SYSTEM_INFORMATION_CLASS
class
,
void
*
info
,
ULONG
size
,
ULONG
*
ret_size
);
NTSTATUS
(
WINAPI
*
NtQuerySystemInformationEx
)(
SYSTEM_INFORMATION_CLASS
class
,
void
*
query
,
ULONG
query_len
,
void
*
info
,
ULONG
size
,
ULONG
*
ret_size
);
NTSTATUS
(
WINAPI
*
NtQuerySystemTime
)(
LARGE_INTEGER
*
time
);
NTSTATUS
(
WINAPI
*
NtQueryVirtualMemory
)(
HANDLE
process
,
LPCVOID
addr
,
MEMORY_INFORMATION_CLASS
info_class
,
PVOID
buffer
,
SIZE_T
len
,
SIZE_T
*
res_len
);
NTSTATUS
(
WINAPI
*
NtReadVirtualMemory
)(
HANDLE
process
,
const
void
*
addr
,
void
*
buffer
,
SIZE_T
size
,
SIZE_T
*
bytes_read
);
NTSTATUS
(
WINAPI
*
NtResetWriteWatch
)(
HANDLE
process
,
PVOID
base
,
SIZE_T
size
);
NTSTATUS
(
WINAPI
*
NtSetInformationObject
)(
HANDLE
handle
,
OBJECT_INFORMATION_CLASS
info_class
,
void
*
ptr
,
ULONG
len
);
NTSTATUS
(
WINAPI
*
NtSetSystemTime
)(
const
LARGE_INTEGER
*
new
,
LARGE_INTEGER
*
old
);
NTSTATUS
(
WINAPI
*
NtUnlockVirtualMemory
)(
HANDLE
process
,
PVOID
*
addr
,
SIZE_T
*
size
,
ULONG
unknown
);
NTSTATUS
(
WINAPI
*
NtUnmapViewOfSection
)(
HANDLE
process
,
PVOID
addr
);
NTSTATUS
(
WINAPI
*
NtWriteVirtualMemory
)(
HANDLE
process
,
void
*
addr
,
const
void
*
buffer
,
SIZE_T
size
,
SIZE_T
*
bytes_written
);
/* other Win32 API functions */
NTSTATUS
(
WINAPI
*
DbgUiIssueRemoteBreakin
)(
HANDLE
process
);
...
...
dlls/ntdll/virtual.c
View file @
e3e477e6
...
...
@@ -83,187 +83,3 @@ ssize_t CDECL __wine_locked_recvmsg( int fd, struct msghdr *hdr, int flags )
{
return
unix_funcs
->
virtual_locked_recvmsg
(
fd
,
hdr
,
flags
);
}
/***********************************************************************
* NtAllocateVirtualMemory (NTDLL.@)
* ZwAllocateVirtualMemory (NTDLL.@)
*/
NTSTATUS
WINAPI
NtAllocateVirtualMemory
(
HANDLE
process
,
PVOID
*
ret
,
ULONG_PTR
zero_bits
,
SIZE_T
*
size_ptr
,
ULONG
type
,
ULONG
protect
)
{
return
unix_funcs
->
NtAllocateVirtualMemory
(
process
,
ret
,
zero_bits
,
size_ptr
,
type
,
protect
);
}
/***********************************************************************
* NtFreeVirtualMemory (NTDLL.@)
* ZwFreeVirtualMemory (NTDLL.@)
*/
NTSTATUS
WINAPI
NtFreeVirtualMemory
(
HANDLE
process
,
PVOID
*
addr_ptr
,
SIZE_T
*
size_ptr
,
ULONG
type
)
{
return
unix_funcs
->
NtFreeVirtualMemory
(
process
,
addr_ptr
,
size_ptr
,
type
);
}
/***********************************************************************
* NtProtectVirtualMemory (NTDLL.@)
* ZwProtectVirtualMemory (NTDLL.@)
*/
NTSTATUS
WINAPI
DECLSPEC_HOTPATCH
NtProtectVirtualMemory
(
HANDLE
process
,
PVOID
*
addr_ptr
,
SIZE_T
*
size_ptr
,
ULONG
new_prot
,
ULONG
*
old_prot
)
{
return
unix_funcs
->
NtProtectVirtualMemory
(
process
,
addr_ptr
,
size_ptr
,
new_prot
,
old_prot
);
}
/***********************************************************************
* NtQueryVirtualMemory (NTDLL.@)
* ZwQueryVirtualMemory (NTDLL.@)
*/
NTSTATUS
WINAPI
NtQueryVirtualMemory
(
HANDLE
process
,
LPCVOID
addr
,
MEMORY_INFORMATION_CLASS
info_class
,
PVOID
buffer
,
SIZE_T
len
,
SIZE_T
*
res_len
)
{
return
unix_funcs
->
NtQueryVirtualMemory
(
process
,
addr
,
info_class
,
buffer
,
len
,
res_len
);
}
/***********************************************************************
* NtLockVirtualMemory (NTDLL.@)
* ZwLockVirtualMemory (NTDLL.@)
*/
NTSTATUS
WINAPI
NtLockVirtualMemory
(
HANDLE
process
,
PVOID
*
addr
,
SIZE_T
*
size
,
ULONG
unknown
)
{
return
unix_funcs
->
NtLockVirtualMemory
(
process
,
addr
,
size
,
unknown
);
}
/***********************************************************************
* NtUnlockVirtualMemory (NTDLL.@)
* ZwUnlockVirtualMemory (NTDLL.@)
*/
NTSTATUS
WINAPI
NtUnlockVirtualMemory
(
HANDLE
process
,
PVOID
*
addr
,
SIZE_T
*
size
,
ULONG
unknown
)
{
return
unix_funcs
->
NtUnlockVirtualMemory
(
process
,
addr
,
size
,
unknown
);
}
/***********************************************************************
* NtCreateSection (NTDLL.@)
* ZwCreateSection (NTDLL.@)
*/
NTSTATUS
WINAPI
NtCreateSection
(
HANDLE
*
handle
,
ACCESS_MASK
access
,
const
OBJECT_ATTRIBUTES
*
attr
,
const
LARGE_INTEGER
*
size
,
ULONG
protect
,
ULONG
sec_flags
,
HANDLE
file
)
{
return
unix_funcs
->
NtCreateSection
(
handle
,
access
,
attr
,
size
,
protect
,
sec_flags
,
file
);
}
/***********************************************************************
* NtOpenSection (NTDLL.@)
* ZwOpenSection (NTDLL.@)
*/
NTSTATUS
WINAPI
NtOpenSection
(
HANDLE
*
handle
,
ACCESS_MASK
access
,
const
OBJECT_ATTRIBUTES
*
attr
)
{
return
unix_funcs
->
NtOpenSection
(
handle
,
access
,
attr
);
}
/***********************************************************************
* NtMapViewOfSection (NTDLL.@)
* ZwMapViewOfSection (NTDLL.@)
*/
NTSTATUS
WINAPI
NtMapViewOfSection
(
HANDLE
handle
,
HANDLE
process
,
PVOID
*
addr_ptr
,
ULONG_PTR
zero_bits
,
SIZE_T
commit_size
,
const
LARGE_INTEGER
*
offset_ptr
,
SIZE_T
*
size_ptr
,
SECTION_INHERIT
inherit
,
ULONG
alloc_type
,
ULONG
protect
)
{
return
unix_funcs
->
NtMapViewOfSection
(
handle
,
process
,
addr_ptr
,
zero_bits
,
commit_size
,
offset_ptr
,
size_ptr
,
inherit
,
alloc_type
,
protect
);
}
/***********************************************************************
* NtUnmapViewOfSection (NTDLL.@)
* ZwUnmapViewOfSection (NTDLL.@)
*/
NTSTATUS
WINAPI
NtUnmapViewOfSection
(
HANDLE
process
,
PVOID
addr
)
{
return
unix_funcs
->
NtUnmapViewOfSection
(
process
,
addr
);
}
/******************************************************************************
* NtQuerySection (NTDLL.@)
* ZwQuerySection (NTDLL.@)
*/
NTSTATUS
WINAPI
NtQuerySection
(
HANDLE
handle
,
SECTION_INFORMATION_CLASS
class
,
void
*
ptr
,
SIZE_T
size
,
SIZE_T
*
ret_size
)
{
return
unix_funcs
->
NtQuerySection
(
handle
,
class
,
ptr
,
size
,
ret_size
);
}
/***********************************************************************
* NtFlushVirtualMemory (NTDLL.@)
* ZwFlushVirtualMemory (NTDLL.@)
*/
NTSTATUS
WINAPI
NtFlushVirtualMemory
(
HANDLE
process
,
LPCVOID
*
addr_ptr
,
SIZE_T
*
size_ptr
,
ULONG
unknown
)
{
return
unix_funcs
->
NtFlushVirtualMemory
(
process
,
addr_ptr
,
size_ptr
,
unknown
);
}
/***********************************************************************
* NtGetWriteWatch (NTDLL.@)
* ZwGetWriteWatch (NTDLL.@)
*/
NTSTATUS
WINAPI
NtGetWriteWatch
(
HANDLE
process
,
ULONG
flags
,
PVOID
base
,
SIZE_T
size
,
PVOID
*
addresses
,
ULONG_PTR
*
count
,
ULONG
*
granularity
)
{
return
unix_funcs
->
NtGetWriteWatch
(
process
,
flags
,
base
,
size
,
addresses
,
count
,
granularity
);
}
/***********************************************************************
* NtResetWriteWatch (NTDLL.@)
* ZwResetWriteWatch (NTDLL.@)
*/
NTSTATUS
WINAPI
NtResetWriteWatch
(
HANDLE
process
,
PVOID
base
,
SIZE_T
size
)
{
return
unix_funcs
->
NtResetWriteWatch
(
process
,
base
,
size
);
}
/***********************************************************************
* NtReadVirtualMemory (NTDLL.@)
* ZwReadVirtualMemory (NTDLL.@)
*/
NTSTATUS
WINAPI
NtReadVirtualMemory
(
HANDLE
process
,
const
void
*
addr
,
void
*
buffer
,
SIZE_T
size
,
SIZE_T
*
bytes_read
)
{
return
unix_funcs
->
NtReadVirtualMemory
(
process
,
addr
,
buffer
,
size
,
bytes_read
);
}
/***********************************************************************
* NtWriteVirtualMemory (NTDLL.@)
* ZwWriteVirtualMemory (NTDLL.@)
*/
NTSTATUS
WINAPI
NtWriteVirtualMemory
(
HANDLE
process
,
void
*
addr
,
const
void
*
buffer
,
SIZE_T
size
,
SIZE_T
*
bytes_written
)
{
return
unix_funcs
->
NtWriteVirtualMemory
(
process
,
addr
,
buffer
,
size
,
bytes_written
);
}
/***********************************************************************
* NtAreMappedFilesTheSame (NTDLL.@)
* ZwAreMappedFilesTheSame (NTDLL.@)
*/
NTSTATUS
WINAPI
NtAreMappedFilesTheSame
(
PVOID
addr1
,
PVOID
addr2
)
{
return
unix_funcs
->
NtAreMappedFilesTheSame
(
addr1
,
addr2
);
}
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