GetDaylightFlag implementation.

Rein Klazes rklazes at xs4all.nl
Mon Mar 1 10:18:38 CST 2004


Hi,

Fixing a unimplemented function crash in win98 timedate.cpl 

I'm not sure how "bad" it is not to forward this to a ntdll function,
but since I know nothing suitable it this is the best I can do.

Changelog:

	dlls/kernel	: kernel32.spec, time.c
	Implement GetDaylightFlag

Rein.
-- 
Rein Klazes
rklazes at xs4all.nl
-------------- next part --------------
--- wine/dlls/kernel/time.c	2004-02-26 12:05:38.000000000 +0100
+++ mywine/dlls/kernel/time.c	2004-03-01 16:46:01.000000000 +0100
@@ -155,6 +155,7 @@
  * RETURNS
  *  Success: TIME_ZONE_ID_STANDARD. tzinfo contains the time zone info.
  *  Failure: TIME_ZONE_ID_INVALID.
+ *  FIXME: return TIME_ZONE_ID_DAYLIGHT when daylight saving is on.
  */
 DWORD WINAPI GetTimeZoneInformation(
     LPTIME_ZONE_INFORMATION tzinfo) /* [out] Destination for time zone information */
@@ -871,3 +872,18 @@
     ft.dwHighDateTime = t.u.HighPart;
     FileTimeToSystemTime(&ft, systime);
 }
+
+/*********************************************************************
+ *      GetDaylightFlag                                   (KERNEL32.@)
+ *
+ *      returns TRUE if daylight saving time is in operation
+ *      
+ *      Note: this function is called from the Win98's control applet
+ *      timedate.cpl
+ */
+BOOL WINAPI GetDaylightFlag()
+{
+    time_t t = time(NULL);
+    struct tm *ptm = localtime( &t);
+    return ptm->tm_isdst > 0;
+}
--- wine/dlls/kernel/kernel32.spec	2004-02-29 08:53:20.000000000 +0100
+++ mywine/dlls/kernel/kernel32.spec	2004-02-29 15:29:33.000000000 +0100
@@ -381,7 +381,7 @@
 @ stdcall GetCurrentThreadId()
 @ stdcall GetDateFormatA(long long ptr str ptr long)
 @ stdcall GetDateFormatW(long long ptr wstr ptr long)
-@ stub GetDaylightFlag
+@ stdcall GetDaylightFlag()
 @ stdcall GetDefaultCommConfigA(str ptr long)
 @ stdcall GetDefaultCommConfigW(wstr ptr long)
 @ stub GetDefaultSortkeySize


More information about the wine-patches mailing list