mirror of
https://github.com/reactos/reactos.git
synced 2025-01-01 03:54:02 +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,
|
PUNICODE_STRING PathNameU,
|
||||||
PFILE_OBJECT FileObject,
|
PFILE_OBJECT FileObject,
|
||||||
ULONG RequestedDisposition,
|
ULONG RequestedDisposition,
|
||||||
|
ULONG RequestedOptions,
|
||||||
PVFATFCB *ParentFcb)
|
PVFATFCB *ParentFcb)
|
||||||
{
|
{
|
||||||
PVFATFCB Fcb;
|
PVFATFCB Fcb;
|
||||||
|
@ -403,6 +404,16 @@ VfatOpenFile(
|
||||||
return Status;
|
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)
|
if (Fcb->Flags & FCB_DELETE_PENDING)
|
||||||
{
|
{
|
||||||
vfatReleaseFCB(DeviceExt, Fcb);
|
vfatReleaseFCB(DeviceExt, Fcb);
|
||||||
|
@ -580,8 +591,9 @@ VfatCreateFile(
|
||||||
/* Try opening the file. */
|
/* Try opening the file. */
|
||||||
if (!OpenTargetDir)
|
if (!OpenTargetDir)
|
||||||
{
|
{
|
||||||
Status = VfatOpenFile(DeviceExt, &PathNameU, FileObject, RequestedDisposition, &ParentFcb);
|
Status = VfatOpenFile(DeviceExt, &PathNameU, FileObject, RequestedDisposition, RequestedOptions, &ParentFcb);
|
||||||
if (Status == STATUS_ACCESS_DENIED)
|
if (Status == STATUS_ACCESS_DENIED ||
|
||||||
|
Status == STATUS_OBJECT_NAME_COLLISION)
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue