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
dd9eacff
Commit
dd9eacff
authored
Sep 03, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Sep 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Fill the TimeZoneBias member of KSHARED_USER_DATA.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
09dd8012
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
time.c
dlls/ntdll/tests/time.c
+8
-0
fd.c
server/fd.c
+20
-0
No files found.
dlls/ntdll/tests/time.c
View file @
dd9eacff
...
@@ -410,7 +410,9 @@ static ULONGLONG read_ksystem_time(volatile KSYSTEM_TIME *time)
...
@@ -410,7 +410,9 @@ static ULONGLONG read_ksystem_time(volatile KSYSTEM_TIME *time)
static
void
test_user_shared_data_time
(
void
)
static
void
test_user_shared_data_time
(
void
)
{
{
KSHARED_USER_DATA
*
user_shared_data
=
(
void
*
)
0x7ffe0000
;
KSHARED_USER_DATA
*
user_shared_data
=
(
void
*
)
0x7ffe0000
;
SYSTEM_TIMEOFDAY_INFORMATION
timeofday
;
ULONGLONG
t1
,
t2
,
t3
;
ULONGLONG
t1
,
t2
,
t3
;
NTSTATUS
status
;
int
i
=
0
;
int
i
=
0
;
i
=
0
;
i
=
0
;
...
@@ -464,6 +466,12 @@ static void test_user_shared_data_time(void)
...
@@ -464,6 +466,12 @@ static void test_user_shared_data_time(void)
ok
(
t2
<=
t3
,
"USD InterruptTime / RtlQueryUnbiasedInterruptTime are out of order %s %s
\n
"
,
ok
(
t2
<=
t3
,
"USD InterruptTime / RtlQueryUnbiasedInterruptTime are out of order %s %s
\n
"
,
wine_dbgstr_longlong
(
t2
),
wine_dbgstr_longlong
(
t3
));
wine_dbgstr_longlong
(
t2
),
wine_dbgstr_longlong
(
t3
));
}
}
t1
=
read_ksystem_time
(
&
user_shared_data
->
TimeZoneBias
);
status
=
NtQuerySystemInformation
(
SystemTimeOfDayInformation
,
&
timeofday
,
sizeof
(
timeofday
),
NULL
);
ok
(
!
status
,
"failed to query time of day, status %#x
\n
"
,
status
);
ok
(
timeofday
.
TimeZoneBias
.
QuadPart
==
t1
,
"got USD bias %I64u, ntdll bias %I64u
\n
"
,
t1
,
timeofday
.
TimeZoneBias
.
QuadPart
);
}
}
START_TEST
(
time
)
START_TEST
(
time
)
...
...
server/fd.c
View file @
dd9eacff
...
@@ -410,6 +410,26 @@ static void atomic_store_long(volatile LONG *ptr, LONG value)
...
@@ -410,6 +410,26 @@ static void atomic_store_long(volatile LONG *ptr, LONG value)
static
void
set_user_shared_data_time
(
void
)
static
void
set_user_shared_data_time
(
void
)
{
{
timeout_t
tick_count
=
monotonic_time
/
10000
;
timeout_t
tick_count
=
monotonic_time
/
10000
;
static
timeout_t
last_timezone_update
;
timeout_t
timezone_bias
;
struct
tm
*
tm
;
time_t
now
;
if
(
monotonic_time
-
last_timezone_update
>
TICKS_PER_SEC
)
{
now
=
time
(
NULL
);
tm
=
gmtime
(
&
now
);
timezone_bias
=
mktime
(
tm
)
-
now
;
tm
=
localtime
(
&
now
);
if
(
tm
->
tm_isdst
)
timezone_bias
-=
3600
;
timezone_bias
*=
TICKS_PER_SEC
;
atomic_store_long
(
&
user_shared_data
->
TimeZoneBias
.
High2Time
,
timezone_bias
>>
32
);
atomic_store_ulong
(
&
user_shared_data
->
TimeZoneBias
.
LowPart
,
timezone_bias
);
atomic_store_long
(
&
user_shared_data
->
TimeZoneBias
.
High1Time
,
timezone_bias
>>
32
);
last_timezone_update
=
monotonic_time
;
}
atomic_store_long
(
&
user_shared_data
->
SystemTime
.
High2Time
,
current_time
>>
32
);
atomic_store_long
(
&
user_shared_data
->
SystemTime
.
High2Time
,
current_time
>>
32
);
atomic_store_ulong
(
&
user_shared_data
->
SystemTime
.
LowPart
,
current_time
);
atomic_store_ulong
(
&
user_shared_data
->
SystemTime
.
LowPart
,
current_time
);
...
...
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