Hi,
I checked in a fix for these problems. I hope it is is
correct. I tested
it by setting the timezone to GMT (i.e. no dayling saving).
The patch is the following:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Index: icall.c
===================================================================
RCS file: /cvs/public/mono/mono/metadata/icall.c,v
retrieving revision 1.339
diff -u -3 -p -r1.339 icall.c
--- icall.c 26 Sep 2003 16:25:40 -0000 1.339
+++ icall.c 5 Oct 2003 15:08:17 -0000
@@ -3121,9 +3121,11 @@ ves_icall_System_CurrentTimeZone_GetTime
TIME_ZONE_INFORMATION tz_info;
FILETIME ft;
int i;
- int err;
+ int err, tz_id;
- GetTimeZoneInformation (&tz_info);
+ tz_id = GetTimeZoneInformation (&tz_info);
+ if (tz_id == TIME_ZONE_ID_INVALID)
+ return 0;
MONO_CHECK_ARG_NULL (data);
MONO_CHECK_ARG_NULL (names);
@@ -3139,6 +3141,19 @@ ves_icall_System_CurrentTimeZone_GetTime
if (!tz_info.StandardName [i])
break;
mono_array_set ((*names), gpointer, 0,
mono_string_new_utf16 (domain, tz_info.StandardName, i));
+
+ if ((year <= 1601) || (year > 30827)) {
+ /*
+ * According to MSDN, the MS time functions can't handle
dates outside
+ * this interval.
+ */
+ return 1;
+ }
+
+ if (tz_id == TIME_ZONE_ID_UNKNOWN) {
+ /* No daylight saving in this time zone */
+ return 1;
+ }
tz_info.StandardDate.wYear = year;
err = SystemTimeToFileTime (&tz_info.StandardDate, &ft);
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Could somebody who is actually seeing this problem test it
and see
if it fixes the problem? If it is, then we can make a new
windows release
with only this patch.
bye
Zoltan
Atsushi Eno <[EMAIL PROTECTED]> írta:
> Hello,
>
> After applying attached patch, this problem looks gone away.
> But I don't know it might break this method.
>
> Atsushi Eno
>
>
_______________________________________________
Mono-list maillist - [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list