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
fb1bfebb
Commit
fb1bfebb
authored
Jul 25, 2022
by
Brendan Shanks
Committed by
Alexandre Julliard
Jul 26, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Add tests for the address limit of NtQueryVirtualMemory(MemoryBasicInformation).
parent
a04e890f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
info.c
dlls/ntdll/tests/info.c
+13
-1
No files found.
dlls/ntdll/tests/info.c
View file @
fb1bfebb
...
...
@@ -2773,6 +2773,7 @@ static void test_queryvirtualmemory(void)
void
*
user_shared_data
=
(
void
*
)
0x7ffe0000
;
char
buffer
[
1024
];
MEMORY_SECTION_NAME
*
name
=
(
MEMORY_SECTION_NAME
*
)
buffer
;
SYSTEM_BASIC_INFORMATION
sbi
;
module
=
GetModuleHandleA
(
"ntdll.dll"
);
status
=
pNtQueryVirtualMemory
(
NtCurrentProcess
(),
module
,
MemoryBasicInformation
,
&
mbi
,
sizeof
(
MEMORY_BASIC_INFORMATION
),
&
readcount
);
...
...
@@ -2849,9 +2850,20 @@ static void test_queryvirtualmemory(void)
ok
(
mbi
.
Type
==
MEM_PRIVATE
,
"mbi.Type is 0x%lx, expected 0x%x
\n
"
,
mbi
.
Type
,
MEM_PRIVATE
);
ok
(
mbi
.
RegionSize
==
0x1000
,
"mbi.RegionSize is 0x%Ix, expected 0x%x
\n
"
,
mbi
.
RegionSize
,
0x1000
);
/* check error code when addr is higher than working set limit */
/* check error code when addr is higher than user space limit */
status
=
pNtQuerySystemInformation
(
SystemBasicInformation
,
&
sbi
,
sizeof
(
sbi
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
status
=
pNtQueryVirtualMemory
(
NtCurrentProcess
(),
sbi
.
LowestUserAddress
,
MemoryBasicInformation
,
&
mbi
,
sizeof
(
mbi
),
&
readcount
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
status
=
pNtQueryVirtualMemory
(
NtCurrentProcess
(),
(
char
*
)
sbi
.
LowestUserAddress
-
1
,
MemoryBasicInformation
,
&
mbi
,
sizeof
(
mbi
),
&
readcount
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
status
=
pNtQueryVirtualMemory
(
NtCurrentProcess
(),
sbi
.
HighestUserAddress
,
MemoryBasicInformation
,
&
mbi
,
sizeof
(
mbi
),
&
readcount
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
status
=
pNtQueryVirtualMemory
(
NtCurrentProcess
(),
(
char
*
)
sbi
.
HighestUserAddress
+
1
,
MemoryBasicInformation
,
&
mbi
,
sizeof
(
mbi
),
&
readcount
);
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"Expected STATUS_INVALID_PARAMETER, got %08lx
\n
"
,
status
);
status
=
pNtQueryVirtualMemory
(
NtCurrentProcess
(),
(
void
*
)
~
0
,
MemoryBasicInformation
,
&
mbi
,
sizeof
(
mbi
),
&
readcount
);
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"Expected STATUS_INVALID_PARAMETER, got %08lx
\n
"
,
status
);
/* check error code when len is less than MEMORY_BASIC_INFORMATION size */
status
=
pNtQueryVirtualMemory
(
NtCurrentProcess
(),
GetProcessHeap
(),
MemoryBasicInformation
,
&
mbi
,
sizeof
(
MEMORY_BASIC_INFORMATION
)
-
1
,
&
readcount
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected STATUS_INFO_LENGTH_MISMATCH, got %08lx
\n
"
,
status
);
...
...
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