/* fhandler.h
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008, 2009 Red Hat, Inc.
+ 2005, 2006, 2007, 2008, 2009, 2010 Red Hat, Inc.
This file is part of Cygwin.
virtual int __stdcall fstat (struct __stat64 *buf) __attribute__ ((regparm (2)));
int __stdcall fstat_fs (struct __stat64 *buf) __attribute__ ((regparm (2)));
int __stdcall fstat_helper (struct __stat64 *buf,
- FILETIME ftChangeTime,
- FILETIME ftLastAccessTime,
- FILETIME ftLastWriteTime,
- FILETIME ftCreationTime,
+ PLARGE_INTEGER ChangeTime,
+ PLARGE_INTEGER LastAccessTime,
+ PLARGE_INTEGER LastWriteTime,
+ PLARGE_INTEGER CreationTime,
DWORD dwVolumeSerialNumber,
ULONGLONG nFileSize,
LONGLONG nAllocSize,
/* fhandler_disk_file.cc
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008, 2009 Red Hat, Inc.
+ 2005, 2006, 2007, 2008, 2009, 2010 Red Hat, Inc.
This file is part of Cygwin.
fbi.FileAttributes &= ~FILE_ATTRIBUTE_DIRECTORY;
pc.file_attributes (fbi.FileAttributes);
return fstat_helper (buf,
- fbi.ChangeTime.QuadPart
- ? *(FILETIME *) (void *) &fbi.ChangeTime
- : *(FILETIME *) (void *) &fbi.LastWriteTime,
- *(FILETIME *) (void *) &fbi.LastAccessTime,
- *(FILETIME *) (void *) &fbi.LastWriteTime,
- *(FILETIME *) (void *) &fbi.CreationTime,
+ fbi.ChangeTime.QuadPart ? &fbi.ChangeTime
+ : &fbi.LastWriteTime,
+ &fbi.LastAccessTime,
+ &fbi.LastWriteTime,
+ &fbi.CreationTime,
get_dev (),
fsi.EndOfFile.QuadPart,
fsi.AllocationSize.QuadPart,
fdi_buf.fdi.FileAttributes &= ~FILE_ATTRIBUTE_DIRECTORY;
pc.file_attributes (fdi_buf.fdi.FileAttributes);
return fstat_helper (buf,
- fdi_buf.fdi.ChangeTime.QuadPart ?
- *(FILETIME *) (void *) &fdi_buf.fdi.ChangeTime :
- *(FILETIME *) (void *) &fdi_buf.fdi.LastWriteTime,
- *(FILETIME *) (void *) &fdi_buf.fdi.LastAccessTime,
- *(FILETIME *) (void *) &fdi_buf.fdi.LastWriteTime,
- *(FILETIME *) (void *) &fdi_buf.fdi.CreationTime,
+ fdi_buf.fdi.ChangeTime.QuadPart
+ ? &fdi_buf.fdi.ChangeTime : &fdi_buf.fdi.LastWriteTime,
+ &fdi_buf.fdi.LastAccessTime,
+ &fdi_buf.fdi.LastWriteTime,
+ &fdi_buf.fdi.CreationTime,
pc.fs_serial_number (),
fdi_buf.fdi.EndOfFile.QuadPart,
fdi_buf.fdi.AllocationSize.QuadPart,
/* Arbitrary value: 2006-12-01 */
RtlSecondsSince1970ToTime (1164931200L, &ft);
return fstat_helper (buf,
- *(FILETIME *) (void *) &ft,
- *(FILETIME *) (void *) &ft,
- *(FILETIME *) (void *) &ft,
- *(FILETIME *) (void *) &ft,
+ &ft,
+ &ft,
+ &ft,
+ &ft,
0,
0ULL,
-1LL,
return res;
}
-/* The ftChangeTime is taken from the NTFS ChangeTime entry, if reading
+/* The ChangeTime is taken from the NTFS ChangeTime entry, if reading
the file information using NtQueryInformationFile succeeded. If not,
it's faked using the LastWriteTime entry from GetFileInformationByHandle
or FindFirstFile. We're deliberatly not using the creation time anymore
the latter might be old and not reflect the actual state of the file. */
int __stdcall
fhandler_base::fstat_helper (struct __stat64 *buf,
- FILETIME ftChangeTime,
- FILETIME ftLastAccessTime,
- FILETIME ftLastWriteTime,
- FILETIME ftCreationTime,
+ PLARGE_INTEGER ChangeTime,
+ PLARGE_INTEGER LastAccessTime,
+ PLARGE_INTEGER LastWriteTime,
+ PLARGE_INTEGER CreationTime,
DWORD dwVolumeSerialNumber,
ULONGLONG nFileSize,
LONGLONG nAllocSize,
IO_STATUS_BLOCK st;
FILE_COMPRESSION_INFORMATION fci;
- to_timestruc_t (&ftLastAccessTime, &buf->st_atim);
- to_timestruc_t (&ftLastWriteTime, &buf->st_mtim);
- to_timestruc_t (&ftChangeTime, &buf->st_ctim);
- to_timestruc_t (&ftCreationTime, &buf->st_birthtim);
+ to_timestruc_t ((PFILETIME) LastAccessTime, &buf->st_atim);
+ to_timestruc_t ((PFILETIME) LastWriteTime, &buf->st_mtim);
+ to_timestruc_t ((PFILETIME) ChangeTime, &buf->st_ctim);
+ to_timestruc_t ((PFILETIME) CreationTime, &buf->st_birthtim);
buf->st_dev = dwVolumeSerialNumber;
buf->st_size = (_off64_t) nFileSize;
/* The number of links to a directory includes the