reactos/sdk/include/ddk/rxworkq.h

110 lines
2.8 KiB
C
Raw Normal View History

#ifndef _RXWORKQ_H_
#define _RXWORKQ_H_
typedef
VOID
(NTAPI *PRX_WORKERTHREAD_ROUTINE) (
_In_ PVOID Context);
typedef struct _RX_WORK_QUEUE_ITEM_
{
WORK_QUEUE_ITEM;
PRDBSS_DEVICE_OBJECT pDeviceObject;
} RX_WORK_QUEUE_ITEM, *PRX_WORK_QUEUE_ITEM;
typedef struct _RX_WORK_DISPATCH_ITEM_
{
RX_WORK_QUEUE_ITEM WorkQueueItem;
PRX_WORKERTHREAD_ROUTINE DispatchRoutine;
PVOID DispatchRoutineParameter;
} RX_WORK_DISPATCH_ITEM, *PRX_WORK_DISPATCH_ITEM;
typedef enum _RX_WORK_QUEUE_STATE_
{
RxWorkQueueActive,
RxWorkQueueInactive,
RxWorkQueueRundownInProgress
} RX_WORK_QUEUE_STATE, *PRX_WORK_QUEUE_STATE;
typedef struct _RX_WORK_QUEUE_RUNDOWN_CONTEXT_
{
KEVENT RundownCompletionEvent;
LONG NumberOfThreadsSpunDown;
PETHREAD *ThreadPointers;
} RX_WORK_QUEUE_RUNDOWN_CONTEXT, *PRX_WORK_QUEUE_RUNDOWN_CONTEXT;
typedef struct _RX_WORK_QUEUE_
{
USHORT State;
BOOLEAN SpinUpRequestPending;
UCHAR Type;
KSPIN_LOCK SpinLock;
PRX_WORK_QUEUE_RUNDOWN_CONTEXT pRundownContext;
volatile LONG NumberOfWorkItemsDispatched;
volatile LONG NumberOfWorkItemsToBeDispatched;
LONG CumulativeQueueLength;
LONG NumberOfSpinUpRequests;
LONG MaximumNumberOfWorkerThreads;
LONG MinimumNumberOfWorkerThreads;
volatile LONG NumberOfActiveWorkerThreads;
volatile LONG NumberOfIdleWorkerThreads;
LONG NumberOfFailedSpinUpRequests;
volatile LONG WorkQueueItemForSpinUpWorkerThreadInUse;
RX_WORK_QUEUE_ITEM WorkQueueItemForTearDownWorkQueue;
RX_WORK_QUEUE_ITEM WorkQueueItemForSpinUpWorkerThread;
RX_WORK_QUEUE_ITEM WorkQueueItemForSpinDownWorkerThread;
KQUEUE Queue;
PETHREAD *ThreadPointers;
} RX_WORK_QUEUE, *PRX_WORK_QUEUE;
typedef struct _RX_WORK_QUEUE_DISPATCHER_
{
RX_WORK_QUEUE WorkQueue[RxMaximumWorkQueue];
} RX_WORK_QUEUE_DISPATCHER, *PRX_WORK_QUEUE_DISPATCHER;
typedef enum _RX_DISPATCHER_STATE_
{
RxDispatcherActive,
RxDispatcherInactive
} RX_DISPATCHER_STATE, *PRX_DISPATCHER_STATE;
typedef struct _RX_DISPATCHER_
{
LONG NumberOfProcessors;
PEPROCESS OwnerProcess;
PRX_WORK_QUEUE_DISPATCHER pWorkQueueDispatcher;
RX_DISPATCHER_STATE State;
LIST_ENTRY SpinUpRequests;
KSPIN_LOCK SpinUpRequestsLock;
KEVENT SpinUpRequestsEvent;
KEVENT SpinUpRequestsTearDownEvent;
} RX_DISPATCHER, *PRX_DISPATCHER;
[RXCE] - Implemented RxCompleteSrvOpenKeyAssociation(), RxInitiateSrvOpenKeyAssociation(), RxProcessChangeBufferingStateRequests() - Implemented RxFinalizeFcbTable(), RxFinalizeNetFobx(), RxFinalizeNetRoot(), RxFinalizeSrvCall(), RxFinalizeVNetRoot(), RxFreeObject(), RxpDestroySrvCall(), RxRemovePrefixTableEntry(), RxRemoveVirtualNetRootFromNetRoot(), RxScavengeRelatedFobxs(), RxTearDownBufferingManager(), RxUndoScavengerFinalizationMarking() - Implemented RxPostToWorkerThread() - Implemented RxFlushFcbInSystemCache(), RxPurgeFcb(), RxPurgeFcbInSystemCache() - Stubbed RxOrphanSrvOpens(), RxpDiscardChangeBufferingStateRequests(), RxpDispatchChangeBufferingStateRequests(), RxpProcessChangeBufferingStateRequests() - Continued implementation of RxDereference() so that it supports more objects than just SRV_CALL - Reworked RxInsertWorkQueueItem() implementation so that it accepts any work item, and not just dispatch work items - Finished implementation of RxTableLookupName() so that it properly returns a V_NET_ROOT on NET_ROOT match Notable effects of this commit are: - RXCE/RDBSS leak less memory; now objects without references are properly deleted from the system - This means that stale objects are also deleted; this fixes CORE-13483 were same stale SRV_CALL was used again and again - Because in prefix table NET_ROOT are correctly handled, it's now possible to mount several path from the same prefix; this fixes CORE-13482 CORE-8204 CORE-11327 CORE-13482 CORE-13483 svn path=/trunk/; revision=75195
2017-06-25 11:55:37 +00:00
NTSTATUS
NTAPI
RxPostToWorkerThread(
_In_ PRDBSS_DEVICE_OBJECT pMRxDeviceObject,
_In_ WORK_QUEUE_TYPE WorkQueueType,
_In_ PRX_WORK_QUEUE_ITEM pWorkQueueItem,
_In_ PRX_WORKERTHREAD_ROUTINE Routine,
_In_ PVOID pContext);
NTSTATUS
NTAPI
RxDispatchToWorkerThread(
_In_ PRDBSS_DEVICE_OBJECT pMRxDeviceObject,
_In_ WORK_QUEUE_TYPE WorkQueueType,
_In_ PRX_WORKERTHREAD_ROUTINE Routine,
_In_ PVOID pContext);
NTSTATUS
NTAPI
RxInitializeDispatcher(
VOID);
NTSTATUS
RxInitializeMRxDispatcher(
_Inout_ PRDBSS_DEVICE_OBJECT pMRxDeviceObject);
#endif