Fix for GetFileTime API - Incorrect Modified/Last access Time.

Krishna Murthy Krishna.Murthy at
Wed Apr 21 14:28:56 CDT 2004

- Short Description:
GetFileTime API returns incorrect Modified/Last access time.
- Long Description:
GetFileTime API returns modified & last access time for pre 1970 date time.
Set the file modified time as pre-1970 using SetFileTime() and retrieve the
same using GetFileTime(). Returned value will not be same as the earlier

Pre-1970 date/time is calculated in terms of negative value and it got lost
while passing to function RtlSecondsSince1970ToTime() which accepts DWORD
(unsigned long). Value got lost when negative value is assigned to a
unsigned data type. This causes to calculate a wrong date time.

Proposed fix is to change the argument type DWORD to LONGLONG of function
RtlSecondsSince1970ToTime() to accept negative values.

- Patch:

- Changelog Entry:
Change of argument type DWORD to LONGLONG of function
RtlSecondsSince1970ToTime() and RtlSecondsSince1980ToTime() to accept
negative values.

Krishna Murthy
Gupta Technologies LLC       
TEL: (650) 596-4828
E-mail: Krishna.Murthy at
<mailto:Krishna.Murthy at>  

-------------- next part --------------
A non-text attachment was scrubbed...
Name: GetFileTime-patch.diff
Type: application/octet-stream
Size: 1951 bytes
Desc: not available
Url :

More information about the wine-patches mailing list