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
9fbfcbe1
Commit
9fbfcbe1
authored
May 15, 2019
by
Huw Davies
Committed by
Alexandre Julliard
May 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Replace macros with inline helpers.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0f9e4cd6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
15 deletions
+20
-15
time.c
dlls/kernel32/time.c
+20
-15
No files found.
dlls/kernel32/time.c
View file @
9fbfcbe1
...
...
@@ -53,11 +53,16 @@ WINE_DEFAULT_DEBUG_CHANNEL(time);
#define CALINFO_MAX_YEAR 2029
#define LL2FILETIME( ll, pft )\
(pft)->dwLowDateTime = (UINT)(ll); \
(pft)->dwHighDateTime = (UINT)((ll) >> 32);
#define FILETIME2LL( pft, ll) \
ll = (((LONGLONG)((pft)->dwHighDateTime))<<32) + (pft)-> dwLowDateTime ;
static
inline
void
longlong_to_filetime
(
LONGLONG
t
,
FILETIME
*
ft
)
{
ft
->
dwLowDateTime
=
(
DWORD
)
t
;
ft
->
dwHighDateTime
=
(
DWORD
)(
t
>>
32
);
}
static
inline
LONGLONG
filetime_to_longlong
(
const
FILETIME
*
ft
)
{
return
(((
LONGLONG
)
ft
->
dwHighDateTime
)
<<
32
)
+
ft
->
dwLowDateTime
;
}
static
const
WCHAR
mui_stdW
[]
=
{
'M'
,
'U'
,
'I'
,
'_'
,
'S'
,
't'
,
'd'
,
0
};
static
const
WCHAR
mui_dltW
[]
=
{
'M'
,
'U'
,
'I'
,
'_'
,
'D'
,
'l'
,
't'
,
0
};
...
...
@@ -177,9 +182,9 @@ static DWORD TIME_CompTimeZoneID ( const TIME_ZONE_INFORMATION *pTZinfo,
}
if
(
!
islocal
)
{
FILETIME2LL
(
lpFileTime
,
ll
Time
);
llTime
=
filetime_to_longlong
(
lpFile
Time
);
llTime
-=
pTZinfo
->
Bias
*
(
LONGLONG
)
600000000
;
LL2FILETIME
(
llTime
,
&
ftTemp
)
longlong_to_filetime
(
llTime
,
&
ftTemp
);
lpFileTime
=
&
ftTemp
;
}
...
...
@@ -188,7 +193,7 @@ static DWORD TIME_CompTimeZoneID ( const TIME_ZONE_INFORMATION *pTZinfo,
if
(
!
islocal
)
{
llTime
-=
pTZinfo
->
DaylightBias
*
(
LONGLONG
)
600000000
;
LL2FILETIME
(
llTime
,
&
ftTemp
)
longlong_to_filetime
(
llTime
,
&
ftTemp
);
FileTimeToSystemTime
(
lpFileTime
,
&
SysTime
);
}
...
...
@@ -205,7 +210,7 @@ static DWORD TIME_CompTimeZoneID ( const TIME_ZONE_INFORMATION *pTZinfo,
if
(
!
islocal
)
{
llTime
-=
(
pTZinfo
->
StandardBias
-
pTZinfo
->
DaylightBias
)
*
(
LONGLONG
)
600000000
;
LL2FILETIME
(
llTime
,
&
ftTemp
)
longlong_to_filetime
(
llTime
,
&
ftTemp
);
FileTimeToSystemTime
(
lpFileTime
,
&
SysTime
);
}
...
...
@@ -694,12 +699,12 @@ BOOL WINAPI SystemTimeToTzSpecificLocalTime(
if
(
!
SystemTimeToFileTime
(
lpUniversalTime
,
&
ft
))
return
FALSE
;
FILETIME2LL
(
&
ft
,
llTime
)
llTime
=
filetime_to_longlong
(
&
ft
);
if
(
!
TIME_GetTimezoneBias
(
&
tzinfo
,
&
ft
,
FALSE
,
&
lBias
))
return
FALSE
;
/* convert minutes to 100-nanoseconds-ticks */
llTime
-=
(
LONGLONG
)
lBias
*
600000000
;
LL2FILETIME
(
llTime
,
&
ft
)
longlong_to_filetime
(
llTime
,
&
ft
);
return
FileTimeToSystemTime
(
&
ft
,
lpLocalTime
);
}
...
...
@@ -739,12 +744,12 @@ BOOL WINAPI TzSpecificLocalTimeToSystemTime(
if
(
!
SystemTimeToFileTime
(
lpLocalTime
,
&
ft
))
return
FALSE
;
FILETIME2LL
(
&
ft
,
t
)
t
=
filetime_to_longlong
(
&
ft
);
if
(
!
TIME_GetTimezoneBias
(
&
tzinfo
,
&
ft
,
TRUE
,
&
lBias
))
return
FALSE
;
/* convert minutes to 100-nanoseconds-ticks */
t
+=
(
LONGLONG
)
lBias
*
600000000
;
LL2FILETIME
(
t
,
&
ft
)
longlong_to_filetime
(
t
,
&
ft
);
return
FileTimeToSystemTime
(
&
ft
,
lpUniversalTime
);
}
...
...
@@ -884,8 +889,8 @@ BOOL WINAPI GetProcessTimes( HANDLE hprocess, LPFILETIME lpCreationTime,
TIME_ClockTimeToFileTime
(
tms
.
tms_stime
,
lpKernelTime
);
if
(
NtQueryInformationProcess
(
hprocess
,
ProcessTimes
,
&
pti
,
sizeof
(
pti
),
NULL
))
return
FALSE
;
LL2FILETIME
(
pti
.
CreateTime
.
QuadPart
,
lpCreationTime
);
LL2FILETIME
(
pti
.
ExitTime
.
QuadPart
,
lpExitTime
);
longlong_to_filetime
(
pti
.
CreateTime
.
QuadPart
,
lpCreationTime
);
longlong_to_filetime
(
pti
.
ExitTime
.
QuadPart
,
lpExitTime
);
return
TRUE
;
}
...
...
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