mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 21:23:05 +00:00
[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. svn path=/trunk/; revision=59022
This commit is contained in:
parent
90810f42a4
commit
a6b8f0a353
1 changed files with 6 additions and 4 deletions
|
@ -426,6 +426,7 @@ VfatCreateFile ( PDEVICE_OBJECT DeviceObject, PIRP Irp )
|
||||||
BOOLEAN Dots;
|
BOOLEAN Dots;
|
||||||
UNICODE_STRING FileNameU;
|
UNICODE_STRING FileNameU;
|
||||||
UNICODE_STRING PathNameU;
|
UNICODE_STRING PathNameU;
|
||||||
|
ULONG Attributes;
|
||||||
|
|
||||||
/* Unpack the various parameters. */
|
/* Unpack the various parameters. */
|
||||||
Stack = IoGetCurrentIrpStackLocation (Irp);
|
Stack = IoGetCurrentIrpStackLocation (Irp);
|
||||||
|
@ -436,6 +437,9 @@ VfatCreateFile ( PDEVICE_OBJECT DeviceObject, PIRP Irp )
|
||||||
FileObject = Stack->FileObject;
|
FileObject = Stack->FileObject;
|
||||||
DeviceExt = DeviceObject->DeviceExtension;
|
DeviceExt = DeviceObject->DeviceExtension;
|
||||||
|
|
||||||
|
Attributes = Stack->Parameters.Create.FileAttributes;
|
||||||
|
Attributes &= (FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_ARCHIVE);
|
||||||
|
|
||||||
/* Check their validity. */
|
/* Check their validity. */
|
||||||
if (RequestedOptions & FILE_DIRECTORY_FILE &&
|
if (RequestedOptions & FILE_DIRECTORY_FILE &&
|
||||||
RequestedDisposition == FILE_SUPERSEDE)
|
RequestedDisposition == FILE_SUPERSEDE)
|
||||||
|
@ -544,10 +548,6 @@ VfatCreateFile ( PDEVICE_OBJECT DeviceObject, PIRP Irp )
|
||||||
RequestedDisposition == FILE_OVERWRITE_IF ||
|
RequestedDisposition == FILE_OVERWRITE_IF ||
|
||||||
RequestedDisposition == FILE_SUPERSEDE)
|
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);
|
vfatSplitPathName(&PathNameU, NULL, &FileNameU);
|
||||||
Status = VfatAddEntry (DeviceExt, &FileNameU, &pFcb, ParentFcb, RequestedOptions,
|
Status = VfatAddEntry (DeviceExt, &FileNameU, &pFcb, ParentFcb, RequestedOptions,
|
||||||
(UCHAR)(Attributes | FILE_ATTRIBUTE_ARCHIVE));
|
(UCHAR)(Attributes | FILE_ATTRIBUTE_ARCHIVE));
|
||||||
|
@ -690,6 +690,8 @@ VfatCreateFile ( PDEVICE_OBJECT DeviceObject, PIRP Irp )
|
||||||
RequestedDisposition == FILE_SUPERSEDE)
|
RequestedDisposition == FILE_SUPERSEDE)
|
||||||
{
|
{
|
||||||
ExAcquireResourceExclusiveLite(&(pFcb->MainResource), TRUE);
|
ExAcquireResourceExclusiveLite(&(pFcb->MainResource), TRUE);
|
||||||
|
*pFcb->Attributes = Attributes | FILE_ATTRIBUTE_ARCHIVE;
|
||||||
|
|
||||||
Status = VfatSetAllocationSizeInformation (FileObject,
|
Status = VfatSetAllocationSizeInformation (FileObject,
|
||||||
pFcb,
|
pFcb,
|
||||||
DeviceExt,
|
DeviceExt,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue