Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
d453db5b
Commit
d453db5b
authored
Oct 17, 2020
by
Myah Caron
Committed by
Alexandre Julliard
Oct 26, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Stub NtAllocateVirtualMemoryEx.
Signed-off-by:
Myah Caron
<
qsniyg@protonmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3c883271
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
0 deletions
+39
-0
ntdll.spec
dlls/ntdll/ntdll.spec
+2
-0
virtual.c
dlls/ntdll/tests/virtual.c
+21
-0
virtual.c
dlls/ntdll/unix/virtual.c
+15
-0
winternl.h
include/winternl.h
+1
-0
No files found.
dlls/ntdll/ntdll.spec
View file @
d453db5b
...
...
@@ -141,6 +141,7 @@
# @ stub NtAllocateUserPhysicalPages
@ stdcall -syscall NtAllocateUuids(ptr ptr ptr ptr)
@ stdcall -syscall NtAllocateVirtualMemory(long ptr long ptr long long)
@ stdcall -syscall NtAllocateVirtualMemoryEx(long ptr ptr long long ptr long)
@ stdcall -syscall NtAreMappedFilesTheSame(ptr ptr)
@ stdcall -syscall NtAssignProcessToJobObject(long long)
@ stub NtCallbackReturn
...
...
@@ -1146,6 +1147,7 @@
# @ stub ZwAllocateUserPhysicalPages
@ stdcall -private -syscall ZwAllocateUuids(ptr ptr ptr ptr) NtAllocateUuids
@ stdcall -private -syscall ZwAllocateVirtualMemory(long ptr long ptr long long) NtAllocateVirtualMemory
@ stdcall -private -syscall ZwAllocateVirtualMemoryEx(long ptr ptr long long ptr long) NtAllocateVirtualMemoryEx
@ stdcall -private -syscall ZwAreMappedFilesTheSame(ptr ptr) NtAreMappedFilesTheSame
@ stdcall -private -syscall ZwAssignProcessToJobObject(long long) NtAssignProcessToJobObject
@ stub ZwCallbackReturn
...
...
dlls/ntdll/tests/virtual.c
View file @
d453db5b
...
...
@@ -34,6 +34,8 @@ static NTSTATUS (WINAPI *pRtlCreateUserStack)(SIZE_T, SIZE_T, ULONG, SIZE_T, SIZ
static
ULONG64
(
WINAPI
*
pRtlGetEnabledExtendedFeatures
)(
ULONG64
);
static
NTSTATUS
(
WINAPI
*
pRtlFreeUserStack
)(
void
*
);
static
BOOL
(
WINAPI
*
pIsWow64Process
)(
HANDLE
,
PBOOL
);
static
NTSTATUS
(
WINAPI
*
pNtAllocateVirtualMemoryEx
)(
HANDLE
,
PVOID
*
,
SIZE_T
*
,
ULONG
,
ULONG
,
MEM_EXTENDED_PARAMETER
*
,
ULONG
);
static
const
BOOL
is_win64
=
sizeof
(
void
*
)
!=
sizeof
(
int
);
static
SYSTEM_BASIC_INFORMATION
sbi
;
...
...
@@ -215,6 +217,24 @@ static void test_NtAllocateVirtualMemory(void)
size
=
0
;
status
=
NtFreeVirtualMemory
(
NtCurrentProcess
(),
&
addr1
,
&
size
,
MEM_RELEASE
);
ok
(
status
==
STATUS_SUCCESS
,
"NtFreeVirtualMemory failed
\n
"
);
if
(
!
pNtAllocateVirtualMemoryEx
)
{
win_skip
(
"NtAllocateVirtualMemoryEx() is missing
\n
"
);
return
;
}
/* simple allocation should succeed */
size
=
0x1000
;
addr1
=
NULL
;
status
=
pNtAllocateVirtualMemoryEx
(
NtCurrentProcess
(),
&
addr1
,
&
size
,
MEM_RESERVE
|
MEM_COMMIT
,
PAGE_EXECUTE_READWRITE
,
NULL
,
0
);
ok
(
status
==
STATUS_SUCCESS
,
"NtAllocateVirtualMemoryEx returned %08x
\n
"
,
status
);
/* specifying a count of >0 with NULL parameters should fail */
status
=
pNtAllocateVirtualMemoryEx
(
NtCurrentProcess
(),
&
addr1
,
&
size
,
MEM_RESERVE
|
MEM_COMMIT
,
PAGE_EXECUTE_READWRITE
,
NULL
,
1
);
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"NtAllocateVirtualMemoryEx returned %08x
\n
"
,
status
);
}
static
void
test_RtlCreateUserStack
(
void
)
...
...
@@ -648,6 +668,7 @@ START_TEST(virtual)
pRtlCreateUserStack
=
(
void
*
)
GetProcAddress
(
mod
,
"RtlCreateUserStack"
);
pRtlFreeUserStack
=
(
void
*
)
GetProcAddress
(
mod
,
"RtlFreeUserStack"
);
pRtlGetEnabledExtendedFeatures
=
(
void
*
)
GetProcAddress
(
mod
,
"RtlGetEnabledExtendedFeatures"
);
pNtAllocateVirtualMemoryEx
=
(
void
*
)
GetProcAddress
(
mod
,
"NtAllocateVirtualMemoryEx"
);
NtQuerySystemInformation
(
SystemBasicInformation
,
&
sbi
,
sizeof
(
sbi
),
NULL
);
trace
(
"system page size %#x
\n
"
,
sbi
.
PageSize
);
...
...
dlls/ntdll/unix/virtual.c
View file @
d453db5b
...
...
@@ -3452,6 +3452,21 @@ NTSTATUS WINAPI NtAllocateVirtualMemory( HANDLE process, PVOID *ret, ULONG_PTR z
return
status
;
}
/***********************************************************************
* NtAllocateVirtualMemoryEx (NTDLL.@)
* ZwAllocateVirtualMemoryEx (NTDLL.@)
*/
NTSTATUS
WINAPI
NtAllocateVirtualMemoryEx
(
HANDLE
process
,
PVOID
*
ret
,
SIZE_T
*
size_ptr
,
ULONG
type
,
ULONG
protect
,
MEM_EXTENDED_PARAMETER
*
parameters
,
ULONG
count
)
{
if
(
count
&&
!
parameters
)
return
STATUS_INVALID_PARAMETER
;
if
(
count
)
FIXME
(
"Ignoring %d extended parameters %p
\n
"
,
count
,
parameters
);
return
NtAllocateVirtualMemory
(
process
,
ret
,
0
,
size_ptr
,
type
,
protect
);
}
/***********************************************************************
* NtFreeVirtualMemory (NTDLL.@)
...
...
include/winternl.h
View file @
d453db5b
...
...
@@ -3020,6 +3020,7 @@ NTSYSAPI NTSTATUS WINAPI NtAlertThread(HANDLE ThreadHandle);
NTSYSAPI
NTSTATUS
WINAPI
NtAllocateLocallyUniqueId
(
PLUID
lpLuid
);
NTSYSAPI
NTSTATUS
WINAPI
NtAllocateUuids
(
PULARGE_INTEGER
,
PULONG
,
PULONG
,
PUCHAR
);
NTSYSAPI
NTSTATUS
WINAPI
NtAllocateVirtualMemory
(
HANDLE
,
PVOID
*
,
ULONG_PTR
,
SIZE_T
*
,
ULONG
,
ULONG
);
NTSYSAPI
NTSTATUS
WINAPI
NtAllocateVirtualMemoryEx
(
HANDLE
,
PVOID
*
,
SIZE_T
*
,
ULONG
,
ULONG
,
MEM_EXTENDED_PARAMETER
*
,
ULONG
);
NTSYSAPI
NTSTATUS
WINAPI
NtAreMappedFilesTheSame
(
PVOID
,
PVOID
);
NTSYSAPI
NTSTATUS
WINAPI
NtAssignProcessToJobObject
(
HANDLE
,
HANDLE
);
NTSYSAPI
NTSTATUS
WINAPI
NtCallbackReturn
(
PVOID
,
ULONG
,
NTSTATUS
);
...
...
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