Author: ekohl Date: Thu May 16 21:21:46 2013 New Revision: 59022 URL: http://svn.reactos.org/svn/reactos?rev=59022&view=rev Log: [FASTFAT] Allow only readonly, hidden, system and archive files attributes to be set for existing files. Other file attributes must be ignored. This fixes several tests.
Modified: trunk/reactos/drivers/filesystems/fastfat/create.c Modified: trunk/reactos/drivers/filesystems/fastfat/create.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfat/create.c?rev=59022&r1=59021&r2=59022&view=diff ============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/create.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/create.c [iso-8859-1] Thu May 16 21:21:46 2013 @@ -426,6 +426,7 @@ BOOLEAN Dots; UNICODE_STRING FileNameU; UNICODE_STRING PathNameU; + ULONG Attributes; /* Unpack the various parameters. */ Stack = IoGetCurrentIrpStackLocation (Irp); @@ -436,6 +437,9 @@ FileObject = Stack->FileObject; DeviceExt = DeviceObject->DeviceExtension; + Attributes = Stack->Parameters.Create.FileAttributes; + Attributes &= (FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_ARCHIVE); + /* Check their validity. */ if (RequestedOptions & FILE_DIRECTORY_FILE && RequestedDisposition == FILE_SUPERSEDE) @@ -544,10 +548,6 @@ RequestedDisposition == FILE_OVERWRITE_IF || RequestedDisposition == FILE_SUPERSEDE) { - ULONG Attributes; - 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_ARCHIVE)); @@ -690,6 +690,8 @@ RequestedDisposition == FILE_SUPERSEDE) { ExAcquireResourceExclusiveLite(&(pFcb->MainResource), TRUE); + *pFcb->Attributes = Attributes | FILE_ATTRIBUTE_ARCHIVE; + Status = VfatSetAllocationSizeInformation (FileObject, pFcb, DeviceExt,