Author: janderwald
Date: Tue Jun 1 10:43:50 2010
New Revision: 47508
URL:
http://svn.reactos.org/svn/reactos?rev=47508&view=rev
Log:
[NPFS]
- Return buffer size if the buffer is too small
Modified:
trunk/reactos/drivers/filesystems/npfs/volume.c
Modified: trunk/reactos/drivers/filesystems/npfs/volume.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/v…
==============================================================================
--- trunk/reactos/drivers/filesystems/npfs/volume.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/npfs/volume.c [iso-8859-1] Tue Jun 1 10:43:50 2010
@@ -23,12 +23,15 @@
DPRINT("FsDeviceInfo = %p\n", FsDeviceInfo);
if (*BufferLength < sizeof(FILE_FS_DEVICE_INFORMATION))
+ {
+ *BufferLength = sizeof(FILE_FS_DEVICE_INFORMATION);
return STATUS_BUFFER_OVERFLOW;
+ }
FsDeviceInfo->DeviceType = FILE_DEVICE_NAMED_PIPE;
FsDeviceInfo->Characteristics = 0;
- *BufferLength -= sizeof(FILE_FS_DEVICE_INFORMATION);
+ *BufferLength = sizeof(FILE_FS_DEVICE_INFORMATION);
DPRINT("NpfsQueryFsDeviceInformation() finished.\n");
@@ -44,7 +47,10 @@
DPRINT("FsAttributeInfo = %p\n", FsAttributeInfo);
if (*BufferLength < sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + 8)
+ {
+ *BufferLength = (sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + 8);
return STATUS_BUFFER_OVERFLOW;
+ }
FsAttributeInfo->FileSystemAttributes = FILE_CASE_PRESERVED_NAMES;
FsAttributeInfo->MaximumComponentNameLength = 255;
@@ -53,7 +59,7 @@
L"NPFS");
DPRINT("NpfsQueryFsAttributeInformation() finished.\n");
- *BufferLength -= (sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + 8);
+ *BufferLength = (sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + 8);
return STATUS_SUCCESS;
}
@@ -102,10 +108,8 @@
}
Irp->IoStatus.Status = Status;
- if (NT_SUCCESS(Status))
- Irp->IoStatus.Information = Stack->Parameters.QueryVolume.Length -
BufferLength;
- else
- Irp->IoStatus.Information = 0;
+ Irp->IoStatus.Information = BufferLength;
+
IoCompleteRequest(Irp,
IO_NO_INCREMENT);