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
edc479ee
Commit
edc479ee
authored
Jan 13, 2023
by
Brendan Shanks
Committed by
Alexandre Julliard
Feb 02, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Implement and add tests for QueryProcessCycleTime.
parent
c0ffd587
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
3 deletions
+23
-3
process.c
dlls/kernelbase/process.c
+6
-3
process.c
dlls/kernelbase/tests/process.c
+16
-0
winbase.h
include/winbase.h
+1
-0
No files found.
dlls/kernelbase/process.c
View file @
edc479ee
...
...
@@ -1074,10 +1074,13 @@ BOOL WINAPI DECLSPEC_HOTPATCH ProcessIdToSessionId( DWORD pid, DWORD *id )
*/
BOOL
WINAPI
DECLSPEC_HOTPATCH
QueryProcessCycleTime
(
HANDLE
process
,
ULONG64
*
cycle
)
{
static
int
onc
e
;
if
(
!
once
++
)
FIXME
(
"(%p,%p): stub!
\n
"
,
process
,
cycle
);
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
PROCESS_CYCLE_TIME_INFORMATION
tim
e
;
if
(
!
set_ntstatus
(
NtQueryInformationProcess
(
process
,
ProcessCycleTime
,
&
time
,
sizeof
(
time
),
NULL
)
))
return
FALSE
;
*
cycle
=
time
.
AccumulatedCycles
;
return
TRUE
;
}
...
...
dlls/kernelbase/tests/process.c
View file @
edc479ee
...
...
@@ -421,6 +421,21 @@ static void test_MapViewOfFileFromApp(void)
ok
(
ret
,
"Failed to delete a test file.
\n
"
);
}
static
void
test_QueryProcessCycleTime
(
void
)
{
ULONG64
cycles1
,
cycles2
;
BOOL
ret
;
ret
=
QueryProcessCycleTime
(
GetCurrentProcess
(),
&
cycles1
);
ok
(
ret
,
"QueryProcessCycleTime failed, error %lu.
\n
"
,
GetLastError
()
);
ret
=
QueryProcessCycleTime
(
GetCurrentProcess
(),
&
cycles2
);
ok
(
ret
,
"QueryProcessCycleTime failed, error %lu.
\n
"
,
GetLastError
()
);
todo_wine
ok
(
cycles2
>
cycles1
,
"CPU cycles used by process should be increasing.
\n
"
);
}
static
void
init_funcs
(
void
)
{
HMODULE
hmod
=
GetModuleHandleA
(
"kernelbase.dll"
);
...
...
@@ -453,4 +468,5 @@ START_TEST(process)
test_OpenFileMappingFromApp
();
test_CreateFileMappingFromApp
();
test_MapViewOfFileFromApp
();
test_QueryProcessCycleTime
();
}
include/winbase.h
View file @
edc479ee
...
...
@@ -2605,6 +2605,7 @@ WINBASEAPI BOOL WINAPI QueryInformationJobObject(HANDLE,JOBOBJECTINFOCLAS
WINBASEAPI
BOOL
WINAPI
QueryMemoryResourceNotification
(
HANDLE
,
PBOOL
);
WINBASEAPI
BOOL
WINAPI
QueryPerformanceCounter
(
LARGE_INTEGER
*
);
WINBASEAPI
BOOL
WINAPI
QueryPerformanceFrequency
(
LARGE_INTEGER
*
);
WINBASEAPI
BOOL
WINAPI
QueryProcessCycleTime
(
HANDLE
,
PULONG64
);
WINBASEAPI
BOOL
WINAPI
QueryThreadCycleTime
(
HANDLE
,
PULONG64
);
WINBASEAPI
BOOL
WINAPI
QueryUmsThreadInformation
(
PUMS_CONTEXT
,
UMS_THREAD_INFO_CLASS
,
PVOID
,
ULONG
,
PULONG
);
WINBASEAPI
DWORD
WINAPI
QueueUserAPC
(
PAPCFUNC
,
HANDLE
,
ULONG_PTR
);
...
...
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