mirror of
https://github.com/reactos/reactos.git
synced 2025-02-21 16:04:57 +00: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:
parent
8a0e45031e
commit
df9c3de5ba
1 changed files with 1 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue