[PATCH 2/2] server: Fill the TimeZoneBias member of KSHARED_USER_DATA.
Zebediah Figura (she/her)
zfigura at codeweavers.com
Tue Aug 24 13:53:38 CDT 2021
On 8/24/21 1:03 PM, Alexandre Julliard wrote:
> Zebediah Figura <zfigura at codeweavers.com> writes:
>
>> @@ -410,6 +410,16 @@ static void atomic_store_long(volatile LONG *ptr, LONG value)
>> static void set_user_shared_data_time(void)
>> {
>> timeout_t tick_count = monotonic_time / 10000;
>> + timeout_t timezone_bias;
>> + struct tm *tm;
>> + time_t now;
>> +
>> + 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;
>
> Do we really want to do that on every request?
>
Presumably it can change whenever the user changes the time zone (or,
more realistically, if DST happens to flip over). I'm not aware of a
better way to detect that, and I didn't think we'd want to ignore
changes. I guess we could always cache it for some fixed length of time,
though it's not clear to me that's not a bad idea either.
More information about the wine-devel
mailing list