[Mono-list] Mono 0.28 - Still fails under windows 2000 P

Varga Zoltan vargaz@freemail.hu
Sun, 5 Oct 2003 16:59:01 +0200 (CEST)


                                                 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).=20

The patch is the following:

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Index: icall.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/mono/mono/metadata/icall.c,v
retrieving revision 1.339
diff -u -3 -p -r1.339 icall.c
--- icall.c=0926 Sep 2003 16:25:40 -0000=091.339
+++ icall.c=095 Oct 2003 15:08:17 -0000
@@ -3121,9 +3121,11 @@ ves_icall_System_CurrentTimeZone_GetTime
 =09TIME_ZONE_INFORMATION tz_info;
 =09FILETIME ft;
 =09int i;
-=09int err;
+=09int err, tz_id;
 =09
-=09GetTimeZoneInformation (&tz_info);
+=09tz_id =3D GetTimeZoneInformation (&tz_info);
+=09if (tz_id =3D=3D TIME_ZONE_ID_INVALID)
+=09=09return 0;
=20
 =09MONO_CHECK_ARG_NULL (data);
 =09MONO_CHECK_ARG_NULL (names);
@@ -3139,6 +3141,19 @@ ves_icall_System_CurrentTimeZone_GetTime
 =09=09if (!tz_info.StandardName [i])
 =09=09=09break;
 =09mono_array_set ((*names), gpointer, 0,
mono_string_new_utf16 (domain, tz_info.StandardName, i));
+
+=09if ((year <=3D 1601) || (year > 30827)) {
+=09=09/*
+=09=09 * According to MSDN, the MS time functions can't handle
dates outside
+=09=09 * this interval.
+=09=09 */
+=09=09return 1;
+=09}
+
+=09if (tz_id =3D=3D TIME_ZONE_ID_UNKNOWN) {
+=09=09/* No daylight saving in this time zone */
+=09=09return 1;
+=09}
=20
 =09tz_info.StandardDate.wYear =3D year;
 =09err =3D 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 <ginga@kit.hi-ho.ne.jp> =EDrta:

> Hello,
>=20
> After applying attached patch, this problem looks gone away.
> But I don't know it might break this method.
>=20
> Atsushi Eno
>=20
>=20