- Lock the MainResource if we overwrite or supersede an existing file.
- Use given allocation size, if we overwrite or supersede an existing
file.
Modified: trunk/reactos/drivers/fs/vfat/create.c
_____
Modified: trunk/reactos/drivers/fs/vfat/create.c
--- trunk/reactos/drivers/fs/vfat/create.c 2005-11-27 15:37:06 UTC
(rev 19688)
+++ trunk/reactos/drivers/fs/vfat/create.c 2005-11-27 15:44:36 UTC
(rev 19689)
@@ -442,7 +442,6 @@
PVFATFCB ParentFcb;
PWCHAR c, last;
BOOLEAN PagingFileCreate = FALSE;
- LARGE_INTEGER AllocationSize;
BOOLEAN Dots;
UNICODE_STRING FileNameU;
UNICODE_STRING PathNameU;
@@ -565,9 +564,9 @@
if (!NT_SUCCESS (Status))
{
if (RequestedDisposition == FILE_CREATE ||
- RequestedDisposition == FILE_OPEN_IF ||
- RequestedDisposition == FILE_OVERWRITE_IF ||
- RequestedDisposition == FILE_SUPERSEDE)
+ RequestedDisposition == FILE_OPEN_IF ||
+ RequestedDisposition == FILE_OVERWRITE_IF ||
+ RequestedDisposition == FILE_SUPERSEDE)
{
ULONG Attributes;
Attributes =
Stack->Parameters.Create.FileAttributes;
@@ -586,7 +585,6 @@
}
Irp->IoStatus.Information =
FILE_CREATED;
-
VfatSetAllocationSizeInformation(FileObject,
pFcb,
DeviceExt,
@@ -691,13 +689,15 @@
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);
+ pFcb,
+
DeviceExt,
+
&Irp->Overlay.AllocationSize);
+ ExReleaseResourceLite(&(pFcb->MainResource));
if (!NT_SUCCESS (Status))
{
VfatCloseFile (DeviceExt, FileObject);
@@ -705,15 +705,12 @@
}
}
-
- /* 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;
}
Show replies by date