From fc640511426eee899d847dcb3a6fec537af83bc2 Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Sun, 19 Oct 2008 13:23:00 +0000 Subject: [PATCH] - VFAT fixes: Actually perform a mandatory call to CcPurgeCacheSection during file deletion (fixes real NT5 cache manager attempts to write section of a deleted file). - VFAT fixes: When querying FileStandardInformation, NT's fastfat driver sets NumberOfLinks to 1, ours sets it to 0 somewhy. Change to 1 for compatibility. - A couple of debug prints improvements in VFAT. - Comment out UNIMPLEMENTED in CcPurgeCacheSection to prevent debug messages flood. svn path=/trunk/; revision=36830 --- reactos/drivers/filesystems/fastfat/cleanup.c | 5 ----- reactos/drivers/filesystems/fastfat/finfo.c | 7 ++++--- reactos/ntoskrnl/cc/fs.c | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/reactos/drivers/filesystems/fastfat/cleanup.c b/reactos/drivers/filesystems/fastfat/cleanup.c index 466412cec81..88e441ebc4e 100644 --- a/reactos/drivers/filesystems/fastfat/cleanup.c +++ b/reactos/drivers/filesystems/fastfat/cleanup.c @@ -82,12 +82,7 @@ VfatCleanupFile(PVFAT_IRP_CONTEXT IrpContext) ObDereferenceObject(tmpFileObject); } -#if 0 - /* FIXME: - * CcPurgeCacheSection is unimplemented. - */ CcPurgeCacheSection(FileObject->SectionObjectPointer, NULL, 0, FALSE); -#endif } /* Uninitialize file cache if. */ if (FileObject->SectionObjectPointer->SharedCacheMap) diff --git a/reactos/drivers/filesystems/fastfat/finfo.c b/reactos/drivers/filesystems/fastfat/finfo.c index a8c8e3d2fa7..7b57731a503 100644 --- a/reactos/drivers/filesystems/fastfat/finfo.c +++ b/reactos/drivers/filesystems/fastfat/finfo.c @@ -91,7 +91,7 @@ VfatGetStandardInformation(PVFATFCB FCB, StandardInfo->EndOfFile = FCB->RFCB.FileSize; StandardInfo->Directory = FALSE; } - StandardInfo->NumberOfLinks = 0; + StandardInfo->NumberOfLinks = 1; StandardInfo->DeletePending = FCB->Flags & FCB_DELETE_PENDING ? TRUE : FALSE; *BufferLength -= sizeof(FILE_STANDARD_INFORMATION); @@ -271,7 +271,7 @@ VfatSetDispositionInformation(PFILE_OBJECT FileObject, PDEVICE_EXTENSION DeviceExt = DeviceObject->DeviceExtension; #endif - DPRINT ("FsdSetDispositionInformation()\n"); + DPRINT ("FsdSetDispositionInformation(<%wZ>, Delete %d)\n", &FCB->PathNameU, DispositionInfo->DeleteFile); ASSERT(DeviceExt != NULL); ASSERT(DeviceExt->FatInfo.BytesPerCluster != 0); @@ -551,7 +551,8 @@ VfatSetAllocationSizeInformation(PFILE_OBJECT FileObject, ULONG NCluster; BOOLEAN AllocSizeChanged = FALSE; - DPRINT("VfatSetAllocationSizeInformation()\n"); + DPRINT("VfatSetAllocationSizeInformation(File <%wZ>, AllocationSize %d %d)\n", &Fcb->PathNameU, + AllocationSize->HighPart, AllocationSize->LowPart); if (Fcb->Flags & FCB_IS_FATX_ENTRY) OldSize = Fcb->entry.FatX.FileSize; diff --git a/reactos/ntoskrnl/cc/fs.c b/reactos/ntoskrnl/cc/fs.c index 2a06df76159..083ee97969c 100644 --- a/reactos/ntoskrnl/cc/fs.c +++ b/reactos/ntoskrnl/cc/fs.c @@ -120,7 +120,7 @@ CcPurgeCacheSection ( IN BOOLEAN UninitializeCacheMaps ) { - UNIMPLEMENTED; + //UNIMPLEMENTED; return FALSE; }