ReactOS  0.4.15-dev-2701-g34593d9
mxworkitem.h
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 ModuleName:
6 
7  MxWorkItem.h
8 
9 Abstract:
10 
11  Mode agnostic definition of WorkItem functions
12 
13  See MxWorkItemKm.h and MxWorkItemUm.h for mode
14  specific implementations
15 
16 Author:
17 
18 
19 
20 Revision History:
21 
22 
23 
24 --*/
25 
26 #pragma once
27 
29 {
30 
31 protected:
33 
34 public:
35 
36  __inline
37  MxWorkItem(
38  );
39 
40  //
41  // This is used only by the UM implementation
42  //
43 
44 #if ((FX_CORE_MODE)==(FX_CORE_USER_MODE))
45  static
46  VOID
47  CALLBACK
48  _WorkerThunk (
51  _Inout_ PTP_WAIT Wait,
52  _In_ TP_WAIT_RESULT WaitResult
53  );
54 
55  VOID
57  VOID
58  );
59 
60 #endif
61 
63  __inline
64  NTSTATUS
65  Allocate(
67  __in_opt PVOID ThreadPoolEnv = NULL
68  );
69 
70  __inline
71  VOID
72  Enqueue(
75  );
76 
77  __inline
80  );
81 
82  static
83  __inline
84  VOID
85  _Free(
87  );
88 
89  __inline
90  VOID
91  Free(
92  );
93 
94  __inline
96  )
97  {
98  }
99 
100 };
101 
102 //
103 // MxAutoWorkItem adds value to MxWorkItem by automatically freeing the
104 // associated MdWorkItem when it goes out of scope
105 //
106 struct MxAutoWorkItem : public MxWorkItem {
107 public:
108 
110  )
111  {
112  }
113 
114  __inline
116  );
117 };
118 
static VOID CALLBACK _WorkerThunk(_Inout_ PTP_CALLBACK_INSTANCE Instance, _Inout_opt_ PVOID Parameter, _Inout_ PTP_WAIT Wait, _In_ TP_WAIT_RESULT WaitResult)
#define _Must_inspect_result_
Definition: no_sal2.h:62
__inline MdWorkItem GetWorkItem()
Definition: mxworkitemkm.h:73
#define __in_opt
Definition: dbghelp.h:38
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:167
LONG NTSTATUS
Definition: precomp.h:26
#define CALLBACK
Definition: compat.h:35
_In_ PVOID Parameter
Definition: ldrtypes.h:241
MdWorkItem m_WorkItem
Definition: mxworkitem.h:32
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ __inline NTSTATUS Allocate(__in MdDeviceObject DeviceObject, __in_opt PVOID ThreadPoolEnv=NULL)
Definition: mxworkitemkm.h:41
struct _TP_CALLBACK_INSTANCE * PTP_CALLBACK_INSTANCE
Definition: winnt_old.h:4304
__inline ~MxWorkItem()
Definition: mxworkitem.h:95
__inline ~MxAutoWorkItem()
Definition: mxworkitemkm.h:103
#define _Inout_
Definition: no_sal2.h:162
__inline VOID Enqueue(__in PMX_WORKITEM_ROUTINE Callback, __in PVOID Context)
Definition: mxworkitemkm.h:58
static __inline VOID _Free(__in MdWorkItem Item)
Definition: mxworkitemkm.h:81
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
Definition: wdfinterrupt.h:456
#define _In_
Definition: no_sal2.h:158
VOID WaitForCallbacksToComplete(VOID)
#define NULL
Definition: types.h:112
__inline VOID Free()
Definition: mxworkitemkm.h:90
_In_ WDFCOLLECTION _In_ WDFOBJECT Item
IO_WORKITEM_ROUTINE * PMX_WORKITEM_ROUTINE
Definition: mxworkitemkm.h:26
#define __in
Definition: dbghelp.h:35
__inline MxWorkItem()
Definition: mxworkitemkm.h:32
IN PVOID Instance
Definition: pci.h:361
#define _Inout_opt_
Definition: no_sal2.h:216