From bce782c9719d30358a9fa5f31c9c025a0e918cd4 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Thu, 9 May 2013 15:03:51 +0000 Subject: [PATCH] [FASTFAT] Allow only readonly, hidden, system and archive files attributes to be set for a new file. Other file attributes must be ignored. This fixes several tests. svn path=/trunk/; revision=58976 --- reactos/drivers/filesystems/fastfat/create.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reactos/drivers/filesystems/fastfat/create.c b/reactos/drivers/filesystems/fastfat/create.c index d32eac3390e..36897d72678 100644 --- a/reactos/drivers/filesystems/fastfat/create.c +++ b/reactos/drivers/filesystems/fastfat/create.c @@ -545,11 +545,12 @@ VfatCreateFile ( PDEVICE_OBJECT DeviceObject, PIRP Irp ) RequestedDisposition == FILE_SUPERSEDE) { ULONG Attributes; - Attributes = Stack->Parameters.Create.FileAttributes & ~FILE_ATTRIBUTE_NORMAL; + Attributes = Stack->Parameters.Create.FileAttributes; + Attributes &= (FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_ARCHIVE); vfatSplitPathName(&PathNameU, NULL, &FileNameU); Status = VfatAddEntry (DeviceExt, &FileNameU, &pFcb, ParentFcb, RequestedOptions, - (UCHAR)(Attributes & FILE_ATTRIBUTE_VALID_FLAGS)); + (UCHAR)(Attributes | FILE_ATTRIBUTE_ARCHIVE)); vfatReleaseFCB (DeviceExt, ParentFcb); if (NT_SUCCESS (Status)) {