The time function in the same code crashes on xp but runs fine on windows 2003 machine. Any ideas?
TIME_ZONE_INFORMATION tzi;
SYSTEMTIME stStartUTC;
SYSTEMTIME stStart;
LPCSTR lpszZone;
BOOL bStatus;
FILETIME* pFT;
DWORD dReturn;
pFT = new FILETIME;
if (pFT)
{
pFT->dwHighDateTime = 4294967295ul;
pFT->dwLowDateTime = 4294962295ul;
if (pFT)
{
FileTimeToSystemTime (pFT, &stStartUTC);
}
else
{
GetSystemTime (&stStartUTC);
}
dReturn = GetTimeZoneInformation (&tzi);
bStatus = SystemTimeToTzSpecificLocalTime (&tzi, &stStartUTC, &stStart);
}
Stack from the crash dump is :
0816e968 7c85a6f2 00000000 00000024 7c85a6f8 kernel32!__report_gsfailure+0xda
0816ebf8 7c85a788 0816ec10 0816ec70 0000a8f0 kernel32!FindRegTziForCurrentYear+0x1a5
0816ec3c 7c85a7bd 0816ec70 0000a8f0 0816eec4 kernel32!CheckDynamicTimeZoneInformation+0x29
0816ec54 7c85a834 0816ec70 0000a8f0 0816eec4 kernel32!GetDynamicTimeZoneInfoForTimeZone+0x17
0816ee7c 7c83b11c 0000a8f0 00000000 0816eec4 kernel32!GetTimeZoneInformationForYear+0x58
0816f020 14f27e38 0816f05c 0816f03c 0816f04c kernel32!SystemTimeToTzSpecificLocalTime+0x3c
Thanks, Mithuna