mirror of
https://github.com/reactos/reactos.git
synced 2024-07-11 15:15:27 +00:00
[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. svn path=/trunk/; revision=43247
This commit is contained in:
parent
4a81976dfd
commit
8f8f77367c
|
@ -59,7 +59,10 @@ FatiOpenExistingFile(IN PFAT_IRP_CONTEXT IrpContext,
|
|||
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)
|
||||
|
@ -73,6 +76,20 @@ FatiOpenExistingFile(IN PFAT_IRP_CONTEXT IrpContext,
|
|||
/* 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
|
||||
|
||||
// This is usual file open branch, without overwriting!
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -484,11 +484,14 @@ FatInitializeVcb(IN PFAT_IRP_CONTEXT IrpContext,
|
|||
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;
|
||||
|
||||
|
|
|
@ -279,6 +279,8 @@ typedef struct _FCB
|
|||
UCHAR DirentFatFlags;
|
||||
/* File basic info */
|
||||
FILE_BASIC_INFORMATION BasicInfo;
|
||||
/* FullFAT file handle */
|
||||
FF_FILE *FatHandle;
|
||||
union
|
||||
{
|
||||
struct
|
||||
|
|
|
@ -58,6 +58,7 @@ FatReadBlocks(FF_T_UINT8 *DestBuffer, FF_T_UINT32 SectorAddress, FF_T_UINT32 Cou
|
|||
&Bcb,
|
||||
&Buffer))
|
||||
{
|
||||
ASSERT(FALSE);
|
||||
/* Mapping failed */
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -38,8 +38,8 @@ FatiRead(PFAT_IRP_CONTEXT IrpContext)
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue