mirror of
https://github.com/reactos/reactos.git
synced 2026-06-03 09:51:03 +08:00
[DXDIAG] Remove a "redundant" GetTimeZoneInformation() call.
Indeed, the next SystemTimeToTzSpecificLocalTime() call, when done with a NULL TIME_ZONE_INFORMATION* 1st parameter, uses the currently active time zone, which is exactly what the GetTimeZoneInformation() call was doing. And note that the original code was incorrectly validating the returned value from GetTimeZoneInformation() -- the code was assuming the function returns a boolean, instead of checking for TIME_ZONE_ID_INVALID.
This commit is contained in:
@@ -18,7 +18,6 @@ GetFileModifyTime(LPCWSTR pFullPath, WCHAR * szTime, int szTimeSize)
|
||||
FILETIME AccessTime;
|
||||
SYSTEMTIME SysTime, LocalTime;
|
||||
UINT Length;
|
||||
TIME_ZONE_INFORMATION TimeInfo;
|
||||
|
||||
hFile = CreateFileW(pFullPath, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
|
||||
if (!hFile)
|
||||
@@ -31,13 +30,10 @@ GetFileModifyTime(LPCWSTR pFullPath, WCHAR * szTime, int szTimeSize)
|
||||
}
|
||||
CloseHandle(hFile);
|
||||
|
||||
if(!GetTimeZoneInformation(&TimeInfo))
|
||||
return FALSE;
|
||||
|
||||
if (!FileTimeToSystemTime(&AccessTime, &SysTime))
|
||||
return FALSE;
|
||||
|
||||
if (!SystemTimeToTzSpecificLocalTime(&TimeInfo, &SysTime, &LocalTime))
|
||||
if (!SystemTimeToTzSpecificLocalTime(NULL, &SysTime, &LocalTime))
|
||||
return FALSE;
|
||||
|
||||
Length = GetDateFormatW(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &LocalTime, NULL, szTime, szTimeSize);
|
||||
|
||||
Reference in New Issue
Block a user