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
04b829e8
Commit
04b829e8
authored
Mar 09, 2024
by
Vijay Kiran Kamuju
Committed by
Alexandre Julliard
Apr 16, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Add NtQueryInformationProcess(ProcessQuotaLimits) tests.
Signed-off-by:
Gijs Vermeulen
<
gijsvrm@gmail.com
>
parent
ea4ba2f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
0 deletions
+54
-0
info.c
dlls/ntdll/tests/info.c
+54
-0
No files found.
dlls/ntdll/tests/info.c
View file @
04b829e8
...
...
@@ -2677,6 +2677,59 @@ static void test_query_process_debug_flags(int argc, char **argv)
}
}
static
void
test_query_process_quota_limits
(
void
)
{
QUOTA_LIMITS
qlimits
;
NTSTATUS
status
;
HANDLE
process
;
ULONG
ret_len
;
status
=
NtQueryInformationProcess
(
NULL
,
ProcessQuotaLimits
,
NULL
,
sizeof
(
qlimits
),
NULL
);
ok
(
status
==
STATUS_INVALID_HANDLE
,
"NtQueryInformationProcess failed, status %#lx.
\n
"
,
status
);
status
=
NtQueryInformationProcess
(
NULL
,
ProcessQuotaLimits
,
&
qlimits
,
sizeof
(
qlimits
),
NULL
);
ok
(
status
==
STATUS_INVALID_HANDLE
,
"NtQueryInformationProcess failed, status %#lx.
\n
"
,
status
);
process
=
GetCurrentProcess
();
status
=
NtQueryInformationProcess
(
process
,
ProcessQuotaLimits
,
&
qlimits
,
2
,
&
ret_len
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"NtQueryInformationProcess failed, status %#lx.
\n
"
,
status
);
memset
(
&
qlimits
,
0
,
sizeof
(
qlimits
));
status
=
NtQueryInformationProcess
(
process
,
ProcessQuotaLimits
,
&
qlimits
,
sizeof
(
qlimits
),
&
ret_len
);
ok
(
status
==
STATUS_SUCCESS
,
"NtQueryInformationProcess failed, status %#lx.
\n
"
,
status
);
ok
(
sizeof
(
qlimits
)
==
ret_len
,
"len set to %lx
\n
"
,
ret_len
);
ok
(
qlimits
.
MinimumWorkingSetSize
==
204800
,
"Expected MinimumWorkingSetSize = 204800, got %s
\n
"
,
wine_dbgstr_longlong
(
qlimits
.
MinimumWorkingSetSize
));
ok
(
qlimits
.
MaximumWorkingSetSize
==
1413120
,
"Expected MaximumWorkingSetSize = 1413120, got %s
\n
"
,
wine_dbgstr_longlong
(
qlimits
.
MaximumWorkingSetSize
));
ok
(
qlimits
.
PagefileLimit
==
~
0
,
"Expected PagefileLimit = ~0, got %s
\n
"
,
wine_dbgstr_longlong
(
qlimits
.
PagefileLimit
));
ok
(
qlimits
.
TimeLimit
.
QuadPart
==
~
0
,
"Expected TimeLimit = ~0, got %s
\n
"
,
wine_dbgstr_longlong
(
qlimits
.
TimeLimit
.
QuadPart
));
if
(
winetest_debug
>
1
)
{
trace
(
"Quota Limits:
\n
"
);
trace
(
"PagedPoolLimit: %s
\n
"
,
wine_dbgstr_longlong
(
qlimits
.
PagedPoolLimit
));
trace
(
"NonPagedPoolLimit: %s
\n
"
,
wine_dbgstr_longlong
(
qlimits
.
NonPagedPoolLimit
));
}
memset
(
&
qlimits
,
0
,
sizeof
(
qlimits
));
status
=
NtQueryInformationProcess
(
process
,
ProcessQuotaLimits
,
&
qlimits
,
sizeof
(
qlimits
)
*
2
,
&
ret_len
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"NtQueryInformationProcess failed, status %#lx.
\n
"
,
status
);
ok
(
sizeof
(
qlimits
)
==
ret_len
,
"len set to %lx
\n
"
,
ret_len
);
memset
(
&
qlimits
,
0
,
sizeof
(
qlimits
));
status
=
NtQueryInformationProcess
(
process
,
ProcessQuotaLimits
,
&
qlimits
,
sizeof
(
qlimits
)
-
1
,
&
ret_len
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"NtQueryInformationProcess failed, status %#lx.
\n
"
,
status
);
ok
(
sizeof
(
qlimits
)
==
ret_len
,
"len set to %lx
\n
"
,
ret_len
);
memset
(
&
qlimits
,
0
,
sizeof
(
qlimits
));
status
=
NtQueryInformationProcess
(
process
,
ProcessQuotaLimits
,
&
qlimits
,
sizeof
(
qlimits
)
+
1
,
&
ret_len
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"NtQueryInformationProcess failed, status %#lx.
\n
"
,
status
);
ok
(
sizeof
(
qlimits
)
==
ret_len
,
"len set to %lx
\n
"
,
ret_len
);
}
static
void
test_readvirtualmemory
(
void
)
{
HANDLE
process
;
...
...
@@ -3886,6 +3939,7 @@ START_TEST(info)
test_query_process_debug_object_handle
(
argc
,
argv
);
test_query_process_debug_flags
(
argc
,
argv
);
test_query_process_image_info
();
test_query_process_quota_limits
();
test_mapprotection
();
test_threadstack
();
...
...
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