Author: pschweitzer
Date: Sat Apr 30 08:20:00 2016
New Revision: 71209
URL:
http://svn.reactos.org/svn/reactos?rev=71209&view=rev
Log:
[FASTFAT]
Update the FCB cached dir entry in case of a rename.
CORE-11150 #resolve #comment Fixed in r71209
Modified:
trunk/reactos/drivers/filesystems/fastfat/dirwr.c
trunk/reactos/drivers/filesystems/fastfat/fcb.c
trunk/reactos/drivers/filesystems/fastfat/vfat.h
Modified: trunk/reactos/drivers/filesystems/fastfat/dirwr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/dirwr.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/dirwr.c [iso-8859-1] Sat Apr 30 08:20:00
2016
@@ -84,13 +84,14 @@
PVOID Context = NULL;
LARGE_INTEGER Offset;
PFATX_DIR_ENTRY pDirEntry;
- UNICODE_STRING ShortName;
NTSTATUS Status;
DPRINT("vfatRenameEntry(%p, %p, %wZ, %d)\n", DeviceExt, pFcb, FileName,
CaseChangeOnly);
if (pFcb->Flags & FCB_IS_FATX_ENTRY)
{
+ VFAT_DIRENTRY_CONTEXT DirContext;
+
/* Open associated dir entry */
StartIndex = pFcb->startIndex;
Offset.u.HighPart = 0;
@@ -115,10 +116,12 @@
CcUnpinData(Context);
/* Update FCB */
- ShortName.Length = 0;
- ShortName.MaximumLength = 0;
- ShortName.Buffer = NULL;
- Status = vfatUpdateFCB(DeviceExt, pFcb, FileName, &ShortName,
pFcb->parentFcb);
+ DirContext.ShortNameU.Length = 0;
+ DirContext.ShortNameU.MaximumLength = 0;
+ DirContext.ShortNameU.Buffer = NULL;
+ DirContext.LongNameU = *FileName;
+ DirContext.DirEntry.FatX = *pDirEntry;
+ Status = vfatUpdateFCB(DeviceExt, pFcb, &DirContext, pFcb->parentFcb);
if (NT_SUCCESS(Status))
{
CcPurgeCacheSection(&pFcb->parentFcb->SectionObjectPointers, NULL,
0, FALSE);
@@ -588,7 +591,7 @@
if (MoveContext != NULL)
{
/* We're modifying an existing FCB - likely rename/move */
- Status = vfatUpdateFCB(DeviceExt, *Fcb, &DirContext.LongNameU,
&DirContext.ShortNameU, ParentFcb);
+ Status = vfatUpdateFCB(DeviceExt, *Fcb, &DirContext, ParentFcb);
(*Fcb)->dirIndex = DirContext.DirIndex;
(*Fcb)->startIndex = DirContext.StartIndex;
}
@@ -744,7 +747,7 @@
{
/* We're modifying an existing FCB - likely rename/move */
/* FIXME: check status */
- vfatUpdateFCB(DeviceExt, *Fcb, &DirContext.LongNameU,
&DirContext.ShortNameU, ParentFcb);
+ vfatUpdateFCB(DeviceExt, *Fcb, &DirContext, ParentFcb);
(*Fcb)->dirIndex = DirContext.DirIndex;
(*Fcb)->startIndex = DirContext.StartIndex;
}
Modified: trunk/reactos/drivers/filesystems/fastfat/fcb.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/fcb.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/fcb.c [iso-8859-1] Sat Apr 30 08:20:00 2016
@@ -362,17 +362,16 @@
vfatUpdateFCB(
PDEVICE_EXTENSION pVCB,
PVFATFCB Fcb,
- PUNICODE_STRING LongName,
- PUNICODE_STRING ShortName,
+ PVFAT_DIRENTRY_CONTEXT DirContext,
PVFATFCB ParentFcb)
{
NTSTATUS Status;
PVFATFCB OldParent;
- DPRINT("vfatUpdateFCB(%p, %p, %wZ, %wZ, %p)\n", pVCB, Fcb, LongName,
ShortName, ParentFcb);
+ DPRINT("vfatUpdateFCB(%p, %p, %p, %p)\n", pVCB, Fcb, DirContext,
ParentFcb);
/* Get full path name */
- Status = vfatMakeFullName(ParentFcb, LongName, ShortName, &Fcb->PathNameU);
+ Status = vfatMakeFullName(ParentFcb, &DirContext->LongNameU,
&DirContext->ShortNameU, &Fcb->PathNameU);
if (!NT_SUCCESS(Status))
{
return Status;
@@ -393,18 +392,23 @@
vfatSplitPathName(&Fcb->PathNameU, &Fcb->DirNameU,
&Fcb->LongNameU);
/* Copy short name */
- RtlCopyUnicodeString(&Fcb->ShortNameU, ShortName);
+ RtlCopyUnicodeString(&Fcb->ShortNameU, &DirContext->ShortNameU);
/* Recompute hashes */
Fcb->Hash.Hash = vfatNameHash(0, &Fcb->PathNameU);
if (pVCB->Flags & VCB_IS_FATX)
{
Fcb->ShortHash.Hash = Fcb->Hash.Hash;
+
+ RtlCopyMemory(Fcb->entry.FatX.Filename, DirContext->DirEntry.FatX.Filename,
42);
+ Fcb->entry.FatX.FilenameLength = DirContext->DirEntry.FatX.FilenameLength;
}
else
{
Fcb->ShortHash.Hash = vfatNameHash(0, &Fcb->DirNameU);
Fcb->ShortHash.Hash = vfatNameHash(Fcb->ShortHash.Hash,
&Fcb->ShortNameU);
+
+ RtlCopyMemory(Fcb->entry.Fat.ShortName, DirContext->DirEntry.Fat.ShortName,
11);
}
/* Set parent */
Modified: trunk/reactos/drivers/filesystems/fastfat/vfat.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/vfat.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/vfat.h [iso-8859-1] Sat Apr 30 08:20:00
2016
@@ -808,8 +808,7 @@
vfatUpdateFCB(
PDEVICE_EXTENSION pVCB,
PVFATFCB Fcb,
- PUNICODE_STRING LongName,
- PUNICODE_STRING ShortName,
+ PVFAT_DIRENTRY_CONTEXT DirContext,
PVFATFCB ParentFcb);
VOID