ReactOS 0.4.15-dev-8119-g4fb2fdb
scavengr.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _RX_SCAVENGER_ENTRY
 
struct  _RDBSS_SCAVENGER
 
struct  _PURGE_SYNCHRONIZATION_CONTEXT
 

Macros

#define RX_SCAVENGER_FINALIZATION_TIME_INTERVAL   (10 * 1000 * 1000 * 10)
 
#define RxInitializeScavengerEntry(ScavengerEntry)
 
#define RxAcquireScavengerMutex()   KeWaitForSingleObject(&RxScavengerMutex, Executive, KernelMode, FALSE, NULL)
 
#define RxReleaseScavengerMutex()   KeReleaseMutex(&RxScavengerMutex, FALSE)
 
#define DONT_ATTEMPT_FINALIZE_ON_PURGE   FALSE
 
#define ATTEMPT_FINALIZE_ON_PURGE   TRUE
 
#define RxInitializeRdbssScavenger(Scavenger, ScavengerTimeLimit)
 

Typedefs

typedef struct _RX_SCAVENGER_ENTRY RX_SCAVENGER_ENTRY
 
typedef struct _RX_SCAVENGER_ENTRYPRX_SCAVENGER_ENTRY
 
typedef enum _RDBSS_SCAVENGER_STATE RDBSS_SCAVENGER_STATE
 
typedef enum _RDBSS_SCAVENGER_STATEPRDBSS_SCAVENGER_STATE
 
typedef struct _RDBSS_SCAVENGER RDBSS_SCAVENGER
 
typedef struct _RDBSS_SCAVENGERPRDBSS_SCAVENGER
 
typedef struct _PURGE_SYNCHRONIZATION_CONTEXT PURGE_SYNCHRONIZATION_CONTEXT
 
typedef struct _PURGE_SYNCHRONIZATION_CONTEXTPPURGE_SYNCHRONIZATION_CONTEXT
 

Enumerations

enum  _RDBSS_SCAVENGER_STATE { RDBSS_SCAVENGER_INACTIVE , RDBSS_SCAVENGER_DORMANT , RDBSS_SCAVENGER_ACTIVE , RDBSS_SCAVENGER_SUSPENDED }
 

Functions

VOID RxMarkFobxOnCleanup (_In_ PFOBX pFobx, _Out_ PBOOLEAN NeedPurge)
 
VOID RxMarkFobxOnClose (_In_ PFOBX Fobx)
 
NTSTATUS RxPurgeRelatedFobxs (PNET_ROOT NetRoot, PRX_CONTEXT RxContext, BOOLEAN AttemptFinalization, PFCB PurgingFcb)
 
VOID RxInitializePurgeSyncronizationContext (_In_ PPURGE_SYNCHRONIZATION_CONTEXT PurgeSyncronizationContext)
 
BOOLEAN RxScavengeRelatedFobxs (_In_ PFCB Fcb)
 
VOID RxScavengeFobxsForNetRoot (PNET_ROOT NetRoot, PFCB PurgingFcb, BOOLEAN SynchronizeWithScavenger)
 
VOID RxpMarkInstanceForScavengedFinalization (PVOID Instance)
 
VOID RxpUndoScavengerFinalizationMarking (_In_ PVOID Instance)
 
BOOLEAN RxScavengeVNetRoots (_In_ PRDBSS_DEVICE_OBJECT RxDeviceObject)
 
VOID RxSynchronizeWithScavenger (_In_ PRX_CONTEXT RxContext)
 

Variables

KMUTEX RxScavengerMutex
 

Macro Definition Documentation

◆ ATTEMPT_FINALIZE_ON_PURGE

#define ATTEMPT_FINALIZE_ON_PURGE   TRUE

Definition at line 46 of file scavengr.h.

◆ DONT_ATTEMPT_FINALIZE_ON_PURGE

#define DONT_ATTEMPT_FINALIZE_ON_PURGE   FALSE

Definition at line 45 of file scavengr.h.

◆ RX_SCAVENGER_FINALIZATION_TIME_INTERVAL

#define RX_SCAVENGER_FINALIZATION_TIME_INTERVAL   (10 * 1000 * 1000 * 10)

Definition at line 6 of file scavengr.h.

◆ RxAcquireScavengerMutex

#define RxAcquireScavengerMutex ( )    KeWaitForSingleObject(&RxScavengerMutex, Executive, KernelMode, FALSE, NULL)

Definition at line 26 of file scavengr.h.

◆ RxInitializeRdbssScavenger

#define RxInitializeRdbssScavenger (   Scavenger,
  ScavengerTimeLimit 
)
Value:
(Scavenger)->State = RDBSS_SCAVENGER_INACTIVE; \
(Scavenger)->SrvCallsToBeFinalized = 0; \
(Scavenger)->NetRootsToBeFinalized = 0; \
(Scavenger)->VNetRootsToBeFinalized = 0; \
(Scavenger)->FcbsToBeFinalized = 0; \
(Scavenger)->SrvOpensToBeFinalized = 0; \
(Scavenger)->FobxsToBeFinalized = 0; \
(Scavenger)->NumberOfDormantFiles = 0; \
(Scavenger)->MaximumNumberOfDormantFiles = 50; \
(Scavenger)->CurrentFcbForClosePendingProcessing = NULL; \
(Scavenger)->CurrentNetRootForClosePendingProcessing = NULL; \
if ((ScavengerTimeLimit).QuadPart == 0) \
{ \
(Scavenger)->TimeLimit.QuadPart = RX_SCAVENGER_FINALIZATION_TIME_INTERVAL; \
} \
else \
{ \
(Scavenger)->TimeLimit.QuadPart = (ScavengerTimeLimit).QuadPart; \
} \
KeInitializeEvent(&((Scavenger)->SyncEvent), NotificationEvent, FALSE); \
KeInitializeEvent(&((Scavenger)->ScavengeEvent), SynchronizationEvent, TRUE); \
KeInitializeEvent(&((Scavenger)->ClosePendingProcessingSyncEvent), NotificationEvent, FALSE); \
InitializeListHead(&(Scavenger)->SrvCallFinalizationList); \
InitializeListHead(&(Scavenger)->NetRootFinalizationList); \
InitializeListHead(&(Scavenger)->VNetRootFinalizationList); \
InitializeListHead(&(Scavenger)->SrvOpenFinalizationList); \
InitializeListHead(&(Scavenger)->FcbFinalizationList); \
InitializeListHead(&(Scavenger)->FobxFinalizationList); \
InitializeListHead(&(Scavenger)->ClosePendingFobxsList)
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
@ NotificationEvent
@ SynchronizationEvent
#define RX_SCAVENGER_FINALIZATION_TIME_INTERVAL
Definition: scavengr.h:6
@ RDBSS_SCAVENGER_INACTIVE
Definition: scavengr.h:50
ret QuadPart
Definition: rtlfuncs.h:3089

Definition at line 84 of file scavengr.h.

◆ RxInitializeScavengerEntry

#define RxInitializeScavengerEntry (   ScavengerEntry)
Value:
(ScavengerEntry)->State = 0; \
(ScavengerEntry)->Flags = 0; \
(ScavengerEntry)->Type = 0; \
(ScavengerEntry)->Operation = 0; \
InitializeListHead(&(ScavengerEntry)->List); \
(ScavengerEntry)->pContinuationEntry = NULL
Type
Definition: Type.h:7
FP_OP Operation
Definition: fpcontrol.c:150
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

Definition at line 18 of file scavengr.h.

◆ RxReleaseScavengerMutex

#define RxReleaseScavengerMutex ( )    KeReleaseMutex(&RxScavengerMutex, FALSE)

Definition at line 27 of file scavengr.h.

Typedef Documentation

◆ PPURGE_SYNCHRONIZATION_CONTEXT

◆ PRDBSS_SCAVENGER

◆ PRDBSS_SCAVENGER_STATE

◆ PRX_SCAVENGER_ENTRY

◆ PURGE_SYNCHRONIZATION_CONTEXT

◆ RDBSS_SCAVENGER

◆ RDBSS_SCAVENGER_STATE

◆ RX_SCAVENGER_ENTRY

Enumeration Type Documentation

◆ _RDBSS_SCAVENGER_STATE

Enumerator
RDBSS_SCAVENGER_INACTIVE 
RDBSS_SCAVENGER_DORMANT 
RDBSS_SCAVENGER_ACTIVE 
RDBSS_SCAVENGER_SUSPENDED 

Definition at line 48 of file scavengr.h.

49{
@ RDBSS_SCAVENGER_ACTIVE
Definition: scavengr.h:52
@ RDBSS_SCAVENGER_DORMANT
Definition: scavengr.h:51
@ RDBSS_SCAVENGER_SUSPENDED
Definition: scavengr.h:53
enum _RDBSS_SCAVENGER_STATE RDBSS_SCAVENGER_STATE
enum _RDBSS_SCAVENGER_STATE * PRDBSS_SCAVENGER_STATE

Function Documentation

◆ RxInitializePurgeSyncronizationContext()

VOID RxInitializePurgeSyncronizationContext ( _In_ PPURGE_SYNCHRONIZATION_CONTEXT  PurgeSyncronizationContext)

◆ RxMarkFobxOnCleanup()

VOID RxMarkFobxOnCleanup ( _In_ PFOBX  pFobx,
_Out_ PBOOLEAN  NeedPurge 
)

Referenced by RxCommonCleanup().

◆ RxMarkFobxOnClose()

VOID RxMarkFobxOnClose ( _In_ PFOBX  Fobx)

◆ RxpMarkInstanceForScavengedFinalization()

VOID RxpMarkInstanceForScavengedFinalization ( PVOID  Instance)

Definition at line 6277 of file rxce.c.

6279{
6282 PRDBSS_SCAVENGER Scavenger;
6284 PLIST_ENTRY ScavengerHead, InstEntry;
6285
6286 PAGED_CODE();
6287
6288 /* If still referenced, don't mark it (broken caller) */
6290 if (Node->NodeReferenceCount > 1)
6291 {
6292 return;
6293 }
6294
6296 Scavenger = DeviceObject->pRdbssScavenger;
6297
6298 /* Mark the node */
6301 DPRINT("Node %p has now the scavenger mark!\n", Instance);
6302
6303 /* Increase the count in the scavenger, and queue it */
6304 ScavengerHead = NULL;
6305 switch (NodeType)
6306 {
6307 case RDBSS_NTC_FOBX:
6308 ++Scavenger->FobxsToBeFinalized;
6309 ScavengerHead = &Scavenger->FobxFinalizationList;
6310 InstEntry = &((PFOBX)Instance)->ScavengerFinalizationList;
6311 break;
6312
6313 case RDBSS_NTC_SRVCALL:
6314 ++Scavenger->SrvCallsToBeFinalized;
6315 ScavengerHead = &Scavenger->SrvCallFinalizationList;
6316 InstEntry = &((PSRV_CALL)Instance)->ScavengerFinalizationList;
6317 break;
6318
6319 case RDBSS_NTC_NETROOT:
6320 ++Scavenger->NetRootsToBeFinalized;
6321 ScavengerHead = &Scavenger->NetRootFinalizationList;
6322 InstEntry = &((PNET_ROOT)Instance)->ScavengerFinalizationList;
6323 break;
6324
6326 ++Scavenger->VNetRootsToBeFinalized;
6327 ScavengerHead = &Scavenger->VNetRootFinalizationList;
6328 InstEntry = &((PV_NET_ROOT)Instance)->ScavengerFinalizationList;
6329 break;
6330
6331 case RDBSS_NTC_SRVOPEN:
6332 ++Scavenger->SrvOpensToBeFinalized;
6333 ScavengerHead = &Scavenger->SrvOpenFinalizationList;
6334 InstEntry = &((PSRV_OPEN)Instance)->ScavengerFinalizationList;
6335 break;
6336 }
6337
6338 /* Extra ref for scavenger */
6339 InterlockedIncrement((volatile long *)&Node->NodeReferenceCount);
6340
6341 /* If matching type */
6342 if (ScavengerHead != NULL)
6343 {
6344 /* Insert in the scavenger list */
6345 InsertTailList(ScavengerHead, InstEntry);
6346
6347 /* And if it wasn't started, start it */
6348 if (Scavenger->State == RDBSS_SCAVENGER_INACTIVE)
6349 {
6350 Scavenger->State = RDBSS_SCAVENGER_DORMANT;
6353 }
6354 }
6355}
#define PAGED_CODE()
NodeType
Definition: Node.h:6
#define InterlockedIncrement
Definition: armddk.h:53
union node Node
Definition: types.h:1255
USHORT NODE_TYPE_CODE
Definition: nodetype.h:22
#define NodeType(P)
Definition: nodetype.h:51
#define InsertTailList(ListHead, Entry)
#define SetFlag(_F, _SF)
Definition: ext2fs.h:187
struct _SRV_CALL * PSRV_CALL
struct _FOBX * PFOBX
struct _V_NET_ROOT * PV_NET_ROOT
struct _SRV_OPEN * PSRV_OPEN
struct _NET_ROOT * PNET_ROOT
PRDBSS_DEVICE_OBJECT RxGetDeviceObjectOfInstance(PVOID Instance)
Definition: rxce.c:4409
NTSTATUS NTAPI RxPostOneShotTimerRequest(IN PRDBSS_DEVICE_OBJECT pDeviceObject, IN PRX_WORK_ITEM pWorkItem, IN PRX_WORKERTHREAD_ROUTINE Routine, IN PVOID pContext, IN LARGE_INTEGER TimeInterval)
Definition: rxce.c:6362
VOID NTAPI RxScavengerTimerRoutine(PVOID Context)
Definition: rxce.c:7964
PRDBSS_DEVICE_OBJECT RxFileSystemDeviceObject
Definition: rdbss.c:573
#define RDBSS_NTC_NETROOT
Definition: nodetype.h:49
#define RX_SCAVENGER_MASK
Definition: nodetype.h:70
struct _NODE_TYPE_CODE_AND_SIZE * PNODE_TYPE_AND_SIZE
#define RDBSS_NTC_SRVCALL
Definition: nodetype.h:48
#define RDBSS_NTC_FOBX
Definition: nodetype.h:57
#define RDBSS_NTC_V_NETROOT
Definition: nodetype.h:50
#define RDBSS_NTC_SRVOPEN
Definition: nodetype.h:52
#define DPRINT
Definition: sndvol32.h:73
Definition: typedefs.h:120
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 VNetRootFinalizationList
Definition: scavengr.h:70
LIST_ENTRY SrvOpenFinalizationList
Definition: scavengr.h:72
ULONG FobxsToBeFinalized
Definition: scavengr.h:67
ULONG SrvOpensToBeFinalized
Definition: scavengr.h:66
RDBSS_SCAVENGER_STATE State
Definition: scavengr.h:58
LIST_ENTRY NetRootFinalizationList
Definition: scavengr.h:69
ULONG VNetRootsToBeFinalized
Definition: scavengr.h:64
LIST_ENTRY SrvCallFinalizationList
Definition: scavengr.h:68
Definition: dlist.c:348
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_INSTANCE_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_opt_ WDFWMIINSTANCE * Instance
Definition: wdfwmi.h:481

Referenced by RxDereference().

◆ RxpUndoScavengerFinalizationMarking()

VOID RxpUndoScavengerFinalizationMarking ( _In_ PVOID  Instance)

◆ RxPurgeRelatedFobxs()

NTSTATUS RxPurgeRelatedFobxs ( PNET_ROOT  NetRoot,
PRX_CONTEXT  RxContext,
BOOLEAN  AttemptFinalization,
PFCB  PurgingFcb 
)

Definition at line 7133 of file rxce.c.

7138{
7140 ULONG SuccessfullPurge;
7141 PRDBSS_SCAVENGER Scavenger;
7142 PRDBSS_DEVICE_OBJECT RxDeviceObject;
7143 PPURGE_SYNCHRONIZATION_CONTEXT PurgeSyncCtx;
7144
7145 PAGED_CODE();
7146
7147 RxDeviceObject = RxContext->RxDeviceObject;
7148 Scavenger = RxDeviceObject->pRdbssScavenger;
7149 PurgeSyncCtx = &NetRoot->PurgeSyncronizationContext;
7150
7152
7153 /* If there's already a purge in progress */
7154 if (PurgeSyncCtx->PurgeInProgress)
7155 {
7156 /* Add our RX_CONTEXT to the current run */
7158 &RxContext->RxContextSerializationQLinks);
7159
7160 /* And wait until it's done */
7162 RxWaitSync(RxContext);
7164 }
7165
7166 /* Start the purge */
7167 PurgeSyncCtx->PurgeInProgress = TRUE;
7168
7169 /* While the purge is still handling our NET_ROOT, do nothing but wait */
7170 while (Scavenger->CurrentNetRootForClosePendingProcessing == NetRoot)
7171 {
7174 KernelMode, TRUE, NULL);
7176 }
7177
7178 /* Now, for all the entries */
7179 SuccessfullPurge = 0;
7180 Entry = Scavenger->ClosePendingFobxsList.Flink;
7181 while (Entry != &Scavenger->ClosePendingFobxsList)
7182 {
7183 PFCB Fcb;
7184 PFOBX Fobx;
7186
7187 Fobx = CONTAINING_RECORD(Entry, FOBX, ClosePendingList);
7188 DPRINT("Dealing with FOBX: %p\n", Fobx);
7189
7190 Entry = Entry->Flink;
7191
7192 /* If it's not matching our NET_ROOT, ignore */
7193 if (Fobx->pSrvOpen == NULL ||
7194 Fobx->pSrvOpen->pFcb == NULL ||
7195 ((PFCB)Fobx->pSrvOpen->pFcb)->VNetRoot == NULL ||
7196 (PNET_ROOT)((PFCB)Fobx->pSrvOpen->pFcb)->VNetRoot->pNetRoot != NetRoot)
7197 {
7198 continue;
7199 }
7200
7201 /* Determine if it matches our FCB */
7202 Fcb = (PFCB)Fobx->pSrvOpen->pFcb;
7203 if (PurgingFcb != NULL && NodeType(PurgingFcb) != RDBSS_NTC_STORAGE_TYPE_DIRECTORY &&
7204 PurgingFcb != Fcb)
7205 {
7207
7208 MINIRDR_CALL_THROUGH(Status, RxDeviceObject->Dispatch, MRxAreFilesAliased, (Fcb, PurgingFcb));
7209 if (Status == STATUS_SUCCESS)
7210 {
7211 continue;
7212 }
7213 }
7214
7215 /* Matching, we'll purge it */
7217
7218 /* Reference it so that it doesn't disappear */
7219 RxReferenceNetFobx(Fobx);
7220
7222
7223 /* And purge */
7224 Success = RxPurgeFobx(Fobx);
7225 if (Success)
7226 {
7227 ++SuccessfullPurge;
7228 }
7229
7230 /* If we don't have to finalize it (or if we cannot acquire lock exclusively
7231 * Just normally dereference
7232 */
7233 if ((AttemptFinalization == DONT_ATTEMPT_FINALIZE_ON_PURGE) ||
7235 {
7237 }
7238 /* Otherwise, finalize */
7239 else
7240 {
7244 {
7246 }
7247 }
7248
7249 if (!Success)
7250 {
7251 DPRINT1("Failed purging %p (%p)\n", Fcb, Fobx);
7252 }
7253
7255 }
7256
7257 /* If no contexts left, purge is not running */
7258 if (IsListEmpty(&PurgeSyncCtx->ContextsAwaitingPurgeCompletion))
7259 {
7260 PurgeSyncCtx->PurgeInProgress = FALSE;
7261 }
7262 /* Otherwise, notify a waiter it can start */
7263 else
7264 {
7266
7268 Context = CONTAINING_RECORD(Entry, RX_CONTEXT, RxContextSerializationQLinks);
7269
7271 }
7272
7274
7275 return (SuccessfullPurge > 0 ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL);
7276}
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
_In_ PFCB Fcb
Definition: cdprocs.h:159
FCB * PFCB
Definition: cdstruc.h:1040
#define RemoveEntryList(Entry)
Definition: env_spec_w32.h:986
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
Definition: env_spec_w32.h:478
#define RemoveHeadList(ListHead)
Definition: env_spec_w32.h:964
@ Success
Definition: eventcreate.c:712
#define RxReferenceNetFobx(Fobx)
Definition: fcb.h:415
#define RxReferenceNetFcb(Fcb)
Definition: fcb.h:431
#define RxDereferenceAndFinalizeNetFcb(Fcb, RxContext, RecursiveFinalize, ForceFinalize)
Definition: fcb.h:439
#define RxDereferenceNetFobx(Fobx, LockHoldingState)
Definition: fcb.h:419
Status
Definition: gdiplustypes.h:25
if(dx< 0)
Definition: linetemp.h:194
#define KernelMode
Definition: asm.h:34
BOOLEAN RxPurgeFobx(PFOBX pFobx)
Definition: rxce.c:7051
#define RxWaitSync(RxContext)
Definition: rxcontx.h:412
#define RxSignalSynchronousWaiter(RxContext)
Definition: rxcontx.h:417
#define MINIRDR_CALL_THROUGH(STATUS, DISPATCH, FUNC, ARGLIST)
Definition: rxcontx.h:375
#define RxAcquireExclusiveFcb(R, F)
Definition: rxprocs.h:154
#define RxReleaseFcb(R, F)
Definition: rxprocs.h:186
@ LHS_LockNotHeld
Definition: rxstruc.h:20
@ LHS_ExclusiveLockHeld
Definition: rxstruc.h:22
#define DONT_ATTEMPT_FINALIZE_ON_PURGE
Definition: scavengr.h:45
#define RxReleaseScavengerMutex()
Definition: scavengr.h:27
#define RxAcquireScavengerMutex()
Definition: scavengr.h:26
#define RDBSS_NTC_STORAGE_TYPE_DIRECTORY
Definition: nodetype.h:42
#define STATUS_SUCCESS
Definition: shellext.h:65
base of all file and directory entries
Definition: entries.h:83
Definition: cdstruc.h:902
Definition: fcb.h:305
LIST_ENTRY ClosePendingList
Definition: fcb.h:318
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
Definition: fcb.h:34
PURGE_SYNCHRONIZATION_CONTEXT PurgeSyncronizationContext
Definition: fcb.h:48
LIST_ENTRY ContextsAwaitingPurgeCompletion
Definition: scavengr.h:117
PMINIRDR_DISPATCH Dispatch
Definition: rxstruc.h:89
PRDBSS_SCAVENGER pRdbssScavenger
Definition: rxstruc.h:129
PNET_ROOT CurrentNetRootForClosePendingProcessing
Definition: scavengr.h:79
LIST_ENTRY ClosePendingFobxsList
Definition: scavengr.h:74
KEVENT ClosePendingProcessingSyncEvent
Definition: scavengr.h:81
PRDBSS_DEVICE_OBJECT RxDeviceObject
Definition: rxcontx.h:116
LIST_ENTRY RxContextSerializationQLinks
Definition: rxcontx.h:154
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
@ Executive
Definition: ketypes.h:415

Referenced by RxCommonCreate(), RxCommonSetInformation(), and RxCreateFromNetRoot().

◆ RxScavengeFobxsForNetRoot()

VOID RxScavengeFobxsForNetRoot ( PNET_ROOT  NetRoot,
PFCB  PurgingFcb,
BOOLEAN  SynchronizeWithScavenger 
)

Definition at line 7798 of file rxce.c.

7802{
7803 PRDBSS_SCAVENGER Scavenger;
7804 PRDBSS_DEVICE_OBJECT RxDeviceObject;
7805
7806 PAGED_CODE();
7807
7808 RxDeviceObject = NetRoot->pSrvCall->RxDeviceObject;
7809 Scavenger = RxDeviceObject->pRdbssScavenger;
7810
7811 /* Wait for the scavenger, if asked to */
7812 if (SynchronizeWithScavenger)
7813 {
7815 }
7816
7818
7819 /* If there's nothing left to do... */
7820 if (Scavenger->FobxsToBeFinalized <= 0)
7821 {
7823 }
7824 else
7825 {
7827 LIST_ENTRY FobxToScavenge;
7828
7829 InitializeListHead(&FobxToScavenge);
7830
7831 /* Browse all the FOBXs to finalize */
7832 Entry = Scavenger->FobxFinalizationList.Flink;
7833 while (Entry != &Scavenger->FobxFinalizationList)
7834 {
7835 PFOBX Fobx;
7836
7837 Fobx = CONTAINING_RECORD(Entry, FOBX, ScavengerFinalizationList);
7838 Entry = Entry->Flink;
7839
7840 if (Fobx->SrvOpen != NULL)
7841 {
7842 PFCB Fcb;
7843
7844 Fcb = (PFCB)Fobx->SrvOpen->pFcb;
7845
7846 /* If it matches our NET_ROOT */
7847 if ((PNET_ROOT)Fcb->pNetRoot == NetRoot)
7848 {
7850
7851 /* Check whether it matches our FCB */
7853 if (PurgingFcb != NULL && PurgingFcb != Fcb)
7854 {
7855 MINIRDR_CALL_THROUGH(Status, RxDeviceObject->Dispatch, MRxAreFilesAliased, (Fcb, PurgingFcb));
7856 }
7857
7858 /* If so, add it to the list of the FOBXs to scavenge */
7859 if (Status != STATUS_SUCCESS)
7860 {
7861 RxReferenceNetFobx(Fobx);
7862 ASSERT(NodeType(Fobx) == RDBSS_NTC_FOBX);
7863
7865 InsertTailList(&FobxToScavenge, &Fobx->ScavengerFinalizationList);
7866 }
7867 }
7868 }
7869 }
7870
7872
7873 /* Now, scavenge all the extracted FOBX */
7874 RxpScavengeFobxs(Scavenger, &FobxToScavenge);
7875 }
7876
7877 if (SynchronizeWithScavenger)
7878 {
7880 }
7881}
#define KeSetEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:476
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define ASSERT(a)
Definition: mode.c:44
VOID RxpScavengeFobxs(PRDBSS_SCAVENGER Scavenger, PLIST_ENTRY FobxToScavenge)
Definition: rxce.c:6695
#define STATUS_MORE_PROCESSING_REQUIRED
Definition: shellext.h:68
PSRV_OPEN SrvOpen
Definition: fcb.h:312
LIST_ENTRY ScavengerFinalizationList
Definition: fcb.h:317
KEVENT ScavengeEvent
Definition: scavengr.h:77
#define IO_NO_INCREMENT
Definition: iotypes.h:598

Referenced by RxCommonCreate(), and RxCommonSetInformation().

◆ RxScavengeRelatedFobxs()

BOOLEAN RxScavengeRelatedFobxs ( _In_ PFCB  Fcb)

◆ RxScavengeVNetRoots()

BOOLEAN RxScavengeVNetRoots ( _In_ PRDBSS_DEVICE_OBJECT  RxDeviceObject)

Referenced by RxCreateTreeConnect().

◆ RxSynchronizeWithScavenger()

VOID RxSynchronizeWithScavenger ( _In_ PRX_CONTEXT  RxContext)

Referenced by RxCommonClose().

Variable Documentation

◆ RxScavengerMutex

KMUTEX RxScavengerMutex
extern

Definition at line 608 of file rdbss.c.

Referenced by RxDriverEntry().