mirror of
https://github.com/reactos/reactos.git
synced 2025-04-10 15:47:31 +00:00
[NPFS]
- Return buffer size if the buffer is too small svn path=/trunk/; revision=47508
This commit is contained in:
parent
cfc0d726f2
commit
f346021e6c
1 changed files with 10 additions and 6 deletions
|
@ -23,12 +23,15 @@ NpfsQueryFsDeviceInformation(PFILE_FS_DEVICE_INFORMATION FsDeviceInfo,
|
|||
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 @@ NpfsQueryFsAttributeInformation(PFILE_FS_ATTRIBUTE_INFORMATION FsAttributeInfo,
|
|||
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 @@ NpfsQueryFsAttributeInformation(PFILE_FS_ATTRIBUTE_INFORMATION FsAttributeInfo,
|
|||
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 @@ NpfsQueryVolumeInformation(PDEVICE_OBJECT DeviceObject,
|
|||
}
|
||||
|
||||
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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue