23#define BugCheckFileId (FAT_BUG_CHECK_CLEANUP)
29#define Dbg (DEBUG_TRACE_CLEANUP)
42#pragma alloc_text(PAGE, FatCommonCleanup)
43#pragma alloc_text(PAGE, FatFsdCleanup)
113 Status = FatCommonCleanup( IrpContext,
Irp );
200#if (NTDDI_VERSION >= NTDDI_WIN8)
231 DebugTrace(-1,
Dbg,
"FatCommonCleanup -> STATUS_SUCCESS\n", 0);
261 DebugTrace(-1,
Dbg,
"FatCommonCleanup -> STATUS_SUCCESS\n", 0);
274 (
VOID)FatAcquireExclusiveFcb( IrpContext,
Fcb );
297#if (NTDDI_VERSION >= NTDDI_WIN8)
298 ProcessingDeleteOnClose =
TRUE;
308#pragma prefast( suppress:6309, "FullDirectoryName may be NULL if NotifyIrp is also NULL. this indicates the object is being deleted." )
340 (
VOID)FatAcquireExclusiveFcb( IrpContext,
Fcb );
382 FatVerifyFcb( IrpContext,
Fcb );
406#if (NTDDI_VERSION >= NTDDI_WIN8)
414 if (ProcessingDeleteOnClose &&
417 FatIsDirectoryEmpty( IrpContext,
Fcb ))) {
421 OPLOCK_FLAG_CLOSING_DELETE_ON_CLOSE,
455 DebugTrace(0,
Dbg,
"Cleanup VirtualVolumeFile/DirectoryFile\n", 0);
468 FatCheckForDismount( IrpContext,
Vcb,
TRUE );
481 Vcb->TargetDeviceObject );
495 SendUnlockNotification =
TRUE;
560 if (!FatIsDirectoryEmpty(IrpContext,
Fcb)) {
571#if (NTDDI_VERSION >= NTDDI_WIN8)
609 FatTruncateFileAllocation( IrpContext,
Fcb, 0 );
611 if (
Fcb->
Header.AllocationSize.LowPart == 0) {
650#if (NTDDI_VERSION >= NTDDI_WIN8)
659 (OPLOCK_FLAG_PARENT_OBJECT |
660 OPLOCK_FLAG_REMOVING_FILE_OR_LINK),
690 if ((
FileObject->SectionObjectPointer->DataSectionObject ==
NULL) &&
785 FatSetFileSizeInDirent( IrpContext,
Fcb,
NULL );
804 ULONG ValidDataLength;
806 ValidDataLength =
Fcb->
Header.ValidDataLength.LowPart;
808 if (ValidDataLength < Fcb->ValidDataToDisk) {
816 if (ValidDataLength < Fcb->
Header.FileSize.LowPart) {
876 FatTruncateFileAllocation( IrpContext,
889 LocalTruncateSize =
Fcb->
Header.FileSize;
890 TruncateSize = &LocalTruncateSize;
906 Fcb->
Header.AllocationSize.LowPart == 0) {
937#if (NTDDI_VERSION >= NTDDI_WIN8)
952#if (NTDDI_VERSION >= NTDDI_WIN8)
961 (OPLOCK_FLAG_PARENT_OBJECT |
962 OPLOCK_FLAG_REMOVING_FILE_OR_LINK),
1035#pragma prefast( suppress: 28159, "if the type of open is unknown then things are very bad." )
1131#if (NTDDI_VERSION >= NTDDI_WIN8)
1144 if (SendUnlockNotification) {
1183 Vcb->VcbState &= ~VCB_STATE_FLAG_LOCKED;
1184 Vcb->FileObjectWithVcbLocked =
NULL;
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
VOID DeleteContext(PWSTR pszName)
VOID NTAPI CcFlushCache(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, IN OPTIONAL PLARGE_INTEGER FileOffset, IN ULONG Length, OUT OPTIONAL PIO_STATUS_BLOCK IoStatus)
#define CcIsFileCached(FO)
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN TypeOfOpen
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN PFCB _In_opt_ PCCB Ccb
enum _TYPE_OF_OPEN TYPE_OF_OPEN
#define _Requires_lock_held_(lock)
#define NT_SUCCESS(StatCode)
VOID FatAutoUnlock(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb)
_In_ PIO_STACK_LOCATION IrpSp
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK _In_ USHORT ShareAccess
#define FatBugCheck(A, B, C)
#define ExAcquireResourceExclusiveLite(res, wait)
#define ClearFlag(_F, _SF)
VOID FatUnpinRepinnedBcbs(IN PIRP_CONTEXT IrpContext)
FINISHED FatZeroData(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb, IN PFILE_OBJECT FileObject, IN ULONG StartingZero, IN ULONG ByteCount)
VOID FatTunnelFcbOrDcb(IN PFCB FcbOrDcb, IN PCCB Ccb OPTIONAL)
ULONG FatExceptionFilter(IN PIRP_CONTEXT IrpContext, IN PEXCEPTION_POINTERS ExceptionPointer)
BOOLEAN FatIsIrpTopLevel(IN PIRP Irp)
LARGE_INTEGER FatLargeZero
#define DebugTrace(INDENT, LEVEL, X, Y)
TYPE_OF_OPEN FatDecodeFileObject(_In_ PFILE_OBJECT FileObject, _Outptr_ PVCB *Vcb, _Outptr_ PFCB *FcbOrDcb, _Outptr_ PCCB *Ccb)
IN PFCB IN PCCB IN TYPE_OF_OPEN IN BOOLEAN IN BOOLEAN TopLevel
#define FatCompleteRequest(IRPCONTEXT, IRP, STATUS)
#define FatNotifyReportChange(I, V, F, FL, A)
#define FatReleaseFcb(IRPCONTEXT, Fcb)
NTSTATUS FatFlushFat(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb)
VOID NTAPI FatPrePostIrp(IN PVOID Context, IN PIRP Irp)
#define FatDeviceIsFatFsdo(D)
#define FatResetExceptionState(IRPCONTEXT)
#define FatAcquireExclusiveVcb(IC, V)
#define FatIsFastIoPossible(FCB)
VOID NTAPI FatOplockComplete(IN PVOID Context, IN PIRP Irp)
#define FatNormalizeAndRaiseStatus(IRPCONTEXT, STATUS)
#define FatGetFcbOplock(F)
VOID FatRemoveNames(IN PIRP_CONTEXT IrpContext, IN PFCB Fcb)
#define FatIsFileOplockable(F)
#define FatReleaseVcb(IRPCONTEXT, Vcb)
NTSTATUS FatHijackIrpAndFlushDevice(IN PIRP_CONTEXT IrpContext, IN PIRP Irp, IN PDEVICE_OBJECT TargetDeviceObject)
PIRP_CONTEXT FatCreateIrpContext(IN PIRP Irp, IN BOOLEAN Wait)
#define FCB_STATE_FLUSH_FAT
#define VCB_STATE_FLAG_LOCKED
#define VCB_STATE_FLAG_SHUTDOWN
#define VCB_STATE_FLAG_DEFERRED_FLUSH
#define IRP_CONTEXT_FLAG_CLEANUP_BREAKING_OPLOCK
#define FCB_STATE_DENY_DEFRAG
#define VCB_STATE_FLAG_WRITE_PROTECTED
#define FCB_STATE_DELETE_ON_CLOSE
#define FCB_STATE_TRUNCATE_ON_CLOSE
#define FCB_STATE_PAGING_FILE
#define CCB_FLAG_DENY_DEFRAG
#define CCB_FLAG_DELETE_ON_CLOSE
#define CCB_FLAG_COMPLETE_DISMOUNT
#define FCB_STATE_DELAY_CLOSE
NTSTATUS NTAPI FsRtlFastUnlockAll(IN PFILE_LOCK FileLock, IN PFILE_OBJECT FileObject, IN PEPROCESS Process, IN PVOID Context OPTIONAL)
#define FsRtlEnterFileSystem
#define FsRtlExitFileSystem
VOID NTAPI CcSetFileSizes(IN PFILE_OBJECT FileObject, IN PCC_FILE_SIZES FileSizes)
BOOLEAN NTAPI CcUninitializeCacheMap(IN PFILE_OBJECT FileObject, IN OPTIONAL PLARGE_INTEGER TruncateSize, IN OPTIONAL PCACHE_UNINITIALIZE_EVENT UninitializeEvent)
BOOLEAN NTAPI CcPurgeCacheSection(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, IN OPTIONAL PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN UninitializeCacheMaps)
#define EXCEPTION_EXECUTE_HANDLER
#define EXCEPTION_CONTINUE_SEARCH
#define _Function_class_(x)
DRIVER_DISPATCH(nfs41_FsdDispatch)
#define UNREFERENCED_PARAMETER(P)
#define FSRTL_VOLUME_UNLOCK
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
BOOLEAN NTAPI FsRtlIsNtstatusExpected(IN NTSTATUS NtStatus)
VOID NTAPI FsRtlNotifyCleanup(IN PNOTIFY_SYNC NotifySync, IN PLIST_ENTRY NotifyList, IN PVOID FsContext)
VOID NTAPI FsRtlNotifyFullChangeDirectory(IN PNOTIFY_SYNC NotifySync, IN PLIST_ENTRY NotifyList, IN PVOID FsContext, IN PSTRING FullDirectoryName, IN BOOLEAN WatchTree, IN BOOLEAN IgnoreBuffer, IN ULONG CompletionFilter, IN PIRP NotifyIrp, IN PCHECK_FOR_TRAVERSE_ACCESS TraverseCallback OPTIONAL, IN PSECURITY_SUBJECT_CONTEXT SubjectContext OPTIONAL)
NTSTATUS NTAPI FsRtlNotifyVolumeEvent(IN PFILE_OBJECT FileObject, IN ULONG EventCode)
VOID NTAPI IoRemoveShareAccess(IN PFILE_OBJECT FileObject, IN PSHARE_ACCESS ShareAccess)
#define IoCompleteRequest
PEPROCESS NTAPI IoGetRequestorProcess(IN PIRP Irp)
VOID NTAPI IoSetTopLevelIrp(IN PIRP Irp)
VOID NTAPI IoReleaseVpbSpinLock(IN KIRQL Irql)
VOID NTAPI IoAcquireVpbSpinLock(OUT PKIRQL Irql)
NTSTATUS NTAPI FsRtlCheckOplock(IN POPLOCK Oplock, IN PIRP Irp, IN PVOID Context, IN POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine OPTIONAL, IN POPLOCK_FS_PREPOST_IRP PostIrpRoutine OPTIONAL)
#define _SEH2_AbnormalTermination()
#define _SEH2_GetExceptionCode()
#define _SEH2_EXCEPT(...)
#define _SEH2_GetExceptionInformation()
union _FCB::@729 Specific
struct _FCB::@729::@732 Fcb
FCB_CONDITION FcbCondition
struct _FCB::@729::@731 Dcb
FSRTL_ADVANCED_FCB_HEADER Header
CLONG NonCachedUncleanCount
SECTION_OBJECT_POINTERS SectionObjectPointers
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
#define FILE_ACTION_REMOVED
#define FILE_NOTIFY_CHANGE_FILE_NAME
#define FO_CLEANUP_COMPLETE
#define VPB_DIRECT_WRITES_ALLOWED
#define IO_DISK_INCREMENT
#define FO_CACHE_SUPPORTED
#define FILE_NOTIFY_CHANGE_DIR_NAME