diff --git a/packages/fcl-registry/src/winreg.inc b/packages/fcl-registry/src/winreg.inc index 484841892e..ac03f9bd53 100644 --- a/packages/fcl-registry/src/winreg.inc +++ b/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;