From 4ef74de489ee38007e953503313eb857f2165805 Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Tue, 25 Jan 2005 21:10:42 +0000 Subject: [PATCH] - Print the file information class if debug prints are enabled in VfatGet/SetInformation. - Check for the open handle count instead of the reference count if file deletion is requested. svn path=/trunk/; revision=13280 --- reactos/drivers/fs/vfat/finfo.c | 59 +++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/reactos/drivers/fs/vfat/finfo.c b/reactos/drivers/fs/vfat/finfo.c index f81640de34b..1f8015fe8c9 100644 --- a/reactos/drivers/fs/vfat/finfo.c +++ b/reactos/drivers/fs/vfat/finfo.c @@ -15,6 +15,54 @@ #define NDEBUG #include "vfat.h" +/* GLOBALS ******************************************************************/ + +const char* FileInformationClassNames[] = +{ + "??????", + "FileDirectoryInformation", + "FileFullDirectoryInformation", + "FileBothDirectoryInformation", + "FileBasicInformation", + "FileStandardInformation", + "FileInternalInformation", + "FileEaInformation", + "FileAccessInformation", + "FileNameInformation", + "FileRenameInformation", + "FileLinkInformation", + "FileNamesInformation", + "FileDispositionInformation", + "FilePositionInformation", + "FileFullEaInformation", + "FileModeInformation", + "FileAlignmentInformation", + "FileAllInformation", + "FileAllocationInformation", + "FileEndOfFileInformation", + "FileAlternateNameInformation", + "FileStreamInformation", + "FilePipeInformation", + "FilePipeLocalInformation", + "FilePipeRemoteInformation", + "FileMailslotQueryInformation", + "FileMailslotSetInformation", + "FileCompressionInformation", + "FileObjectIdInformation", + "FileCompletionInformation", + "FileMoveClusterInformation", + "FileQuotaInformation", + "FileReparsePointInformation", + "FileNetworkOpenInformation", + "FileAttributeTagInformation", + "FileTrackingInformation", + "FileIdBothDirectoryInformation", + "FileIdFullDirectoryInformation", + "FileValidDataLengthInformation", + "FileShortNameInformation", + "FileMaximumInformation" +}; + /* FUNCTIONS ****************************************************************/ static NTSTATUS @@ -248,9 +296,9 @@ VfatSetDispositionInformation(PFILE_OBJECT FileObject, { if (MmFlushImageSection (FileObject->SectionObjectPointer, MmFlushForDelete)) { - if (FCB->RefCount > 1) + if (FCB->OpenHandleCount > 1) { - DPRINT1("%d %x\n", FCB->RefCount, CcGetFileObjectFromSectionPtrs(FileObject->SectionObjectPointer)); + DPRINT1("%d %x\n", FCB->OpenHandleCount, CcGetFileObjectFromSectionPtrs(FileObject->SectionObjectPointer)); Status = STATUS_ACCESS_DENIED; } else @@ -650,6 +698,10 @@ NTSTATUS VfatQueryInformation(PVFAT_IRP_CONTEXT IrpContext) FileInformationClass = IrpContext->Stack->Parameters.QueryFile.FileInformationClass; FCB = (PVFATFCB) IrpContext->FileObject->FsContext; + DPRINT("VfatQueryInformation is called for '%s'\n", + FileInformationClass >= FileMaximumInformation - 1 ? "????" : FileInformationClassNames[FileInformationClass]); + + SystemBuffer = IrpContext->Irp->AssociatedIrp.SystemBuffer; BufferLength = IrpContext->Stack->Parameters.QueryFile.Length; @@ -754,6 +806,9 @@ NTSTATUS VfatSetInformation(PVFAT_IRP_CONTEXT IrpContext) IrpContext->Stack->Parameters.SetFile.FileInformationClass; FCB = (PVFATFCB) IrpContext->FileObject->FsContext; SystemBuffer = IrpContext->Irp->AssociatedIrp.SystemBuffer; + + DPRINT("VfatSetInformation is called for '%s'\n", + FileInformationClass >= FileMaximumInformation - 1 ? "????" : FileInformationClassNames[ FileInformationClass]); DPRINT("FileInformationClass %d\n", FileInformationClass); DPRINT("SystemBuffer %x\n", SystemBuffer);