ReactOS 0.4.15-dev-7677-g8209aa5
MxWorkItem Class Reference

#include <mxworkitem.h>

Inheritance diagram for MxWorkItem:
Collaboration diagram for MxWorkItem:

Public Member Functions

__inline MxWorkItem ()
 
VOID WaitForCallbacksToComplete (VOID)
 
_Must_inspect_result_ __inline NTSTATUS Allocate (__in MdDeviceObject DeviceObject, __in_opt PVOID ThreadPoolEnv=NULL)
 
__inline VOID Enqueue (__in PMX_WORKITEM_ROUTINE Callback, __in PVOID Context)
 
__inline MdWorkItem GetWorkItem ()
 
__inline VOID Free ()
 
__inline ~MxWorkItem ()
 

Static Public Member Functions

static VOID CALLBACK _WorkerThunk (_Inout_ PTP_CALLBACK_INSTANCE Instance, _Inout_opt_ PVOID Parameter, _Inout_ PTP_WAIT Wait, _In_ TP_WAIT_RESULT WaitResult)
 
static __inline VOID _Free (__in MdWorkItem Item)
 

Protected Attributes

MdWorkItem m_WorkItem
 

Detailed Description

Definition at line 28 of file mxworkitem.h.

Constructor & Destructor Documentation

◆ MxWorkItem()

__inline MxWorkItem::MxWorkItem ( )

Definition at line 32 of file mxworkitemkm.h.

34{
36}
MdWorkItem m_WorkItem
Definition: mxworkitem.h:32
#define NULL
Definition: types.h:112

◆ ~MxWorkItem()

__inline MxWorkItem::~MxWorkItem ( )
inline

Definition at line 95 of file mxworkitem.h.

97 {
98 }

Member Function Documentation

◆ _Free()

__inline VOID MxWorkItem::_Free ( __in MdWorkItem  Item)
static

Definition at line 81 of file mxworkitemkm.h.

84{
86}
VOID NTAPI IoFreeWorkItem(IN PIO_WORKITEM IoWorkItem)
Definition: iowork.c:64
_In_ WDFCOLLECTION _In_ WDFOBJECT Item

Referenced by FxPkgPdo::_QueryCapsWorkItem(), and Free().

◆ _WorkerThunk()

VOID CALLBACK MxWorkItem::_WorkerThunk ( _Inout_ PTP_CALLBACK_INSTANCE  Instance,
_Inout_opt_ PVOID  Parameter,
_Inout_ PTP_WAIT  Wait,
_In_ TP_WAIT_RESULT  WaitResult 
)
static

Definition at line 30 of file mxworkitemum.cpp.

36{
37 MdWorkItem workItem = (MdWorkItem) Parameter;
38
41 UNREFERENCED_PARAMETER(WaitResult);
42
43 (*workItem->Callback)(
44 workItem->DeviceObject,
45 workItem->Context
46 );
47
48 return;
49}
PIO_WORKITEM MdWorkItem
Definition: mxworkitemkm.h:27
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
PDEVICE_OBJECT DeviceObject
Definition: io.h:313
PVOID Context
Definition: io.h:315
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:170
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_INSTANCE_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_opt_ WDFWMIINSTANCE * Instance
Definition: wdfwmi.h:481
_Inout_opt_ PVOID Parameter
Definition: rtltypes.h:323

◆ Allocate()

_Must_inspect_result_ __inline NTSTATUS MxWorkItem::Allocate ( __in MdDeviceObject  DeviceObject,
__in_opt PVOID  ThreadPoolEnv = NULL 
)

Definition at line 41 of file mxworkitemkm.h.

45{
46 UNREFERENCED_PARAMETER(ThreadPoolEnv);
47
49 if (NULL == m_WorkItem) {
51 }
52
53 return STATUS_SUCCESS;
54}
PIO_WORKITEM NTAPI IoAllocateWorkItem(IN PDEVICE_OBJECT DeviceObject)
Definition: iowork.c:75
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055

Referenced by FxWorkItemEventQueue::Init(), FxThreadedEventQueue::Init(), FxSystemWorkItem::Initialize(), FxWorkItem::Initialize(), FxPkgPnp::PnpDeviceUsageNotification(), and FxPkgPdo::PnpQueryCapabilities().

◆ Enqueue()

__inline VOID MxWorkItem::Enqueue ( __in PMX_WORKITEM_ROUTINE  Callback,
__in PVOID  Context 
)

Definition at line 58 of file mxworkitemkm.h.

62{
68 );
69}
VOID NTAPI IoQueueWorkItem(IN PIO_WORKITEM IoWorkItem, IN PIO_WORKITEM_ROUTINE WorkerRoutine, IN WORK_QUEUE_TYPE QueueType, IN PVOID Context)
Definition: iowork.c:40
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
Definition: wdfinterrupt.h:458
@ DelayedWorkQueue
Definition: extypes.h:190

Referenced by FxSystemWorkItem::EnqueueWorker(), FxPkgPdo::PnpQueryCapabilities(), FxWorkItemEventQueue::QueueWorkItem(), and FxThreadedEventQueue::QueueWorkItem().

◆ Free()

◆ GetWorkItem()

◆ WaitForCallbacksToComplete()

VOID MxWorkItem::WaitForCallbacksToComplete ( VOID  )

Definition at line 52 of file mxworkitemum.cpp.

55{
56 Mx::MxAssert(NULL != m_WorkItem->WaitBlock);
57
58 //
59 // Wait for outstanding callbacks to complete.
60 //
61 WaitForThreadpoolWaitCallbacks(m_WorkItem->WaitBlock,
62 FALSE // donot cancel pending waits
63 );
64
65}
static __inline VOID MxAssert(__in BOOLEAN Condition)
Definition: mxgeneralkm.h:165
#define FALSE
Definition: types.h:117

Member Data Documentation

◆ m_WorkItem

MdWorkItem MxWorkItem::m_WorkItem
protected

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