mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 18:35:41 +00:00
[FASTFAT]
Fail, if we try to overwrite an eixting read-only file. svn path=/trunk/; revision=61260
This commit is contained in:
parent
02b443855b
commit
b637046c9d
1 changed files with 11 additions and 1 deletions
|
@ -349,6 +349,7 @@ VfatOpenFile(
|
||||||
PDEVICE_EXTENSION DeviceExt,
|
PDEVICE_EXTENSION DeviceExt,
|
||||||
PUNICODE_STRING PathNameU,
|
PUNICODE_STRING PathNameU,
|
||||||
PFILE_OBJECT FileObject,
|
PFILE_OBJECT FileObject,
|
||||||
|
ULONG RequestedDisposition,
|
||||||
PVFATFCB *ParentFcb)
|
PVFATFCB *ParentFcb)
|
||||||
{
|
{
|
||||||
PVFATFCB Fcb;
|
PVFATFCB Fcb;
|
||||||
|
@ -404,6 +405,15 @@ VfatOpenFile(
|
||||||
vfatReleaseFCB (DeviceExt, Fcb);
|
vfatReleaseFCB (DeviceExt, Fcb);
|
||||||
return STATUS_DELETE_PENDING;
|
return STATUS_DELETE_PENDING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Fail, if we try to overwrite a read-only file */
|
||||||
|
if ((*Fcb->Attributes & FILE_ATTRIBUTE_READONLY) &&
|
||||||
|
(RequestedDisposition == FILE_OVERWRITE))
|
||||||
|
{
|
||||||
|
vfatReleaseFCB(DeviceExt, Fcb);
|
||||||
|
return STATUS_ACCESS_DENIED;
|
||||||
|
}
|
||||||
|
|
||||||
DPRINT("Attaching FCB to fileObject\n");
|
DPRINT("Attaching FCB to fileObject\n");
|
||||||
Status = vfatAttachFCBToFileObject(DeviceExt, Fcb, FileObject);
|
Status = vfatAttachFCBToFileObject(DeviceExt, Fcb, FileObject);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
|
@ -519,7 +529,7 @@ VfatCreateFile(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Try opening the file. */
|
/* Try opening the file. */
|
||||||
Status = VfatOpenFile(DeviceExt, &PathNameU, FileObject, &ParentFcb);
|
Status = VfatOpenFile(DeviceExt, &PathNameU, FileObject, RequestedDisposition, &ParentFcb);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the directory containing the file to open doesn't exist then
|
* If the directory containing the file to open doesn't exist then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue