Browse Source

* Patch from Serge Anvarov to use local time for keyinfo (bug ID 35100)

git-svn-id: trunk@41855 -
michael 6 years ago
parent
commit
61cd2e219d
1 changed files with 3 additions and 2 deletions
  1. 3 2
      packages/fcl-registry/src/winreg.inc

+ 3 - 2
packages/fcl-registry/src/winreg.inc

@@ -148,6 +148,7 @@ function TRegistry.GetKeyInfo(out Value: TRegKeyInfo): Boolean;
 var
   winFileTime: Windows.FILETIME;
   sysTime: TSystemTime;
+  LocalFileTime: Windows.FILETIME;
 begin
   FillChar(Value, SizeOf(Value), 0);
   With Value do
@@ -157,9 +158,9 @@ begin
               lpdword(@MaxDataLen),nil,@winFileTime);
     Result:=FLastError=ERROR_SUCCESS;          
     end;          
-  if Result then
+  if Result and FileTimeToLocalFileTime(@winFileTime, @LocalFileTime) and
+    FileTimeToSystemTime(@LocalFileTime, @sysTime) then
   begin
-    FileTimeToSystemTime(@winFileTime, @sysTime);
     Value.FileTime := SystemTimeToDateTime(sysTime);
   end;
 end;