Author: fireball
Date: Thu Oct 1 15:21:28 2009
New Revision: 43247
URL:
http://svn.reactos.org/svn/reactos?rev=43247&view=rev
Log:
[fastfat_new]
- Open a file in FatiOpenExistingFile by means of FullFAT library.
- Fix incorrect fullfat placement in fasfat.rbuild.
- Hack StreamFileObject to be 5Gb in length instead of 512 bytes. It'll be set to the
size of an underlying physical device later.
- Add FF file handle to FCB structure.
Modified:
trunk/reactos/drivers/filesystems/fastfat_new/create.c
trunk/reactos/drivers/filesystems/fastfat_new/fastfat.rbuild
trunk/reactos/drivers/filesystems/fastfat_new/fat.c
trunk/reactos/drivers/filesystems/fastfat_new/fatstruc.h
trunk/reactos/drivers/filesystems/fastfat_new/fullfat.c
trunk/reactos/drivers/filesystems/fastfat_new/rw.c
Modified: trunk/reactos/drivers/filesystems/fastfat_new/create.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat_new/create.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat_new/create.c [iso-8859-1] Thu Oct 1
15:21:28 2009
@@ -59,7 +59,10 @@
IN BOOLEAN IsDosName)
{
IO_STATUS_BLOCK Iosb = {{0}};
+ OEM_STRING AnsiName;
+ CHAR AnsiNameBuf[512];
PFCB Fcb;
+ NTSTATUS Status;
/* Check for create file option and fail */
if (CreateDisposition == FILE_CREATE)
@@ -72,6 +75,20 @@
/* Create a new FCB for this file */
Fcb = FatCreateFcb(IrpContext, Vcb, ParentDcb);
+
+ /* Convert the name to ANSI */
+ AnsiName.Buffer = AnsiNameBuf;
+ AnsiName.Length = 0;
+ AnsiName.MaximumLength = sizeof(AnsiNameBuf);
+ RtlZeroMemory(AnsiNameBuf, sizeof(AnsiNameBuf));
+ Status = RtlUpcaseUnicodeStringToCountedOemString(&AnsiName,
&FileObject->FileName, FALSE);
+ if (!NT_SUCCESS(Status))
+ {
+ ASSERT(FALSE);
+ }
+
+ /* Open the file with FullFAT */
+ Fcb->FatHandle = FF_Open(Vcb->Ioman, AnsiName.Buffer, FF_MODE_READ, NULL);
// TODO: Check if overwrite is needed
Modified: trunk/reactos/drivers/filesystems/fastfat_new/fastfat.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat_new/fastfat.rbuild [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat_new/fastfat.rbuild [iso-8859-1] Thu Oct 1
15:21:28 2009
@@ -4,10 +4,10 @@
<bootstrap installbase="$(CDOUTPUT)" />
<include base="fastfatn">.</include>
<include base="ReactOS">include/reactos/libs/fullfat</include>
+ <library>fullfat</library>
<library>ntoskrnl</library>
<library>hal</library>
<library>pseh</library>
- <library>fullfat</library>
<file>blockdev.c</file>
<file>cleanup.c</file>
<file>close.c</file>
Modified: trunk/reactos/drivers/filesystems/fastfat_new/fat.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat_new/fat.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat_new/fat.c [iso-8859-1] Thu Oct 1 15:21:28
2009
@@ -484,10 +484,13 @@
Vcb->StreamFileObject->SectionObjectPointer =
&Vcb->SectionObjectPointers;
/* At least full boot sector should be available */
- Vcb->Header.FileSize.QuadPart = sizeof(PACKED_BOOT_SECTOR);
- Vcb->Header.AllocationSize.QuadPart = sizeof(PACKED_BOOT_SECTOR);
+ //Vcb->Header.FileSize.QuadPart = sizeof(PACKED_BOOT_SECTOR);
+ //Vcb->Header.AllocationSize.QuadPart = sizeof(PACKED_BOOT_SECTOR);
Vcb->Header.ValidDataLength.HighPart = MAXLONG;
Vcb->Header.ValidDataLength.LowPart = MAXULONG;
+
+ Vcb->Header.AllocationSize.QuadPart = Int32x32To64(5*1024, 1024*1024); //HACK: 5
Gb
+ Vcb->Header.FileSize.QuadPart = Vcb->Header.AllocationSize.QuadPart;
/* Set VCB to a good condition */
Vcb->Condition = VcbGood;
Modified: trunk/reactos/drivers/filesystems/fastfat_new/fatstruc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat_new/fatstruc.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat_new/fatstruc.h [iso-8859-1] Thu Oct 1
15:21:28 2009
@@ -279,6 +279,8 @@
UCHAR DirentFatFlags;
/* File basic info */
FILE_BASIC_INFORMATION BasicInfo;
+ /* FullFAT file handle */
+ FF_FILE *FatHandle;
union
{
struct
Modified: trunk/reactos/drivers/filesystems/fastfat_new/fullfat.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat_new/fullfat.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat_new/fullfat.c [iso-8859-1] Thu Oct 1
15:21:28 2009
@@ -58,6 +58,7 @@
&Bcb,
&Buffer))
{
+ ASSERT(FALSE);
/* Mapping failed */
return 0;
}
Modified: trunk/reactos/drivers/filesystems/fastfat_new/rw.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat_new/rw.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat_new/rw.c [iso-8859-1] Thu Oct 1 15:21:28
2009
@@ -38,8 +38,8 @@
OpenType = FatDecodeFileObject(FileObject, &Vcb, &Fcb, &Ccb);
- DPRINT1("FatiRead() Fcb %p, Name %wZ, Offset %d, Length %d\n",
- Fcb, &FileObject->FileName, ByteOffset.LowPart, NumberOfBytes);
+ DPRINT1("FatiRead() Fcb %p, Name %wZ, Offset %d, Length %d, Handle %p\n",
+ Fcb, &FileObject->FileName, ByteOffset.LowPart, NumberOfBytes,
Fcb->FatHandle);
return STATUS_NOT_IMPLEMENTED;
}