mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[FASTFAT]
Fail, if we try to overwrite an existing directory. svn path=/trunk/; revision=69941
This commit is contained in:
parent
f472d3c7c8
commit
2a6b240439
1 changed files with 14 additions and 2 deletions
|
@ -353,6 +353,7 @@ VfatOpenFile(
|
|||
PUNICODE_STRING PathNameU,
|
||||
PFILE_OBJECT FileObject,
|
||||
ULONG RequestedDisposition,
|
||||
ULONG RequestedOptions,
|
||||
PVFATFCB *ParentFcb)
|
||||
{
|
||||
PVFATFCB Fcb;
|
||||
|
@ -403,6 +404,16 @@ VfatOpenFile(
|
|||
return Status;
|
||||
}
|
||||
|
||||
/* Fail, if we try to overwrite an existing directory */
|
||||
if ((!(RequestedOptions & FILE_DIRECTORY_FILE) && (*Fcb->Attributes & FILE_ATTRIBUTE_DIRECTORY)) &&
|
||||
(RequestedDisposition == FILE_OVERWRITE ||
|
||||
RequestedDisposition == FILE_OVERWRITE_IF ||
|
||||
RequestedDisposition == FILE_SUPERSEDE))
|
||||
{
|
||||
vfatReleaseFCB(DeviceExt, Fcb);
|
||||
return STATUS_OBJECT_NAME_COLLISION;
|
||||
}
|
||||
|
||||
if (Fcb->Flags & FCB_DELETE_PENDING)
|
||||
{
|
||||
vfatReleaseFCB(DeviceExt, Fcb);
|
||||
|
@ -580,8 +591,9 @@ VfatCreateFile(
|
|||
/* Try opening the file. */
|
||||
if (!OpenTargetDir)
|
||||
{
|
||||
Status = VfatOpenFile(DeviceExt, &PathNameU, FileObject, RequestedDisposition, &ParentFcb);
|
||||
if (Status == STATUS_ACCESS_DENIED)
|
||||
Status = VfatOpenFile(DeviceExt, &PathNameU, FileObject, RequestedDisposition, RequestedOptions, &ParentFcb);
|
||||
if (Status == STATUS_ACCESS_DENIED ||
|
||||
Status == STATUS_OBJECT_NAME_COLLISION)
|
||||
return Status;
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue