[FASTFAT] When overwriting a file, also update its write time

This commit is contained in:
Pierre Schweitzer 2018-01-07 11:34:41 +01:00
parent 0eacb0b1ef
commit ffeb3f070b
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B

View file

@ -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));
}