https://git.reactos.org/?p=reactos.git;a=commitdiff;h=df9c3de5ba8e62e867ec0c89cbea84f98fefbae9

commit df9c3de5ba8e62e867ec0c89cbea84f98fefbae9
Author:     Hermès Bélusca-Maïto <[email protected]>
AuthorDate: Sat Sep 2 21:44:21 2023 +0200
Commit:     Hermès Bélusca-Maïto <[email protected]>
CommitDate: Sat Sep 2 21:53:08 2023 +0200

    [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.
---
 base/applications/dxdiag/display.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/base/applications/dxdiag/display.c 
b/base/applications/dxdiag/display.c
index eae055589f4..14228720d23 100644
--- a/base/applications/dxdiag/display.c
+++ b/base/applications/dxdiag/display.c
@@ -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);

Reply via email to