ReactOS 0.4.15-dev-8109-gd7be748
cleanup.c File Reference
#include "ntfs.h"
#include <debug.h>
Include dependency graph for cleanup.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

NTSTATUS NtfsCleanupFile (PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject, BOOLEAN CanWait)
 
NTSTATUS NtfsCleanup (PNTFS_IRP_CONTEXT IrpContext)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 31 of file cleanup.c.

Function Documentation

◆ NtfsCleanup()

NTSTATUS NtfsCleanup ( PNTFS_IRP_CONTEXT  IrpContext)

Definition at line 89 of file cleanup.c.

90{
91 PDEVICE_EXTENSION DeviceExtension;
95
96 DPRINT("NtfsCleanup() called\n");
97
98 DeviceObject = IrpContext->DeviceObject;
100 {
101 DPRINT("Cleaning up file system\n");
102 IrpContext->Irp->IoStatus.Information = 0;
103 return STATUS_SUCCESS;
104 }
105
106 FileObject = IrpContext->FileObject;
107 DeviceExtension = DeviceObject->DeviceExtension;
108
109 if (!ExAcquireResourceExclusiveLite(&DeviceExtension->DirResource,
111 {
112 return NtfsMarkIrpContextForQueue(IrpContext);
113 }
114
115 Status = NtfsCleanupFile(DeviceExtension, FileObject, BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT));
116
117 ExReleaseResourceLite(&DeviceExtension->DirResource);
118
119 if (Status == STATUS_PENDING)
120 {
121 return NtfsMarkIrpContextForQueue(IrpContext);
122 }
123
124 IrpContext->Irp->IoStatus.Information = 0;
125 return Status;
126}
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NtfsCleanupFile(PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject, BOOLEAN CanWait)
Definition: cleanup.c:40
PNTFS_GLOBAL_DATA NtfsGlobalData
Definition: ntfs.c:36
FORCEINLINE NTSTATUS NtfsMarkIrpContextForQueue(PNTFS_IRP_CONTEXT IrpContext)
Definition: ntfs.h:569
#define IRPCONTEXT_CANWAIT
Definition: ntfs.h:474
#define ExAcquireResourceExclusiveLite(res, wait)
Definition: env_spec_w32.h:615
#define BooleanFlagOn(F, SF)
Definition: ext2fs.h:183
Status
Definition: gdiplustypes.h:25
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1822
#define STATUS_PENDING
Definition: ntstatus.h:82
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:73
PDEVICE_OBJECT DeviceObject
Definition: ntfs.h:148
PFILE_OBJECT FileObject
Definition: ntfs.h:489
ULONG Flags
Definition: ntfs.h:481
PDEVICE_OBJECT DeviceObject
Definition: ntfs.h:488
IO_STATUS_BLOCK IoStatus
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:550
* PFILE_OBJECT
Definition: iotypes.h:1998

Referenced by NtfsDispatch().

◆ NtfsCleanupFile()

NTSTATUS NtfsCleanupFile ( PDEVICE_EXTENSION  DeviceExt,
PFILE_OBJECT  FileObject,
BOOLEAN  CanWait 
)

Definition at line 40 of file cleanup.c.

43{
45
46 DPRINT("NtfsCleanupFile(DeviceExt %p, FileObject %p, CanWait %u)\n",
47 DeviceExt,
49 CanWait);
50
51 Fcb = (PNTFS_FCB)(FileObject->FsContext);
52 if (!Fcb)
53 return STATUS_SUCCESS;
54
55 if (Fcb->Flags & FCB_IS_VOLUME)
56 {
58
59 if (Fcb->OpenHandleCount != 0)
60 {
61 // Remove share access when handled
62 }
63 }
64 else
65 {
67 {
68 return STATUS_PENDING;
69 }
70
72
74
75 if (Fcb->OpenHandleCount != 0)
76 {
77 // Remove share access when handled
78 }
79
81
83 }
84
85 return STATUS_SUCCESS;
86}
_In_ PFCB Fcb
Definition: cdprocs.h:159
#define NULL
Definition: types.h:112
struct _FCB * PNTFS_FCB
#define FCB_IS_VOLUME
Definition: ntfs.h:510
BOOLEAN NTAPI CcUninitializeCacheMap(IN PFILE_OBJECT FileObject, IN OPTIONAL PLARGE_INTEGER TruncateSize, IN OPTIONAL PCACHE_UNINITIALIZE_EVENT UninitializeEvent)
Definition: fssup.c:286
Definition: cdstruc.h:902
ULONG Flags
Definition: ntfs.h:536
FSRTL_COMMON_FCB_HEADER RFCB
Definition: ntfs.h:517
ULONG OpenHandleCount
Definition: ntfs.h:537
ERESOURCE MainResource
Definition: ntfs.h:528
#define FO_CLEANUP_COMPLETE
Definition: iotypes.h:1790

Referenced by NtfsCleanup().