ReactOS  0.4.15-dev-489-g75a0787
scavengr.h
Go to the documentation of this file.
1 #ifndef _SCAVENGR_H_
2 #define _SCAVENGR_H_
3 
5 
6 #define RX_SCAVENGER_FINALIZATION_TIME_INTERVAL (10 * 1000 * 1000 * 10)
7 
8 typedef struct _RX_SCAVENGER_ENTRY
9 {
17 
18 #define RxInitializeScavengerEntry(ScavengerEntry) \
19  (ScavengerEntry)->State = 0; \
20  (ScavengerEntry)->Flags = 0; \
21  (ScavengerEntry)->Type = 0; \
22  (ScavengerEntry)->Operation = 0; \
23  InitializeListHead(&(ScavengerEntry)->List); \
24  (ScavengerEntry)->pContinuationEntry = NULL
25 
26 #define RxAcquireScavengerMutex() KeWaitForSingleObject(&RxScavengerMutex, Executive, KernelMode, FALSE, NULL)
27 #define RxReleaseScavengerMutex() KeReleaseMutex(&RxScavengerMutex, FALSE)
28 
29 VOID
31  _In_ PFOBX pFobx,
32  _Out_ PBOOLEAN NeedPurge);
33 
34 VOID
36  _In_ PFOBX Fobx);
37 
40  PNET_ROOT NetRoot,
41  PRX_CONTEXT RxContext,
42  BOOLEAN AttemptFinalization,
43  PFCB PurgingFcb);
44 
45 #define DONT_ATTEMPT_FINALIZE_ON_PURGE FALSE
46 #define ATTEMPT_FINALIZE_ON_PURGE TRUE
47 
49 {
55 
56 typedef struct _RDBSS_SCAVENGER
57 {
83 
84 #define RxInitializeRdbssScavenger(Scavenger, ScavengerTimeLimit) \
85  (Scavenger)->State = RDBSS_SCAVENGER_INACTIVE; \
86  (Scavenger)->SrvCallsToBeFinalized = 0; \
87  (Scavenger)->NetRootsToBeFinalized = 0; \
88  (Scavenger)->VNetRootsToBeFinalized = 0; \
89  (Scavenger)->FcbsToBeFinalized = 0; \
90  (Scavenger)->SrvOpensToBeFinalized = 0; \
91  (Scavenger)->FobxsToBeFinalized = 0; \
92  (Scavenger)->NumberOfDormantFiles = 0; \
93  (Scavenger)->MaximumNumberOfDormantFiles = 50; \
94  (Scavenger)->CurrentFcbForClosePendingProcessing = NULL; \
95  (Scavenger)->CurrentNetRootForClosePendingProcessing = NULL; \
96  if ((ScavengerTimeLimit).QuadPart == 0) \
97  { \
98  (Scavenger)->TimeLimit.QuadPart = RX_SCAVENGER_FINALIZATION_TIME_INTERVAL; \
99  } \
100  else \
101  { \
102  (Scavenger)->TimeLimit.QuadPart = (ScavengerTimeLimit).QuadPart; \
103  } \
104  KeInitializeEvent(&((Scavenger)->SyncEvent), NotificationEvent, FALSE); \
105  KeInitializeEvent(&((Scavenger)->ScavengeEvent), SynchronizationEvent, TRUE); \
106  KeInitializeEvent(&((Scavenger)->ClosePendingProcessingSyncEvent), NotificationEvent, FALSE); \
107  InitializeListHead(&(Scavenger)->SrvCallFinalizationList); \
108  InitializeListHead(&(Scavenger)->NetRootFinalizationList); \
109  InitializeListHead(&(Scavenger)->VNetRootFinalizationList); \
110  InitializeListHead(&(Scavenger)->SrvOpenFinalizationList); \
111  InitializeListHead(&(Scavenger)->FcbFinalizationList); \
112  InitializeListHead(&(Scavenger)->FobxFinalizationList); \
113  InitializeListHead(&(Scavenger)->ClosePendingFobxsList)
114 
116 {
120 
121 VOID
123  _In_ PPURGE_SYNCHRONIZATION_CONTEXT PurgeSyncronizationContext);
124 
125 BOOLEAN
127  _In_ PFCB Fcb);
128 
129 VOID
131  PNET_ROOT NetRoot,
132  PFCB PurgingFcb,
133  BOOLEAN SynchronizeWithScavenger);
134 
135 VOID
137  PVOID Instance);
138 
139 VOID
142 
143 BOOLEAN
145  _In_ PRDBSS_DEVICE_OBJECT RxDeviceObject);
146 
147 #if (_WIN32_WINNT >= 0x0600)
148 VOID
150  _In_ PRX_CONTEXT RxContext,
151  _In_ PFCB Fcb);
152 #else
153 VOID
155  _In_ PRX_CONTEXT RxContext);
156 #endif
157 
158 #endif
LIST_ENTRY ContextsAwaitingPurgeCompletion
Definition: scavengr.h:117
LIST_ENTRY SrvCallFinalizationList
Definition: scavengr.h:68
volatile LONG NumberOfDormantFiles
Definition: scavengr.h:60
LIST_ENTRY FcbFinalizationList
Definition: scavengr.h:71
Definition: cdstruc.h:908
VOID RxMarkFobxOnCleanup(_In_ PFOBX pFobx, _Out_ PBOOLEAN NeedPurge)
UCHAR State
Definition: scavengr.h:13
UCHAR Type
Definition: scavengr.h:11
LONG NTSTATUS
Definition: precomp.h:26
Definition: fcb.h:33
PNET_ROOT CurrentNetRootForClosePendingProcessing
Definition: scavengr.h:79
_RDBSS_SCAVENGER_STATE
Definition: scavengr.h:48
struct _PURGE_SYNCHRONIZATION_CONTEXT * PPURGE_SYNCHRONIZATION_CONTEXT
ULONG VNetRootsToBeFinalized
Definition: scavengr.h:64
LONG MaximumNumberOfDormantFiles
Definition: scavengr.h:59
struct _PURGE_SYNCHRONIZATION_CONTEXT PURGE_SYNCHRONIZATION_CONTEXT
Definition: fcb.h:304
VOID RxMarkFobxOnClose(_In_ PFOBX Fobx)
VOID RxpMarkInstanceForScavengedFinalization(PVOID Instance)
Definition: rxce.c:6277
KMUTEX RxScavengerMutex
Definition: rdbss.c:608
KEVENT ClosePendingProcessingSyncEvent
Definition: scavengr.h:81
LIST_ENTRY VNetRootFinalizationList
Definition: scavengr.h:70
Definition: scavengr.h:8
enum _RDBSS_SCAVENGER_STATE RDBSS_SCAVENGER_STATE
long LONG
Definition: pedump.c:60
struct _RDBSS_SCAVENGER * PRDBSS_SCAVENGER
ULONG FobxsToBeFinalized
Definition: scavengr.h:67
unsigned char BOOLEAN
enum _RDBSS_SCAVENGER_STATE * PRDBSS_SCAVENGER_STATE
ULONG SrvCallsToBeFinalized
Definition: scavengr.h:62
#define _Out_
Definition: no_sal2.h:323
PFCB CurrentFcbForClosePendingProcessing
Definition: scavengr.h:80
NTSTATUS RxPurgeRelatedFobxs(PNET_ROOT NetRoot, PRX_CONTEXT RxContext, BOOLEAN AttemptFinalization, PFCB PurgingFcb)
Definition: rxce.c:7133
VOID RxpUndoScavengerFinalizationMarking(_In_ PVOID Instance)
RDBSS_SCAVENGER_STATE State
Definition: scavengr.h:58
PETHREAD CurrentScavengerThread
Definition: scavengr.h:78
VOID RxInitializePurgeSyncronizationContext(_In_ PPURGE_SYNCHRONIZATION_CONTEXT PurgeSyncronizationContext)
VOID RxSynchronizeWithScavenger(_In_ PRX_CONTEXT RxContext)
UCHAR Flags
Definition: scavengr.h:14
RX_WORK_ITEM WorkItem
Definition: scavengr.h:75
struct _RX_SCAVENGER_ENTRY * pContinuationEntry
Definition: scavengr.h:15
KEVENT SyncEvent
Definition: scavengr.h:76
LIST_ENTRY ClosePendingFobxsList
Definition: scavengr.h:74
BOOLEAN RxScavengeRelatedFobxs(_In_ PFCB Fcb)
ULONG SrvOpensToBeFinalized
Definition: scavengr.h:66
unsigned char UCHAR
Definition: xmlstorage.h:181
char * PBOOLEAN
Definition: retypes.h:11
VOID RxScavengeFobxsForNetRoot(PNET_ROOT NetRoot, PFCB PurgingFcb, BOOLEAN SynchronizeWithScavenger)
Definition: rxce.c:7798
Definition: typedefs.h:118
struct _RX_SCAVENGER_ENTRY RX_SCAVENGER_ENTRY
#define _In_
Definition: no_sal2.h:204
LIST_ENTRY List
Definition: scavengr.h:10
LIST_ENTRY FobxFinalizationList
Definition: scavengr.h:73
UCHAR Operation
Definition: scavengr.h:12
struct _RDBSS_SCAVENGER RDBSS_SCAVENGER
ULONG FcbsToBeFinalized
Definition: scavengr.h:65
IN PVOID Instance
Definition: pci.h:361
struct _RX_SCAVENGER_ENTRY * PRX_SCAVENGER_ENTRY
unsigned int ULONG
Definition: retypes.h:1
LIST_ENTRY NetRootFinalizationList
Definition: scavengr.h:69
_In_ PFCB Fcb
Definition: cdprocs.h:159
ULONG NetRootsToBeFinalized
Definition: scavengr.h:63
LARGE_INTEGER TimeLimit
Definition: scavengr.h:61
BOOLEAN RxScavengeVNetRoots(_In_ PRDBSS_DEVICE_OBJECT RxDeviceObject)
LIST_ENTRY SrvOpenFinalizationList
Definition: scavengr.h:72
KEVENT ScavengeEvent
Definition: scavengr.h:77