ReactOS  0.4.15-dev-3303-g1ade494
FxThreadedEventQueue Struct Reference

#include <fxeventqueue.hpp>

Inheritance diagram for FxThreadedEventQueue:
Collaboration diagram for FxThreadedEventQueue:

Public Member Functions

 FxThreadedEventQueue (__in UCHAR QueueDepth)
 
 ~FxThreadedEventQueue (VOID)
 
_Must_inspect_result_ NTSTATUS Init (__inout FxPkgPnp *Pnp, __in PFN_PNP_EVENT_WORKER WorkerRoutine, __in PVOID WorkerContext=NULL)
 
VOID QueueToThread (VOID)
 
- Public Member Functions inherited from FxEventQueue
 FxEventQueue (__in UCHAR QueueDepth)
 
_Must_inspect_result_ NTSTATUS Initialize (__in PFX_DRIVER_GLOBALS DriverGlobals)
 
 _Acquires_lock_ (this->m_QueueLock) __drv_maxIRQL(DISPATCH_LEVEL) __drv_setsIRQL(DISPATCH_LEVEL) VOID Lock(__out __drv_deref(__drv_savesIRQL) PKIRQL Irql)
 
 _Releases_lock_ (this->m_QueueLock) __drv_requiresIRQL(DISPATCH_LEVEL) VOID Unlock(__in __drv_restoresIRQL KIRQL Irql)
 
BOOLEAN IsFull (VOID)
 
BOOLEAN IsEmpty (VOID)
 
VOID IncrementHead (VOID)
 
UCHAR GetHead (VOID)
 
UCHAR InsertAtHead (VOID)
 
UCHAR InsertAtTail (VOID)
 
UCHAR IncrementHistoryIndex (VOID)
 
BOOLEAN IsClosedLocked (VOID)
 
VOID GetFinishedState (__inout FxPostProcessInfo *Info)
 
BOOLEAN SetFinished (__in FxCREvent *Event)
 
VOID SetDelayedDeletion (VOID)
 
- Public Member Functions inherited from FxStump
PVOID operator new (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
PVOID operator new (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in POOL_TYPE PoolType)
 
VOID operator delete (__in PVOID pointer)
 
PVOID operator new[] (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
VOID operator delete[] (__in PVOID pointer)
 

Protected Member Functions

VOID QueueWorkItem (VOID)
 
- Protected Member Functions inherited from FxEventQueue
VOID Configure (__in FxPkgPnp *Pnp, __in PFN_PNP_EVENT_WORKER WorkerRoutine, __in PVOID Context)
 
BOOLEAN QueueToThreadWorker (VOID)
 
VOID EventQueueWorker (VOID)
 
BOOLEAN IsIdleLocked (VOID)
 
- Protected Member Functions inherited from FxStump
 FxStump (VOID)
 

Protected Attributes

MxWorkItem m_WorkItem
 
WORK_QUEUE_ITEM m_EventWorkQueueItem
 
- Protected Attributes inherited from FxEventQueue
UCHAR m_QueueHead
 
UCHAR m_QueueTail
 
UCHAR m_QueueDepth
 
UCHAR m_HistoryIndex
 
FxPkgPnpm_PkgPnp
 
PVOID m_EventWorkerContext
 
MxLock m_QueueLock
 
PFN_PNP_EVENT_WORKER m_EventWorker
 
FxCREventm_WorkItemFinished
 
union {
   UCHAR   m_QueueFlags
 
   struct {
      UCHAR   WorkItemQueued: 1
 
      UCHAR   Closed: 1
 
      UCHAR   DelayDeletion: 1
 
   }   m_QueueFlagsByName
 
}; 
 
UCHAR m_WorkItemRunningCount
 

Static Protected Attributes

static WORKER_THREAD_ROUTINE _WorkerThreadRoutine
 
static MX_WORKITEM_ROUTINE _WorkItemCallback
 

Additional Inherited Members

- Public Attributes inherited from FxEventQueue
FxWaitLockInternal m_StateMachineLock
 

Detailed Description

Definition at line 334 of file fxeventqueue.hpp.

Constructor & Destructor Documentation

◆ FxThreadedEventQueue()

FxThreadedEventQueue::FxThreadedEventQueue ( __in UCHAR  QueueDepth)

Definition at line 352 of file eventqueue.cpp.

354  : FxEventQueue(QueueDepth)
355 {
358  this);
359 }
static WORKER_THREAD_ROUTINE _WorkerThreadRoutine
FxEventQueue(__in UCHAR QueueDepth)
Definition: eventqueue.cpp:36
#define ExInitializeWorkItem(Item, Routine, Context)
Definition: exfuncs.h:265
WORK_QUEUE_ITEM m_EventWorkQueueItem
WORKER_THREAD_ROUTINE * PWORKER_THREAD_ROUTINE
Definition: extypes.h:200

◆ ~FxThreadedEventQueue()

FxThreadedEventQueue::~FxThreadedEventQueue ( VOID  )

Definition at line 361 of file eventqueue.cpp.

364 {
365  m_WorkItem.Free();
366 }
__inline VOID Free()
Definition: mxworkitemkm.h:90

Member Function Documentation

◆ Init()

_Must_inspect_result_ NTSTATUS FxThreadedEventQueue::Init ( __inout FxPkgPnp Pnp,
__in PFN_PNP_EVENT_WORKER  WorkerRoutine,
__in PVOID  WorkerContext = NULL 
)

Definition at line 370 of file eventqueue.cpp.

375 {
377 
378  Configure(Pnp, WorkerRoutine, WorkerContext);
379 
380 
381  status = m_WorkItem.Allocate(Pnp->GetDevice()->GetDeviceObject());
382  if (!NT_SUCCESS(status)) {
383  return status;
384  }
385 
386  return STATUS_SUCCESS;
387 }
_Must_inspect_result_ _In_ PFLT_CALLBACK_DATA _In_ PFLT_DEFERRED_IO_WORKITEM_ROUTINE WorkerRoutine
Definition: fltkernel.h:1976
LONG NTSTATUS
Definition: precomp.h:26
_Must_inspect_result_ __inline NTSTATUS Allocate(__in MdDeviceObject DeviceObject, __in_opt PVOID ThreadPoolEnv=NULL)
Definition: mxworkitemkm.h:41
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define STATUS_SUCCESS
Definition: shellext.h:65
static SERVICE_STATUS status
Definition: service.c:31
VOID Configure(__in FxPkgPnp *Pnp, __in PFN_PNP_EVENT_WORKER WorkerRoutine, __in PVOID Context)
Definition: eventqueue.cpp:77
Definition: ps.c:97

Referenced by FxInterrupt::CreateWakeInterruptMachine(), FxPowerMachine::Init(), and FxPkgPnp::PostCreateDeviceInitialize().

◆ QueueToThread()

VOID FxThreadedEventQueue::QueueToThread ( VOID  )
inline

◆ QueueWorkItem()

VOID FxThreadedEventQueue::QueueWorkItem ( VOID  )
protected

Definition at line 400 of file eventqueue.cpp.

403 {
404  if (m_PkgPnp->HasPowerThread()) {
405  //
406  // Use the power thread for the stack
407  //
409  }
410  else {
411  //
412  // Use the work item since the power thread is not available
413  //
415  (FxEventQueue*) this);
416  }
417 }
VOID QueueToPowerThread(__in PWORK_QUEUE_ITEM WorkItem)
Definition: fxpkgpnp.hpp:3516
FxPkgPnp * m_PkgPnp
__inline VOID Enqueue(__in PMX_WORKITEM_ROUTINE Callback, __in PVOID Context)
Definition: mxworkitemkm.h:58
static MX_WORKITEM_ROUTINE _WorkItemCallback
WORK_QUEUE_ITEM m_EventWorkQueueItem
BOOLEAN HasPowerThread(VOID)
Definition: fxpkgpnp.hpp:3508

Referenced by QueueToThread().

Member Data Documentation

◆ _WorkerThreadRoutine

VOID FxThreadedEventQueue::_WorkerThreadRoutine
staticprotected

Definition at line 364 of file fxeventqueue.hpp.

Referenced by FxThreadedEventQueue().

◆ _WorkItemCallback

VOID FxThreadedEventQueue::_WorkItemCallback
staticprotected

Definition at line 368 of file fxeventqueue.hpp.

Referenced by QueueWorkItem().

◆ m_EventWorkQueueItem

WORK_QUEUE_ITEM FxThreadedEventQueue::m_EventWorkQueueItem
protected

Definition at line 378 of file fxeventqueue.hpp.

Referenced by FxThreadedEventQueue(), and QueueWorkItem().

◆ m_WorkItem

MxWorkItem FxThreadedEventQueue::m_WorkItem
protected

Definition at line 375 of file fxeventqueue.hpp.

Referenced by Init(), QueueWorkItem(), and ~FxThreadedEventQueue().


The documentation for this struct was generated from the following files: