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
79e3c21c
Commit
79e3c21c
authored
May 22, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Move GetSystemTimes() implementation to kernelbase.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7cc9ccbd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
74 deletions
+58
-74
kernel32.spec
dlls/kernel32/kernel32.spec
+1
-1
time.c
dlls/kernel32/time.c
+0
-71
kernelbase.spec
dlls/kernelbase/kernelbase.spec
+1
-1
sync.c
dlls/kernelbase/sync.c
+56
-1
No files found.
dlls/kernel32/kernel32.spec
View file @
79e3c21c
...
...
@@ -835,7 +835,7 @@
@ stdcall GetSystemTimeAdjustment(ptr ptr ptr)
@ stdcall -import GetSystemTimeAsFileTime(ptr)
@ stdcall -import GetSystemTimePreciseAsFileTime(ptr)
@ stdcall GetSystemTimes(ptr ptr ptr)
@ stdcall
-import
GetSystemTimes(ptr ptr ptr)
@ stdcall -import GetSystemWindowsDirectoryA(ptr long)
@ stdcall -import GetSystemWindowsDirectoryW(ptr long)
@ stdcall -import GetSystemWow64DirectoryA(ptr long)
...
...
dlls/kernel32/time.c
View file @
79e3c21c
...
...
@@ -223,77 +223,6 @@ BOOL WINAPI FileTimeToDosDateTime( const FILETIME *ft, LPWORD fatdate,
return
TRUE
;
}
/*********************************************************************
* GetSystemTimes (KERNEL32.@)
*
* Retrieves system timing information
*
* PARAMS
* lpIdleTime [O] Destination for idle time.
* lpKernelTime [O] Destination for kernel time.
* lpUserTime [O] Destination for user time.
*
* RETURNS
* TRUE if success, FALSE otherwise.
*/
BOOL
WINAPI
GetSystemTimes
(
LPFILETIME
lpIdleTime
,
LPFILETIME
lpKernelTime
,
LPFILETIME
lpUserTime
)
{
LARGE_INTEGER
idle_time
,
kernel_time
,
user_time
;
SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
*
sppi
;
SYSTEM_BASIC_INFORMATION
sbi
;
ULONG
ret_size
;
int
i
;
TRACE
(
"(%p,%p,%p)
\n
"
,
lpIdleTime
,
lpKernelTime
,
lpUserTime
);
if
(
!
set_ntstatus
(
NtQuerySystemInformation
(
SystemBasicInformation
,
&
sbi
,
sizeof
(
sbi
),
&
ret_size
)))
return
FALSE
;
sppi
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
)
*
sbi
.
NumberOfProcessors
);
if
(
!
sppi
)
{
SetLastError
(
ERROR_OUTOFMEMORY
);
return
FALSE
;
}
if
(
!
set_ntstatus
(
NtQuerySystemInformation
(
SystemProcessorPerformanceInformation
,
sppi
,
sizeof
(
*
sppi
)
*
sbi
.
NumberOfProcessors
,
&
ret_size
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
sppi
);
return
FALSE
;
}
idle_time
.
QuadPart
=
0
;
kernel_time
.
QuadPart
=
0
;
user_time
.
QuadPart
=
0
;
for
(
i
=
0
;
i
<
sbi
.
NumberOfProcessors
;
i
++
)
{
idle_time
.
QuadPart
+=
sppi
[
i
].
IdleTime
.
QuadPart
;
kernel_time
.
QuadPart
+=
sppi
[
i
].
KernelTime
.
QuadPart
;
user_time
.
QuadPart
+=
sppi
[
i
].
UserTime
.
QuadPart
;
}
if
(
lpIdleTime
)
{
lpIdleTime
->
dwLowDateTime
=
idle_time
.
u
.
LowPart
;
lpIdleTime
->
dwHighDateTime
=
idle_time
.
u
.
HighPart
;
}
if
(
lpKernelTime
)
{
lpKernelTime
->
dwLowDateTime
=
kernel_time
.
u
.
LowPart
;
lpKernelTime
->
dwHighDateTime
=
kernel_time
.
u
.
HighPart
;
}
if
(
lpUserTime
)
{
lpUserTime
->
dwLowDateTime
=
user_time
.
u
.
LowPart
;
lpUserTime
->
dwHighDateTime
=
user_time
.
u
.
HighPart
;
}
HeapFree
(
GetProcessHeap
(),
0
,
sppi
);
return
TRUE
;
}
/******************************************************************************
* GetTickCount64 (KERNEL32.@)
*/
...
...
dlls/kernelbase/kernelbase.spec
View file @
79e3c21c
...
...
@@ -698,7 +698,7 @@
@ stdcall GetSystemTimeAdjustment(ptr ptr ptr) kernel32.GetSystemTimeAdjustment
@ stdcall GetSystemTimeAsFileTime(ptr)
@ stdcall GetSystemTimePreciseAsFileTime(ptr)
@ stdcall GetSystemTimes(ptr ptr ptr)
kernel32.GetSystemTimes
@ stdcall GetSystemTimes(ptr ptr ptr)
@ stdcall GetSystemWindowsDirectoryA(ptr long)
@ stdcall GetSystemWindowsDirectoryW(ptr long)
@ stdcall GetSystemWow64Directory2A(ptr long long)
...
...
dlls/kernelbase/sync.c
View file @
79e3c21c
...
...
@@ -124,10 +124,60 @@ static BOOL get_open_object_attributes( OBJECT_ATTRIBUTES *attr, UNICODE_STRING
/***********************************************************************
*
Wait
s
*
Time function
s
***********************************************************************/
/*********************************************************************
* GetSystemTimes (kernelbase.@)
*/
BOOL
WINAPI
DECLSPEC_HOTPATCH
GetSystemTimes
(
FILETIME
*
idle
,
FILETIME
*
kernel
,
FILETIME
*
user
)
{
LARGE_INTEGER
idle_time
,
kernel_time
,
user_time
;
SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
*
info
;
ULONG
ret_size
;
DWORD
i
,
cpus
=
NtCurrentTeb
()
->
Peb
->
NumberOfProcessors
;
if
(
!
(
info
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
info
)
*
cpus
)))
{
SetLastError
(
ERROR_OUTOFMEMORY
);
return
FALSE
;
}
if
(
!
set_ntstatus
(
NtQuerySystemInformation
(
SystemProcessorPerformanceInformation
,
info
,
sizeof
(
*
info
)
*
cpus
,
&
ret_size
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
info
);
return
FALSE
;
}
idle_time
.
QuadPart
=
0
;
kernel_time
.
QuadPart
=
0
;
user_time
.
QuadPart
=
0
;
for
(
i
=
0
;
i
<
cpus
;
i
++
)
{
idle_time
.
QuadPart
+=
info
[
i
].
IdleTime
.
QuadPart
;
kernel_time
.
QuadPart
+=
info
[
i
].
KernelTime
.
QuadPart
;
user_time
.
QuadPart
+=
info
[
i
].
UserTime
.
QuadPart
;
}
if
(
idle
)
{
idle
->
dwLowDateTime
=
idle_time
.
u
.
LowPart
;
idle
->
dwHighDateTime
=
idle_time
.
u
.
HighPart
;
}
if
(
kernel
)
{
kernel
->
dwLowDateTime
=
kernel_time
.
u
.
LowPart
;
kernel
->
dwHighDateTime
=
kernel_time
.
u
.
HighPart
;
}
if
(
user
)
{
user
->
dwLowDateTime
=
user_time
.
u
.
LowPart
;
user
->
dwHighDateTime
=
user_time
.
u
.
HighPart
;
}
HeapFree
(
GetProcessHeap
(),
0
,
info
);
return
TRUE
;
}
/******************************************************************************
* GetTickCount (kernelbase.@)
*/
...
...
@@ -156,6 +206,11 @@ ULONGLONG WINAPI DECLSPEC_HOTPATCH GetTickCount64(void)
}
/***********************************************************************
* Waits
***********************************************************************/
static
HANDLE
normalize_handle_if_console
(
HANDLE
handle
)
{
static
HANDLE
wait_event
;
...
...
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