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
2d5bd21f
Commit
2d5bd21f
authored
Jun 30, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Jul 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Fill the PrivateUsage field of VM_COUNTERS_EX.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
acc52bc9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
info.c
dlls/ntdll/tests/info.c
+6
-0
process.c
dlls/ntdll/unix/process.c
+6
-4
No files found.
dlls/ntdll/tests/info.c
View file @
2d5bd21f
...
...
@@ -1462,6 +1462,7 @@ static void test_query_process_vm(void)
process
=
OpenProcess
(
PROCESS_QUERY_INFORMATION
,
FALSE
,
GetCurrentProcessId
());
status
=
pNtQueryInformationProcess
(
process
,
ProcessVmCounters
,
&
pvi
,
sizeof
(
pvi
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
ok
(
pvi
.
PrivateUsage
==
pvi
.
PagefileUsage
,
"wrong value %lu/%lu
\n
"
,
pvi
.
PrivateUsage
,
pvi
.
PagefileUsage
);
/* Check if we have some return values */
dump_vm_counters
(
"VM counters for GetCurrentProcessId"
,
&
pvi
);
...
...
@@ -1473,6 +1474,7 @@ static void test_query_process_vm(void)
/* 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
);
ok
(
pvi
.
PrivateUsage
==
pvi
.
PagefileUsage
,
"wrong value %lu/%lu
\n
"
,
pvi
.
PrivateUsage
,
pvi
.
PagefileUsage
);
prev_size
=
pvi
.
VirtualSize
;
if
(
winetest_debug
>
1
)
dump_vm_counters
(
"VM counters before VirtualAlloc"
,
&
pvi
);
...
...
@@ -1480,6 +1482,7 @@ static void test_query_process_vm(void)
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
);
ok
(
pvi
.
PrivateUsage
==
pvi
.
PagefileUsage
,
"wrong value %lu/%lu
\n
"
,
pvi
.
PrivateUsage
,
pvi
.
PagefileUsage
);
if
(
winetest_debug
>
1
)
dump_vm_counters
(
"VM counters after VirtualAlloc"
,
&
pvi
);
todo_wine
ok
(
pvi
.
VirtualSize
>=
prev_size
+
alloc_size
,
...
...
@@ -1488,6 +1491,7 @@ static void test_query_process_vm(void)
status
=
pNtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessVmCounters
,
&
pvi
,
sizeof
(
pvi
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
ok
(
pvi
.
PrivateUsage
==
pvi
.
PagefileUsage
,
"wrong value %lu/%lu
\n
"
,
pvi
.
PrivateUsage
,
pvi
.
PagefileUsage
);
prev_size
=
pvi
.
VirtualSize
;
if
(
winetest_debug
>
1
)
dump_vm_counters
(
"VM counters before VirtualAlloc"
,
&
pvi
);
...
...
@@ -1495,6 +1499,7 @@ static void test_query_process_vm(void)
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
);
ok
(
pvi
.
PrivateUsage
==
pvi
.
PagefileUsage
,
"wrong value %lu/%lu
\n
"
,
pvi
.
PrivateUsage
,
pvi
.
PagefileUsage
);
if
(
winetest_debug
>
1
)
dump_vm_counters
(
"VM counters after VirtualAlloc(MEM_RESERVE)"
,
&
pvi
);
todo_wine
ok
(
pvi
.
VirtualSize
>=
prev_size
+
alloc_size
,
...
...
@@ -1505,6 +1510,7 @@ static void test_query_process_vm(void)
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
);
ok
(
pvi
.
PrivateUsage
==
pvi
.
PagefileUsage
,
"wrong value %lu/%lu
\n
"
,
pvi
.
PrivateUsage
,
pvi
.
PagefileUsage
);
if
(
winetest_debug
>
1
)
dump_vm_counters
(
"VM counters after VirtualAlloc(MEM_COMMIT)"
,
&
pvi
);
ok
(
pvi
.
VirtualSize
==
prev_size
,
...
...
dlls/ntdll/unix/process.c
View file @
2d5bd21f
...
...
@@ -1008,7 +1008,7 @@ NTSTATUS WINAPI NtTerminateProcess( HANDLE handle, LONG exit_code )
#if defined(HAVE_MACH_MACH_H)
static
void
fill_VM_COUNTERS
(
VM_COUNTERS
*
pvmi
)
static
void
fill_VM_COUNTERS
(
VM_COUNTERS_EX
*
pvmi
)
{
#if defined(MACH_TASK_BASIC_INFO)
struct
mach_task_basic_info
info
;
...
...
@@ -1025,7 +1025,7 @@ static void fill_VM_COUNTERS(VM_COUNTERS* pvmi)
#elif defined(linux)
static
void
fill_VM_COUNTERS
(
VM_COUNTERS
*
pvmi
)
static
void
fill_VM_COUNTERS
(
VM_COUNTERS_EX
*
pvmi
)
{
FILE
*
f
;
char
line
[
256
];
...
...
@@ -1056,7 +1056,7 @@ static void fill_VM_COUNTERS(VM_COUNTERS* pvmi)
#else
static
void
fill_VM_COUNTERS
(
VM_COUNTERS
*
pvmi
)
static
void
fill_VM_COUNTERS
(
VM_COUNTERS_EX
*
pvmi
)
{
/* FIXME : real data */
}
...
...
@@ -1168,7 +1168,7 @@ NTSTATUS WINAPI NtQueryInformationProcess( HANDLE handle, PROCESSINFOCLASS class
case
ProcessVmCounters
:
{
VM_COUNTERS
pvmi
;
VM_COUNTERS
_EX
pvmi
;
/* older Windows versions don't have the PrivateUsage field */
if
(
size
>=
sizeof
(
VM_COUNTERS
))
...
...
@@ -1196,6 +1196,8 @@ NTSTATUS WINAPI NtQueryInformationProcess( HANDLE handle, PROCESSINFOCLASS class
SERVER_END_REQ
;
if
(
ret
)
break
;
}
if
(
size
>=
sizeof
(
VM_COUNTERS_EX
))
pvmi
.
PrivateUsage
=
pvmi
.
PagefileUsage
;
len
=
size
;
if
(
len
!=
sizeof
(
VM_COUNTERS
))
len
=
sizeof
(
VM_COUNTERS_EX
);
memcpy
(
info
,
&
pvmi
,
min
(
size
,
sizeof
(
pvmi
)));
...
...
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