ReactOS 0.4.16-dev-251-ga17b6e9
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
8typedef 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
29VOID
31 _In_ PFOBX pFobx,
32 _Out_ PBOOLEAN NeedPurge);
33
34VOID
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
56typedef 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
121VOID
123 _In_ PPURGE_SYNCHRONIZATION_CONTEXT PurgeSyncronizationContext);
124
127 _In_ PFCB Fcb);
128
129VOID
131 PNET_ROOT NetRoot,
132 PFCB PurgingFcb,
133 BOOLEAN SynchronizeWithScavenger);
134
135VOID
138
139VOID
142
145 _In_ PRDBSS_DEVICE_OBJECT RxDeviceObject);
146
147#if (_WIN32_WINNT >= 0x0600)
148VOID
150 _In_ PRX_CONTEXT RxContext,
151 _In_ PFCB Fcb);
152#else
153VOID
155 _In_ PRX_CONTEXT RxContext);
156#endif
157
158#endif
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
_In_ PFCB Fcb
Definition: cdprocs.h:159
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
long LONG
Definition: pedump.c:60
VOID RxSynchronizeWithScavenger(_In_ PRX_CONTEXT RxContext)
BOOLEAN RxScavengeRelatedFobxs(_In_ PFCB Fcb)
VOID RxMarkFobxOnClose(_In_ PFOBX Fobx)
VOID RxInitializePurgeSyncronizationContext(_In_ PPURGE_SYNCHRONIZATION_CONTEXT PurgeSyncronizationContext)
VOID RxMarkFobxOnCleanup(_In_ PFOBX pFobx, _Out_ PBOOLEAN NeedPurge)
struct _PURGE_SYNCHRONIZATION_CONTEXT PURGE_SYNCHRONIZATION_CONTEXT
struct _RX_SCAVENGER_ENTRY * PRX_SCAVENGER_ENTRY
_RDBSS_SCAVENGER_STATE
Definition: scavengr.h:49
@ RDBSS_SCAVENGER_INACTIVE
Definition: scavengr.h:50
@ RDBSS_SCAVENGER_ACTIVE
Definition: scavengr.h:52
@ RDBSS_SCAVENGER_DORMANT
Definition: scavengr.h:51
@ RDBSS_SCAVENGER_SUSPENDED
Definition: scavengr.h:53
struct _RX_SCAVENGER_ENTRY RX_SCAVENGER_ENTRY
VOID RxScavengeFobxsForNetRoot(PNET_ROOT NetRoot, PFCB PurgingFcb, BOOLEAN SynchronizeWithScavenger)
Definition: rxce.c:7798
KMUTEX RxScavengerMutex
Definition: rdbss.c:608
VOID RxpMarkInstanceForScavengedFinalization(PVOID Instance)
Definition: rxce.c:6277
struct _RDBSS_SCAVENGER * PRDBSS_SCAVENGER
struct _PURGE_SYNCHRONIZATION_CONTEXT * PPURGE_SYNCHRONIZATION_CONTEXT
struct _RDBSS_SCAVENGER RDBSS_SCAVENGER
NTSTATUS RxPurgeRelatedFobxs(PNET_ROOT NetRoot, PRX_CONTEXT RxContext, BOOLEAN AttemptFinalization, PFCB PurgingFcb)
Definition: rxce.c:7133
VOID RxpUndoScavengerFinalizationMarking(_In_ PVOID Instance)
enum _RDBSS_SCAVENGER_STATE RDBSS_SCAVENGER_STATE
BOOLEAN RxScavengeVNetRoots(_In_ PRDBSS_DEVICE_OBJECT RxDeviceObject)
enum _RDBSS_SCAVENGER_STATE * PRDBSS_SCAVENGER_STATE
Definition: cdstruc.h:902
Definition: fcb.h:305
Definition: typedefs.h:120
Definition: fcb.h:34
LIST_ENTRY ContextsAwaitingPurgeCompletion
Definition: scavengr.h:117
PNET_ROOT CurrentNetRootForClosePendingProcessing
Definition: scavengr.h:79
ULONG NetRootsToBeFinalized
Definition: scavengr.h:63
RX_WORK_ITEM WorkItem
Definition: scavengr.h:75
LIST_ENTRY FobxFinalizationList
Definition: scavengr.h:73
ULONG SrvCallsToBeFinalized
Definition: scavengr.h:62
LARGE_INTEGER TimeLimit
Definition: scavengr.h:61
LIST_ENTRY ClosePendingFobxsList
Definition: scavengr.h:74
PETHREAD CurrentScavengerThread
Definition: scavengr.h:78
KEVENT ClosePendingProcessingSyncEvent
Definition: scavengr.h:81
volatile LONG NumberOfDormantFiles
Definition: scavengr.h:60
LIST_ENTRY VNetRootFinalizationList
Definition: scavengr.h:70
PFCB CurrentFcbForClosePendingProcessing
Definition: scavengr.h:80
LIST_ENTRY SrvOpenFinalizationList
Definition: scavengr.h:72
ULONG FcbsToBeFinalized
Definition: scavengr.h:65
ULONG FobxsToBeFinalized
Definition: scavengr.h:67
ULONG SrvOpensToBeFinalized
Definition: scavengr.h:66
LONG MaximumNumberOfDormantFiles
Definition: scavengr.h:59
LIST_ENTRY FcbFinalizationList
Definition: scavengr.h:71
RDBSS_SCAVENGER_STATE State
Definition: scavengr.h:58
KEVENT SyncEvent
Definition: scavengr.h:76
LIST_ENTRY NetRootFinalizationList
Definition: scavengr.h:69
KEVENT ScavengeEvent
Definition: scavengr.h:77
ULONG VNetRootsToBeFinalized
Definition: scavengr.h:64
LIST_ENTRY SrvCallFinalizationList
Definition: scavengr.h:68
Definition: scavengr.h:9
UCHAR Flags
Definition: scavengr.h:14
LIST_ENTRY List
Definition: scavengr.h:10
UCHAR State
Definition: scavengr.h:13
UCHAR Type
Definition: scavengr.h:11
struct _RX_SCAVENGER_ENTRY * pContinuationEntry
Definition: scavengr.h:15
UCHAR Operation
Definition: scavengr.h:12
unsigned char * PBOOLEAN
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_INSTANCE_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_opt_ WDFWMIINSTANCE * Instance
Definition: wdfwmi.h:481
unsigned char UCHAR
Definition: xmlstorage.h:181