Author: fireball
Date: Wed Oct 7 14:21:13 2009
New Revision: 43324
URL:
http://svn.reactos.org/svn/reactos?rev=43324&view=rev
Log:
[fastfat_new]
- Implement FatiQueryNameInformation. It doesn't work right now due to missing file
names in the FCB record.
- Make a stub for FatSetFcbNames.
Modified:
trunk/reactos/drivers/filesystems/fastfat_new/fastfat.h
trunk/reactos/drivers/filesystems/fastfat_new/fcb.c
trunk/reactos/drivers/filesystems/fastfat_new/finfo.c
Modified: trunk/reactos/drivers/filesystems/fastfat_new/fastfat.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat_new/fastfat.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat_new/fastfat.h [iso-8859-1] Wed Oct 7
14:21:13 2009
@@ -304,6 +304,10 @@
FatSetFullNameInFcb(PFCB Fcb,
PUNICODE_STRING Name);
+VOID NTAPI
+FatSetFcbNames(IN PFAT_IRP_CONTEXT IrpContext,
+ IN PFCB Fcb);
+
/* ------------------------------------------------------------ rw.c */
NTSTATUS NTAPI
Modified: trunk/reactos/drivers/filesystems/fastfat_new/fcb.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat_new/fcb.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat_new/fcb.c [iso-8859-1] Wed Oct 7 14:21:13
2009
@@ -149,6 +149,9 @@
Fcb->Header.ValidDataLength.LowPart = FileHandle->Filesize;
Fcb->FatHandle = FileHandle;
+ /* Set names */
+ FatSetFcbNames(IrpContext, Fcb);
+
return Fcb;
}
@@ -241,4 +244,13 @@
}
}
+VOID
+NTAPI
+FatSetFcbNames(IN PFAT_IRP_CONTEXT IrpContext,
+ IN PFCB Fcb)
+{
+ // Set the short name first
+ UNIMPLEMENTED;
+}
+
/* EOF */
Modified: trunk/reactos/drivers/filesystems/fastfat_new/finfo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat_new/finfo.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat_new/finfo.c [iso-8859-1] Wed Oct 7 14:21:13
2009
@@ -61,10 +61,51 @@
FatiQueryNameInformation(IN PFAT_IRP_CONTEXT IrpContext,
IN PFCB Fcb,
IN PFILE_OBJECT FileObject,
- IN OUT PFILE_INTERNAL_INFORMATION Buffer,
+ IN OUT PFILE_NAME_INFORMATION Buffer,
IN OUT PLONG Length)
{
- UNIMPLEMENTED;
+ ULONG ByteSize;
+ ULONG Trim = 0;
+ BOOLEAN Overflow = FALSE;
+
+ /* Deduct the minimum written length */
+ *Length -= FIELD_OFFSET(FILE_NAME_INFORMATION, FileName[0]);
+
+ // Build full name if needed
+ //if (!Fcb->FullFileName.Buffer)
+
+ DPRINT1("FullFileName %wZ\n", &Fcb->FullFileName);
+
+ if (*Length < Fcb->FullFileName.Length - Trim)
+ {
+ /* Buffer can't fit all data */
+ ByteSize = *Length;
+ Overflow = TRUE;
+ }
+ else
+ {
+ /* Deduct the amount of bytes we are going to write */
+ ByteSize = Fcb->FullFileName.Length - Trim;
+ *Length -= ByteSize;
+ }
+
+ /* Copy the name */
+ RtlCopyMemory(Buffer->FileName,
+ Fcb->FullFileName.Buffer,
+ ByteSize);
+
+ /* Set the length */
+ Buffer->FileNameLength = Fcb->FullFileName.Length - Trim;
+
+ /* Is this a shortname query? */
+ if (Trim)
+ {
+ /* Yes, not supported atm */
+ ASSERT(FALSE);
+ }
+
+ /* Indicate overflow by passing -1 as the length */
+ if (Overflow) *Length = -1;
}
NTSTATUS