I tried setting my TimeZone setting to something else and the program compiled fine and run fine. I changed it from "(GMT+02:00) Harare, Pretoria" to "(GMT+02:00) Cairo" and everything works fine. This worked with "Automatically adjust clock for daylight savings changes" checked or not.
I then changed to "(GMT-07:00) Arizona" and the error came back. It seems that the Time Zones that do not have setting for "Automatically adjust clock for daylight savings changes" create the error. I cant test this patch as I am at work and do not have cygwin etc.. Setup here. I can test an executable for you if you want, but you might be able to recreate the problem if you change your TimeZone settings. Thanks for all your help Paul -----Original Message----- From: Varga Zoltan [mailto:[EMAIL PROTECTED] Sent: Sunday, October 05, 2003 16:59 To: Atsushi Eno Cc: Paul Paximadis; Mono-List Subject: Re: [Mono-list] Mono 0.28 - Still fails under windows 2000 P 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
