mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 11:32:56 +00:00
[fastfat_new]
- Improve FatCreateDcb so that it sets the dir name. - Implement relative file object open. svn path=/trunk/; revision=43517
This commit is contained in:
parent
021a16cdd7
commit
9c31ef3801
3 changed files with 54 additions and 10 deletions
|
@ -126,8 +126,7 @@ FatiOpenExistingDir(IN PFAT_IRP_CONTEXT IrpContext,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create a new DCB for this directory */
|
/* Create a new DCB for this directory */
|
||||||
Fcb = FatCreateDcb(IrpContext, Vcb, ParentDcb);
|
Fcb = FatCreateDcb(IrpContext, Vcb, ParentDcb, FileHandle);
|
||||||
Fcb->FatHandle = FileHandle;
|
|
||||||
|
|
||||||
/* Set share access */
|
/* Set share access */
|
||||||
IoSetShareAccess(*DesiredAccess, ShareAccess, FileObject, &Fcb->ShareAccess);
|
IoSetShareAccess(*DesiredAccess, ShareAccess, FileObject, &Fcb->ShareAccess);
|
||||||
|
@ -332,9 +331,9 @@ FatiCreate(IN PFAT_IRP_CONTEXT IrpContext,
|
||||||
ULONG CreateDisposition;
|
ULONG CreateDisposition;
|
||||||
|
|
||||||
/* Control blocks */
|
/* Control blocks */
|
||||||
PVCB Vcb, DecodedVcb;
|
PVCB Vcb, DecodedVcb, RelatedVcb;
|
||||||
PFCB Fcb, NextFcb;
|
PFCB Fcb, NextFcb, RelatedDcb;
|
||||||
PCCB Ccb;
|
PCCB Ccb, RelatedCcb;
|
||||||
PFCB ParentDcb;
|
PFCB ParentDcb;
|
||||||
|
|
||||||
/* IRP data */
|
/* IRP data */
|
||||||
|
@ -357,6 +356,7 @@ FatiCreate(IN PFAT_IRP_CONTEXT IrpContext,
|
||||||
UNICODE_STRING RemainingPart, FirstName, NextName;
|
UNICODE_STRING RemainingPart, FirstName, NextName;
|
||||||
OEM_STRING AnsiFirstName;
|
OEM_STRING AnsiFirstName;
|
||||||
FF_ERROR FfError;
|
FF_ERROR FfError;
|
||||||
|
TYPE_OF_OPEN TypeOfOpen;
|
||||||
|
|
||||||
Iosb.Status = STATUS_SUCCESS;
|
Iosb.Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
|
@ -533,8 +533,42 @@ FatiCreate(IN PFAT_IRP_CONTEXT IrpContext,
|
||||||
/* Check if this is a relative open */
|
/* Check if this is a relative open */
|
||||||
if (RelatedFO)
|
if (RelatedFO)
|
||||||
{
|
{
|
||||||
// RelatedFO will be a parent directory
|
/* Decode the file object */
|
||||||
UNIMPLEMENTED;
|
TypeOfOpen = FatDecodeFileObject(RelatedFO,
|
||||||
|
&RelatedVcb,
|
||||||
|
&RelatedDcb,
|
||||||
|
&RelatedCcb);
|
||||||
|
|
||||||
|
/* Check open type */
|
||||||
|
if (TypeOfOpen != UserFileOpen &&
|
||||||
|
TypeOfOpen != UserDirectoryOpen)
|
||||||
|
{
|
||||||
|
DPRINT1("Invalid file object!\n");
|
||||||
|
|
||||||
|
/* Cleanup and return */
|
||||||
|
FatReleaseVcb(IrpContext, Vcb);
|
||||||
|
return STATUS_OBJECT_PATH_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* File path must be relative */
|
||||||
|
if (FileName.Length != 0 &&
|
||||||
|
FileName.Buffer[0] == L'\\')
|
||||||
|
{
|
||||||
|
/* The name is absolute, fail */
|
||||||
|
FatReleaseVcb(IrpContext, Vcb);
|
||||||
|
return STATUS_OBJECT_NAME_INVALID;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Make sure volume is the same */
|
||||||
|
ASSERT(RelatedVcb == Vcb);
|
||||||
|
|
||||||
|
/* Save VPB */
|
||||||
|
FileObject->Vpb = RelatedFO->Vpb;
|
||||||
|
|
||||||
|
/* Set parent DCB */
|
||||||
|
ParentDcb = RelatedDcb;
|
||||||
|
|
||||||
|
DPRINT1("Opening file '%wZ' relatively to '%wZ'\n", &FileName, &ParentDcb->FullFileName);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -743,7 +777,8 @@ FatiCreate(IN PFAT_IRP_CONTEXT IrpContext,
|
||||||
/* Create a DCB for this entry */
|
/* Create a DCB for this entry */
|
||||||
ParentDcb = FatCreateDcb(IrpContext,
|
ParentDcb = FatCreateDcb(IrpContext,
|
||||||
Vcb,
|
Vcb,
|
||||||
ParentDcb);
|
ParentDcb,
|
||||||
|
NULL);
|
||||||
|
|
||||||
/* Set its name */
|
/* Set its name */
|
||||||
FatSetFullNameInFcb(ParentDcb, &FirstName);
|
FatSetFullNameInFcb(ParentDcb, &FirstName);
|
||||||
|
|
|
@ -127,7 +127,8 @@ PFCB
|
||||||
NTAPI
|
NTAPI
|
||||||
FatCreateDcb(IN PFAT_IRP_CONTEXT IrpContext,
|
FatCreateDcb(IN PFAT_IRP_CONTEXT IrpContext,
|
||||||
IN PVCB Vcb,
|
IN PVCB Vcb,
|
||||||
IN PFCB ParentDcb)
|
IN PFCB ParentDcb,
|
||||||
|
IN FF_FILE *FileHandle)
|
||||||
{
|
{
|
||||||
PFCB Fcb;
|
PFCB Fcb;
|
||||||
|
|
||||||
|
@ -162,6 +163,13 @@ FatCreateDcb(IN PFAT_IRP_CONTEXT IrpContext,
|
||||||
/* Initialize parent dcb list */
|
/* Initialize parent dcb list */
|
||||||
InitializeListHead(&Fcb->Dcb.ParentDcbList);
|
InitializeListHead(&Fcb->Dcb.ParentDcbList);
|
||||||
|
|
||||||
|
/* Set FullFAT handle */
|
||||||
|
Fcb->FatHandle = FileHandle;
|
||||||
|
|
||||||
|
/* Set names */
|
||||||
|
if (FileHandle)
|
||||||
|
FatSetFcbNames(IrpContext, Fcb);
|
||||||
|
|
||||||
return Fcb;
|
return Fcb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,8 @@ FatCreateRootDcb(IN PFAT_IRP_CONTEXT IrpContext,
|
||||||
PFCB NTAPI
|
PFCB NTAPI
|
||||||
FatCreateDcb(IN PFAT_IRP_CONTEXT IrpContext,
|
FatCreateDcb(IN PFAT_IRP_CONTEXT IrpContext,
|
||||||
IN PVCB Vcb,
|
IN PVCB Vcb,
|
||||||
IN PFCB ParentDcb);
|
IN PFCB ParentDcb,
|
||||||
|
IN FF_FILE *FileHandle);
|
||||||
|
|
||||||
/* -------------------------------------------------------- create.c */
|
/* -------------------------------------------------------- create.c */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue