mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Implemented FileAllInformation.
svn path=/trunk/; revision=3268
This commit is contained in:
parent
aa3245dd92
commit
db6e84c404
2 changed files with 159 additions and 8 deletions
|
@ -16,11 +16,11 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: finfo.c,v 1.3 2002/07/20 00:57:15 ekohl Exp $
|
/* $Id: finfo.c,v 1.4 2002/07/20 11:44:24 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* FILE: services/fs/cdfs/dirctl.c
|
* FILE: services/fs/cdfs/finfo.c
|
||||||
* PURPOSE: CDROM (ISO 9660) filesystem driver
|
* PURPOSE: CDROM (ISO 9660) filesystem driver
|
||||||
* PROGRAMMER: Art Yerkes
|
* PROGRAMMER: Art Yerkes
|
||||||
* Eric Kohl
|
* Eric Kohl
|
||||||
|
@ -144,9 +144,9 @@ CdfsGetNameInformation(PFILE_OBJECT FileObject,
|
||||||
return STATUS_BUFFER_OVERFLOW;
|
return STATUS_BUFFER_OVERFLOW;
|
||||||
|
|
||||||
NameInfo->FileNameLength = NameLength;
|
NameInfo->FileNameLength = NameLength;
|
||||||
memcpy(NameInfo->FileName,
|
RtlCopyMemory(NameInfo->FileName,
|
||||||
Fcb->PathName,
|
Fcb->PathName,
|
||||||
NameLength + sizeof(WCHAR));
|
NameLength + sizeof(WCHAR));
|
||||||
|
|
||||||
*BufferLength -=
|
*BufferLength -=
|
||||||
(sizeof(FILE_NAME_INFORMATION) + NameLength + sizeof(WCHAR));
|
(sizeof(FILE_NAME_INFORMATION) + NameLength + sizeof(WCHAR));
|
||||||
|
@ -176,6 +176,7 @@ CdfsGetInternalInformation(PFCB Fcb,
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static NTSTATUS
|
static NTSTATUS
|
||||||
CdfsGetNetworkOpenInformation(PFCB Fcb,
|
CdfsGetNetworkOpenInformation(PFCB Fcb,
|
||||||
PFILE_NETWORK_OPEN_INFORMATION NetworkInfo,
|
PFILE_NETWORK_OPEN_INFORMATION NetworkInfo,
|
||||||
|
@ -209,6 +210,74 @@ CdfsGetNetworkOpenInformation(PFCB Fcb,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static NTSTATUS
|
||||||
|
CdfsGetAllInformation(PFILE_OBJECT FileObject,
|
||||||
|
PFCB Fcb,
|
||||||
|
PFILE_ALL_INFORMATION Info,
|
||||||
|
PULONG BufferLength)
|
||||||
|
/*
|
||||||
|
* FUNCTION: Retrieve the all file information
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
ULONG NameLength;
|
||||||
|
|
||||||
|
assert(Info);
|
||||||
|
assert(Fcb);
|
||||||
|
|
||||||
|
NameLength = wcslen(Fcb->PathName) * sizeof(WCHAR);
|
||||||
|
if (*BufferLength < sizeof(FILE_ALL_INFORMATION) + NameLength)
|
||||||
|
return(STATUS_BUFFER_OVERFLOW);
|
||||||
|
|
||||||
|
/* Basic Information */
|
||||||
|
CdfsDateTimeToFileTime(Fcb,
|
||||||
|
&Info->BasicInformation.CreationTime);
|
||||||
|
CdfsDateTimeToFileTime(Fcb,
|
||||||
|
&Info->BasicInformation.LastAccessTime);
|
||||||
|
CdfsDateTimeToFileTime(Fcb,
|
||||||
|
&Info->BasicInformation.LastWriteTime);
|
||||||
|
CdfsDateTimeToFileTime(Fcb,
|
||||||
|
&Info->BasicInformation.ChangeTime);
|
||||||
|
CdfsFileFlagsToAttributes(Fcb,
|
||||||
|
&Info->BasicInformation.FileAttributes);
|
||||||
|
|
||||||
|
/* Standard Information */
|
||||||
|
Info->StandardInformation.AllocationSize = Fcb->RFCB.AllocationSize;
|
||||||
|
Info->StandardInformation.EndOfFile = Fcb->RFCB.FileSize;
|
||||||
|
Info->StandardInformation.NumberOfLinks = 0;
|
||||||
|
Info->StandardInformation.DeletePending = FALSE;
|
||||||
|
Info->StandardInformation.Directory = Fcb->Entry.FileFlags & 0x02 ? TRUE : FALSE;
|
||||||
|
|
||||||
|
/* Internal Information */
|
||||||
|
/* FIXME: get a real index, that can be used in a create operation */
|
||||||
|
Info->InternalInformation.IndexNumber.QuadPart = 0;
|
||||||
|
|
||||||
|
/* EA Information */
|
||||||
|
Info->EaInformation.EaSize = 0;
|
||||||
|
|
||||||
|
/* Access Information */
|
||||||
|
/* The IO-Manager adds this information */
|
||||||
|
|
||||||
|
/* Position Information */
|
||||||
|
Info->PositionInformation.CurrentByteOffset.QuadPart = FileObject->CurrentByteOffset.QuadPart;
|
||||||
|
|
||||||
|
/* Mode Information */
|
||||||
|
/* The IO-Manager adds this information */
|
||||||
|
|
||||||
|
/* Alignment Information */
|
||||||
|
/* The IO-Manager adds this information */
|
||||||
|
|
||||||
|
/* Name Information */
|
||||||
|
Info->NameInformation.FileNameLength = NameLength;
|
||||||
|
RtlCopyMemory(Info->NameInformation.FileName,
|
||||||
|
Fcb->PathName,
|
||||||
|
NameLength + sizeof(WCHAR));
|
||||||
|
|
||||||
|
*BufferLength -= (sizeof(FILE_ALL_INFORMATION) + NameLength + sizeof(WCHAR));
|
||||||
|
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
CdfsQueryInformation(PDEVICE_OBJECT DeviceObject,
|
CdfsQueryInformation(PDEVICE_OBJECT DeviceObject,
|
||||||
PIRP Irp)
|
PIRP Irp)
|
||||||
|
@ -278,8 +347,14 @@ CdfsQueryInformation(PDEVICE_OBJECT DeviceObject,
|
||||||
&BufferLength);
|
&BufferLength);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FileAlternateNameInformation:
|
|
||||||
case FileAllInformation:
|
case FileAllInformation:
|
||||||
|
Status = CdfsGetAllInformation(FileObject,
|
||||||
|
Fcb,
|
||||||
|
SystemBuffer,
|
||||||
|
&BufferLength);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case FileAlternateNameInformation:
|
||||||
Status = STATUS_NOT_IMPLEMENTED;
|
Status = STATUS_NOT_IMPLEMENTED;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: finfo.c,v 1.13 2002/07/20 00:57:36 ekohl Exp $
|
/* $Id: finfo.c,v 1.14 2002/07/20 11:44:37 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -274,6 +274,77 @@ VfatGetNetworkOpenInformation(PVFATFCB Fcb,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static NTSTATUS
|
||||||
|
VfatGetAllInformation(PFILE_OBJECT FileObject,
|
||||||
|
PVFATFCB Fcb,
|
||||||
|
PFILE_ALL_INFORMATION Info,
|
||||||
|
PULONG BufferLength)
|
||||||
|
/*
|
||||||
|
* FUNCTION: Retrieve the all file information
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
ULONG NameLength;
|
||||||
|
|
||||||
|
assert (Info);
|
||||||
|
assert (Fcb);
|
||||||
|
|
||||||
|
NameLength = wcslen(Fcb->PathName) * sizeof(WCHAR);
|
||||||
|
if (*BufferLength < sizeof(FILE_ALL_INFORMATION) + NameLength)
|
||||||
|
return(STATUS_BUFFER_OVERFLOW);
|
||||||
|
|
||||||
|
/* Basic Information */
|
||||||
|
FsdDosDateTimeToFileTime(Fcb->entry.CreationDate,
|
||||||
|
Fcb->entry.CreationTime,
|
||||||
|
&Info->BasicInformation.CreationTime);
|
||||||
|
FsdDosDateTimeToFileTime(Fcb->entry.AccessDate,
|
||||||
|
0,
|
||||||
|
&Info->BasicInformation.LastAccessTime);
|
||||||
|
FsdDosDateTimeToFileTime(Fcb->entry.UpdateDate,
|
||||||
|
Fcb->entry.UpdateTime,
|
||||||
|
&Info->BasicInformation.LastWriteTime);
|
||||||
|
FsdDosDateTimeToFileTime(Fcb->entry.UpdateDate,
|
||||||
|
Fcb->entry.UpdateTime,
|
||||||
|
&Info->BasicInformation.ChangeTime);
|
||||||
|
Info->BasicInformation.FileAttributes = Fcb->entry.Attrib;
|
||||||
|
|
||||||
|
/* Standard Information */
|
||||||
|
Info->StandardInformation.AllocationSize = Fcb->RFCB.AllocationSize;
|
||||||
|
Info->StandardInformation.EndOfFile = Fcb->RFCB.FileSize;
|
||||||
|
Info->StandardInformation.NumberOfLinks = 0;
|
||||||
|
Info->StandardInformation.DeletePending = Fcb->Flags & FCB_DELETE_PENDING ? TRUE : FALSE;
|
||||||
|
Info->StandardInformation.Directory = Fcb->entry.Attrib & 0x10 ? TRUE : FALSE;
|
||||||
|
|
||||||
|
/* Internal Information */
|
||||||
|
/* FIXME: get a real index, that can be used in a create operation */
|
||||||
|
Info->InternalInformation.IndexNumber.QuadPart = 0;
|
||||||
|
|
||||||
|
/* EA Information */
|
||||||
|
Info->EaInformation.EaSize = 0;
|
||||||
|
|
||||||
|
/* Access Information */
|
||||||
|
/* The IO-Manager adds this information */
|
||||||
|
|
||||||
|
/* Position Information */
|
||||||
|
Info->PositionInformation.CurrentByteOffset.QuadPart = FileObject->CurrentByteOffset.QuadPart;
|
||||||
|
|
||||||
|
/* Mode Information */
|
||||||
|
/* The IO-Manager adds this information */
|
||||||
|
|
||||||
|
/* Alignment Information */
|
||||||
|
/* The IO-Manager adds this information */
|
||||||
|
|
||||||
|
/* Name Information */
|
||||||
|
Info->NameInformation.FileNameLength = NameLength;
|
||||||
|
RtlCopyMemory(Info->NameInformation.FileName,
|
||||||
|
Fcb->PathName,
|
||||||
|
NameLength + sizeof(WCHAR));
|
||||||
|
|
||||||
|
*BufferLength -= (sizeof(FILE_ALL_INFORMATION) + NameLength + sizeof(WCHAR));
|
||||||
|
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS VfatQueryInformation(PVFAT_IRP_CONTEXT IrpContext)
|
NTSTATUS VfatQueryInformation(PVFAT_IRP_CONTEXT IrpContext)
|
||||||
/*
|
/*
|
||||||
* FUNCTION: Retrieve the specified file information
|
* FUNCTION: Retrieve the specified file information
|
||||||
|
@ -344,9 +415,14 @@ NTSTATUS VfatQueryInformation(PVFAT_IRP_CONTEXT IrpContext)
|
||||||
SystemBuffer,
|
SystemBuffer,
|
||||||
&BufferLength);
|
&BufferLength);
|
||||||
break;
|
break;
|
||||||
|
case FileAllInformation:
|
||||||
|
RC = VfatGetAllInformation(IrpContext->FileObject,
|
||||||
|
FCB,
|
||||||
|
SystemBuffer,
|
||||||
|
&BufferLength);
|
||||||
|
break;
|
||||||
|
|
||||||
case FileAlternateNameInformation:
|
case FileAlternateNameInformation:
|
||||||
case FileAllInformation:
|
|
||||||
RC = STATUS_NOT_IMPLEMENTED;
|
RC = STATUS_NOT_IMPLEMENTED;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue