ReactOS  0.4.15-dev-3217-gc6d1646
mxworkitemkm.h
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 ModuleName:
6 
7  MxWorkItemKm.h
8 
9 Abstract:
10 
11  Kernel mode implementation of work item
12  class defined in MxWorkItem.h
13 
14 Author:
15 
16 
17 
18 Revision History:
19 
20 
21 
22 --*/
23 
24 #pragma once
25 
26 typedef IO_WORKITEM_ROUTINE MX_WORKITEM_ROUTINE, *PMX_WORKITEM_ROUTINE;
28 
29 #include "mxworkitem.h"
30 
31 __inline
33  )
34 {
35  m_WorkItem = NULL;
36 }
37 
39 __inline
43  __in_opt PVOID ThreadPoolEnv
44  )
45 {
46  UNREFERENCED_PARAMETER(ThreadPoolEnv);
47 
49  if (NULL == m_WorkItem) {
51  }
52 
53  return STATUS_SUCCESS;
54 }
55 
56 __inline
57 VOID
61  )
62 {
64  m_WorkItem,
65  Callback,
67  Context
68  );
69 }
70 
71 __inline
74  )
75 {
76  return m_WorkItem;
77 }
78 
79 __inline
80 VOID
83  )
84 {
86 }
87 
88 __inline
89 VOID
91  )
92 {
93  if (NULL != m_WorkItem) {
95  m_WorkItem = NULL;
96  }
97 }
98 
99 //
100 // FxAutoWorkitem
101 //
102 __inline
104  )
105 {
106  this->Free();
107 }
108 
109 
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
__inline MdWorkItem GetWorkItem()
Definition: mxworkitemkm.h:73
#define __in_opt
Definition: dbghelp.h:38
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
LONG NTSTATUS
Definition: precomp.h:26
IO_WORKITEM_ROUTINE MX_WORKITEM_ROUTINE
Definition: mxworkitemkm.h:26
MdWorkItem m_WorkItem
Definition: mxworkitem.h:32
PIO_WORKITEM NTAPI IoAllocateWorkItem(IN PDEVICE_OBJECT DeviceObject)
Definition: iowork.c:75
VOID NTAPI IoFreeWorkItem(IN PIO_WORKITEM IoWorkItem)
Definition: iowork.c:64
_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
PIO_WORKITEM MdWorkItem
Definition: mxworkitemkm.h:27
__inline ~MxAutoWorkItem()
Definition: mxworkitemkm.h:103
__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
#define _Must_inspect_result_
Definition: ms_sal.h:558
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
Definition: wdfinterrupt.h:456
VOID NTAPI IoQueueWorkItem(IN PIO_WORKITEM IoWorkItem, IN PIO_WORKITEM_ROUTINE WorkerRoutine, IN WORK_QUEUE_TYPE QueueType, IN PVOID Context)
Definition: iowork.c:40
#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 STATUS_SUCCESS
Definition: shellext.h:65
#define __in
Definition: dbghelp.h:35
__inline MxWorkItem()
Definition: mxworkitemkm.h:32