- LARGE_INTEGER LocalTime;
- LARGE_INTEGER SystemTime;
- TIME_FIELDS TimeFields;
-
- DPRINT("ExpSetTimeZoneInformation() called\n");
-
- DPRINT("Old time zone bias: %d minutes\n",
- ExpTimeZoneInfo.Bias);
- DPRINT("Old time zone standard bias: %d minutes\n",
- ExpTimeZoneInfo.StandardBias);
-
- DPRINT("New time zone bias: %d minutes\n",
- TimeZoneInformation->Bias);
- DPRINT("New time zone standard bias: %d minutes\n",
- TimeZoneInformation->StandardBias);
-
- /* Get the local time */
- HalQueryRealTimeClock(&TimeFields);
- RtlTimeFieldsToTime(&TimeFields,
- &LocalTime);
-
- /* FIXME: Calculate transition dates */
-
- ExpTimeZoneBias.QuadPart =
- ((LONGLONG)(TimeZoneInformation->Bias + TimeZoneInformation->StandardBias)) * TICKSPERMINUTE;
- ExpTimeZoneId = TIME_ZONE_ID_STANDARD;
-
- memcpy(&ExpTimeZoneInfo,
- TimeZoneInformation,
- sizeof(TIME_ZONE_INFORMATION));
-
- /* Set the new time zone information */
- SharedUserData->TimeZoneBias.High1Time = ExpTimeZoneBias.u.HighPart;
- SharedUserData->TimeZoneBias.High2Time = ExpTimeZoneBias.u.HighPart;
- SharedUserData->TimeZoneBias.LowPart = ExpTimeZoneBias.u.LowPart;
- SharedUserData->TimeZoneId = ExpTimeZoneId;
-
- DPRINT("New time zone bias: %I64d minutes\n",
- ExpTimeZoneBias.QuadPart / TICKSPERMINUTE);
-
- /* Calculate the new system time */
- ExLocalTimeToSystemTime(&LocalTime,
- &SystemTime);
-
- /* Set the new system time */
- KiSetSystemTime(&SystemTime);
-
- DPRINT("ExpSetTimeZoneInformation() done\n");
-
- return STATUS_SUCCESS;
+ LARGE_INTEGER LocalTime, SystemTime;
+ TIME_FIELDS TimeFields;
+ DPRINT("ExpSetTimeZoneInformation() called\n");
+
+ DPRINT("Old time zone bias: %d minutes\n", ExpTimeZoneInfo.Bias);
+ DPRINT("Old time zone standard bias: %d minutes\n",
+ ExpTimeZoneInfo.StandardBias);
+ DPRINT("New time zone bias: %d minutes\n", TimeZoneInformation->Bias);
+ DPRINT("New time zone standard bias: %d minutes\n",
+ TimeZoneInformation->StandardBias);
+
+ /* Get the local time */
+ HalQueryRealTimeClock(&TimeFields);
+ RtlTimeFieldsToTime(&TimeFields, &LocalTime);
+
+ /* FIXME: Calculate transition dates */
+
+ /* Calculate the bias and set the ID */
+ ExpTimeZoneBias.QuadPart = ((LONGLONG)(TimeZoneInformation->Bias +
+ TimeZoneInformation->StandardBias)) *
+ TICKSPERMINUTE;
+ ExpTimeZoneId = TIME_ZONE_ID_STANDARD;
+
+ /* Copy the timezone information */
+ RtlMoveMemory(&ExpTimeZoneInfo,
+ TimeZoneInformation,
+ sizeof(TIME_ZONE_INFORMATION));
+
+ /* Set the new time zone information */
+ SharedUserData->TimeZoneBias.High1Time = ExpTimeZoneBias.u.HighPart;
+ SharedUserData->TimeZoneBias.High2Time = ExpTimeZoneBias.u.HighPart;
+ SharedUserData->TimeZoneBias.LowPart = ExpTimeZoneBias.u.LowPart;
+ SharedUserData->TimeZoneId = ExpTimeZoneId;
+
+ DPRINT("New time zone bias: %I64d minutes\n",
+ ExpTimeZoneBias.QuadPart / TICKSPERMINUTE);
+
+ /* Calculate the new system time */
+ ExLocalTimeToSystemTime(&LocalTime, &SystemTime);
+
+ /* Set the new system time */
+ KiSetSystemTime(&SystemTime);
+
+ /* Return success */
+ DPRINT("ExpSetTimeZoneInformation() done\n");
+ return STATUS_SUCCESS;