Piotr Caban : msvcrt: Don't use GetDaylightFlag function in _ftime64.

Alexandre Julliard julliard at winehq.org
Tue Apr 12 13:38:03 CDT 2022


Module: wine
Branch: oldstable
Commit: 4c16e0f20b6fad1d4eb4a8572aa8d73a74908763
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=4c16e0f20b6fad1d4eb4a8572aa8d73a74908763

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Mon Nov  1 15:07:17 2021 +0100

msvcrt: Don't use GetDaylightFlag function in _ftime64.

The function is not available on current Windows releases.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51959
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 00824a94f02340c2725f494f04f7f1f8ca311033)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/msvcrt/time.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/dlls/msvcrt/time.c b/dlls/msvcrt/time.c
index 327d8e086e0..9abd1f5555b 100644
--- a/dlls/msvcrt/time.c
+++ b/dlls/msvcrt/time.c
@@ -44,8 +44,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
 #undef _time32
 #undef _wctime32
 
-BOOL WINAPI GetDaylightFlag(void);
-
 static LONGLONG init_time;
 
 void msvcrt_init_clock(void)
@@ -691,6 +689,7 @@ double CDECL _difftime32(__time32_t time1, __time32_t time2)
  */
 void CDECL _ftime64(struct __timeb64 *buf)
 {
+  TIME_ZONE_INFORMATION tzinfo;
   FILETIME ft;
   ULONGLONG time;
 
@@ -703,7 +702,7 @@ void CDECL _ftime64(struct __timeb64 *buf)
   buf->time = time / TICKSPERSEC - SECS_1601_TO_1970;
   buf->millitm = (time % TICKSPERSEC) / TICKSPERMSEC;
   buf->timezone = MSVCRT___timezone / 60;
-  buf->dstflag = GetDaylightFlag();
+  buf->dstflag = GetTimeZoneInformation( &tzinfo) == TIME_ZONE_ID_DAYLIGHT;
 }
 
 /*********************************************************************




More information about the wine-cvs mailing list