mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 17:34:57 +00:00
- Lock the MainResource if we overwrite or supersede an existing file.
- Use given allocation size, if we overwrite or supersede an existing file. svn path=/trunk/; revision=19689
This commit is contained in:
parent
420ab98250
commit
2229e54a12
1 changed files with 12 additions and 15 deletions
|
@ -442,7 +442,6 @@ VfatCreateFile ( PDEVICE_OBJECT DeviceObject, PIRP Irp )
|
|||
PVFATFCB ParentFcb;
|
||||
PWCHAR c, last;
|
||||
BOOLEAN PagingFileCreate = FALSE;
|
||||
LARGE_INTEGER AllocationSize;
|
||||
BOOLEAN Dots;
|
||||
UNICODE_STRING FileNameU;
|
||||
UNICODE_STRING PathNameU;
|
||||
|
@ -586,7 +585,6 @@ VfatCreateFile ( PDEVICE_OBJECT DeviceObject, PIRP Irp )
|
|||
}
|
||||
|
||||
Irp->IoStatus.Information = FILE_CREATED;
|
||||
|
||||
VfatSetAllocationSizeInformation(FileObject,
|
||||
pFcb,
|
||||
DeviceExt,
|
||||
|
@ -691,13 +689,15 @@ VfatCreateFile ( PDEVICE_OBJECT DeviceObject, PIRP Irp )
|
|||
|
||||
|
||||
if (RequestedDisposition == FILE_OVERWRITE ||
|
||||
RequestedDisposition == FILE_OVERWRITE_IF)
|
||||
RequestedDisposition == FILE_OVERWRITE_IF ||
|
||||
RequestedDisposition == FILE_SUPERSEDE)
|
||||
{
|
||||
AllocationSize.QuadPart = 0;
|
||||
ExAcquireResourceExclusiveLite(&(pFcb->MainResource), TRUE);
|
||||
Status = VfatSetAllocationSizeInformation (FileObject,
|
||||
pFcb,
|
||||
DeviceExt,
|
||||
&AllocationSize);
|
||||
&Irp->Overlay.AllocationSize);
|
||||
ExReleaseResourceLite(&(pFcb->MainResource));
|
||||
if (!NT_SUCCESS (Status))
|
||||
{
|
||||
VfatCloseFile (DeviceExt, FileObject);
|
||||
|
@ -705,15 +705,12 @@ VfatCreateFile ( PDEVICE_OBJECT DeviceObject, PIRP Irp )
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/* Supersede the file */
|
||||
if (RequestedDisposition == FILE_SUPERSEDE)
|
||||
{
|
||||
AllocationSize.QuadPart = 0;
|
||||
VfatSetAllocationSizeInformation(FileObject, pFcb, DeviceExt, &AllocationSize);
|
||||
Irp->IoStatus.Information = FILE_SUPERSEDED;
|
||||
}
|
||||
else if (RequestedDisposition == FILE_OVERWRITE || RequestedDisposition == FILE_OVERWRITE_IF)
|
||||
else if (RequestedDisposition == FILE_OVERWRITE ||
|
||||
RequestedDisposition == FILE_OVERWRITE_IF)
|
||||
{
|
||||
Irp->IoStatus.Information = FILE_OVERWRITTEN;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue