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
7c06d99e
Commit
7c06d99e
authored
Jul 03, 2017
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Jul 03, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Add more tests if we have real VM counters.
Signed-off-by:
Akihiro Sagawa
<
sagawa.aki@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4fbabc2a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
info.c
dlls/ntdll/tests/info.c
+44
-0
No files found.
dlls/ntdll/tests/info.c
View file @
7c06d99e
...
...
@@ -1069,6 +1069,9 @@ static void test_query_process_vm(void)
VM_COUNTERS
pvi
;
ULONG
old_size
=
FIELD_OFFSET
(
VM_COUNTERS
,
PrivatePageCount
);
HANDLE
process
;
SIZE_T
prev_size
;
const
SIZE_T
alloc_size
=
16
*
1024
*
1024
;
void
*
ptr
;
status
=
pNtQueryInformationProcess
(
NULL
,
ProcessVmCounters
,
NULL
,
sizeof
(
pvi
),
NULL
);
ok
(
status
==
STATUS_ACCESS_VIOLATION
||
status
==
STATUS_INVALID_HANDLE
,
...
...
@@ -1119,6 +1122,47 @@ static void test_query_process_vm(void)
ok
(
pvi
.
PagefileUsage
>
0
,
"Expected a PagefileUsage > 0
\n
"
);
CloseHandle
(
process
);
/* Check if we have real counters */
status
=
pNtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessVmCounters
,
&
pvi
,
sizeof
(
pvi
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
prev_size
=
pvi
.
VirtualSize
;
if
(
winetest_debug
>
1
)
dump_vm_counters
(
"VM counters before VirtualAlloc"
,
&
pvi
);
ptr
=
VirtualAlloc
(
NULL
,
alloc_size
,
MEM_COMMIT
|
MEM_RESERVE
,
PAGE_READWRITE
);
ok
(
ptr
!=
NULL
,
"VirtualAlloc failed, err %u
\n
"
,
GetLastError
());
status
=
pNtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessVmCounters
,
&
pvi
,
sizeof
(
pvi
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
if
(
winetest_debug
>
1
)
dump_vm_counters
(
"VM counters after VirtualAlloc"
,
&
pvi
);
todo_wine
ok
(
pvi
.
VirtualSize
>=
prev_size
+
alloc_size
,
"Expected to be greater than %lu, got %lu
\n
"
,
prev_size
+
alloc_size
,
pvi
.
VirtualSize
);
VirtualFree
(
ptr
,
0
,
MEM_RELEASE
);
status
=
pNtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessVmCounters
,
&
pvi
,
sizeof
(
pvi
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
prev_size
=
pvi
.
VirtualSize
;
if
(
winetest_debug
>
1
)
dump_vm_counters
(
"VM counters before VirtualAlloc"
,
&
pvi
);
ptr
=
VirtualAlloc
(
NULL
,
alloc_size
,
MEM_RESERVE
,
PAGE_READWRITE
);
ok
(
ptr
!=
NULL
,
"VirtualAlloc failed, err %u
\n
"
,
GetLastError
());
status
=
pNtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessVmCounters
,
&
pvi
,
sizeof
(
pvi
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
if
(
winetest_debug
>
1
)
dump_vm_counters
(
"VM counters after VirtualAlloc(MEM_RESERVE)"
,
&
pvi
);
todo_wine
ok
(
pvi
.
VirtualSize
>=
prev_size
+
alloc_size
,
"Expected to be greater than %lu, got %lu
\n
"
,
prev_size
+
alloc_size
,
pvi
.
VirtualSize
);
prev_size
=
pvi
.
VirtualSize
;
ptr
=
VirtualAlloc
(
ptr
,
alloc_size
,
MEM_COMMIT
,
PAGE_READWRITE
);
ok
(
ptr
!=
NULL
,
"VirtualAlloc failed, err %u
\n
"
,
GetLastError
());
status
=
pNtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessVmCounters
,
&
pvi
,
sizeof
(
pvi
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
if
(
winetest_debug
>
1
)
dump_vm_counters
(
"VM counters after VirtualAlloc(MEM_COMMIT)"
,
&
pvi
);
ok
(
pvi
.
VirtualSize
==
prev_size
,
"Expected to equal to %lu, got %lu
\n
"
,
prev_size
,
pvi
.
VirtualSize
);
VirtualFree
(
ptr
,
0
,
MEM_RELEASE
);
}
static
void
test_query_process_io
(
void
)
...
...
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