[FASTFAT] When overwriting a file with FILE_OVERWRITE*, don't erase previous file attributes, only update them.

Keep erasing them in case the file gets overwritten with FILE_SUPERSEDE.

CORE-14158
This commit is contained in:
Pierre Schweitzer 2018-01-01 14:29:15 +01:00
parent f3fecf92c1
commit 2b4d5c5cff
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B

View file

@ -919,7 +919,14 @@ VfatCreateFile(
if (!vfatFCBIsDirectory(pFcb))
{
*pFcb->Attributes = Attributes & ~FILE_ATTRIBUTE_NORMAL;
if (RequestedDisposition == FILE_SUPERSEDE)
{
*pFcb->Attributes = Attributes & ~FILE_ATTRIBUTE_NORMAL;
}
else
{
*pFcb->Attributes |= Attributes & ~FILE_ATTRIBUTE_NORMAL;
}
*pFcb->Attributes |= FILE_ATTRIBUTE_ARCHIVE;
VfatUpdateEntry(pFcb, vfatVolumeIsFatX(DeviceExt));
}