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

commit ffeb3f070bdb5a2c1556e9fe463603758b47906a
Author: Pierre Schweitzer <[email protected]>
AuthorDate: Sun Jan 7 11:34:41 2018 +0100

    [FASTFAT] When overwriting a file, also update its write time
---
 drivers/filesystems/fastfat/create.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/filesystems/fastfat/create.c 
b/drivers/filesystems/fastfat/create.c
index f1b9b37325..b9acc7f1c3 100644
--- a/drivers/filesystems/fastfat/create.c
+++ b/drivers/filesystems/fastfat/create.c
@@ -923,6 +923,8 @@ VfatCreateFile(
 
             if (!vfatFCBIsDirectory(pFcb))
             {
+                LARGE_INTEGER SystemTime;
+
                 if (RequestedDisposition == FILE_SUPERSEDE)
                 {
                     *pFcb->Attributes = Attributes;
@@ -932,6 +934,21 @@ VfatCreateFile(
                     *pFcb->Attributes |= Attributes;
                 }
                 *pFcb->Attributes |= FILE_ATTRIBUTE_ARCHIVE;
+
+                KeQuerySystemTime(&SystemTime);
+                if (vfatVolumeIsFatX(DeviceExt))
+                {
+                    FsdSystemTimeToDosDateTime(DeviceExt,
+                                               &SystemTime, 
&pFcb->entry.FatX.UpdateDate,
+                                               &pFcb->entry.FatX.UpdateTime);
+                }
+                else
+                {
+                    FsdSystemTimeToDosDateTime(DeviceExt,
+                                               &SystemTime, 
&pFcb->entry.Fat.UpdateDate,
+                                               &pFcb->entry.Fat.UpdateTime);
+                }
+
                 VfatUpdateEntry(pFcb, vfatVolumeIsFatX(DeviceExt));
             }
 

Reply via email to