mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 15:36:04 +00:00
Fixed some bugs in VfatGetStandardInformation().
Implemented VfatGetInternalInformation(). svn path=/trunk/; revision=2335
This commit is contained in:
parent
24f81ff1c1
commit
ae482ce24e
1 changed files with 25 additions and 21 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: finfo.c,v 1.9 2001/08/14 20:47:30 hbirr Exp $
|
/* $Id: finfo.c,v 1.10 2001/11/01 10:44:11 hbirr Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -30,7 +30,6 @@ VfatGetStandardInformation(PVFATFCB FCB,
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
PDEVICE_EXTENSION DeviceExtension;
|
PDEVICE_EXTENSION DeviceExtension;
|
||||||
unsigned long AllocSize;
|
|
||||||
|
|
||||||
if (*BufferLength < sizeof(FILE_STANDARD_INFORMATION))
|
if (*BufferLength < sizeof(FILE_STANDARD_INFORMATION))
|
||||||
return STATUS_BUFFER_OVERFLOW;
|
return STATUS_BUFFER_OVERFLOW;
|
||||||
|
@ -45,25 +44,12 @@ VfatGetStandardInformation(PVFATFCB FCB,
|
||||||
RtlZeroMemory(StandardInfo,
|
RtlZeroMemory(StandardInfo,
|
||||||
sizeof(FILE_STANDARD_INFORMATION));
|
sizeof(FILE_STANDARD_INFORMATION));
|
||||||
|
|
||||||
/* Make allocsize a rounded up multiple of BytesPerCluster */
|
StandardInfo->AllocationSize = FCB->RFCB.AllocationSize;
|
||||||
AllocSize = ((FCB->entry.FileSize + DeviceExtension->BytesPerCluster - 1) /
|
StandardInfo->EndOfFile = FCB->RFCB.FileSize;
|
||||||
DeviceExtension->BytesPerCluster) *
|
|
||||||
DeviceExtension->BytesPerCluster;
|
|
||||||
|
|
||||||
StandardInfo->AllocationSize = RtlConvertUlongToLargeInteger (AllocSize);
|
|
||||||
StandardInfo->EndOfFile =
|
|
||||||
RtlConvertUlongToLargeInteger (FCB->entry.FileSize);
|
|
||||||
StandardInfo->NumberOfLinks = 0;
|
StandardInfo->NumberOfLinks = 0;
|
||||||
StandardInfo->DeletePending = FALSE;
|
StandardInfo->DeletePending = FCB->Flags & FCB_DELETE_PENDING ? TRUE : FALSE;
|
||||||
if ((FCB->entry.Attrib & 0x10) > 0)
|
StandardInfo->Directory = FCB->entry.Attrib & 0x10 ? TRUE : FALSE;
|
||||||
{
|
|
||||||
StandardInfo->Directory = TRUE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
StandardInfo->Directory = FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
*BufferLength -= sizeof(FILE_STANDARD_INFORMATION);
|
*BufferLength -= sizeof(FILE_STANDARD_INFORMATION);
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
@ -236,7 +222,21 @@ VfatGetNameInformation(PFILE_OBJECT FileObject,
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static NTSTATUS
|
||||||
|
VfatGetInternalInformation(PVFATFCB Fcb,
|
||||||
|
PFILE_INTERNAL_INFORMATION InternalInfo,
|
||||||
|
PULONG BufferLength)
|
||||||
|
{
|
||||||
|
assert (InternalInfo);
|
||||||
|
assert (Fcb);
|
||||||
|
|
||||||
|
if (*BufferLength < sizeof(FILE_INTERNAL_INFORMATION))
|
||||||
|
return STATUS_BUFFER_OVERFLOW;
|
||||||
|
// FIXME: get a real index, that can be used in a create operation
|
||||||
|
InternalInfo->IndexNumber.QuadPart = 0;
|
||||||
|
*BufferLength -= sizeof(FILE_INTERNAL_INFORMATION);
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
VfatQueryInformation(PDEVICE_OBJECT DeviceObject,
|
VfatQueryInformation(PDEVICE_OBJECT DeviceObject,
|
||||||
|
@ -269,7 +269,7 @@ VfatQueryInformation(PDEVICE_OBJECT DeviceObject,
|
||||||
|
|
||||||
SystemBuffer = Irp->AssociatedIrp.SystemBuffer;
|
SystemBuffer = Irp->AssociatedIrp.SystemBuffer;
|
||||||
BufferLength = Stack->Parameters.QueryFile.Length;
|
BufferLength = Stack->Parameters.QueryFile.Length;
|
||||||
|
|
||||||
switch (FileInformationClass)
|
switch (FileInformationClass)
|
||||||
{
|
{
|
||||||
case FileStandardInformation:
|
case FileStandardInformation:
|
||||||
|
@ -300,6 +300,10 @@ VfatQueryInformation(PDEVICE_OBJECT DeviceObject,
|
||||||
&BufferLength);
|
&BufferLength);
|
||||||
break;
|
break;
|
||||||
case FileInternalInformation:
|
case FileInternalInformation:
|
||||||
|
RC = VfatGetInternalInformation(FCB,
|
||||||
|
SystemBuffer,
|
||||||
|
&BufferLength);
|
||||||
|
break;
|
||||||
case FileAlternateNameInformation:
|
case FileAlternateNameInformation:
|
||||||
case FileAllInformation:
|
case FileAllInformation:
|
||||||
RC = STATUS_NOT_IMPLEMENTED;
|
RC = STATUS_NOT_IMPLEMENTED;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue