ReactOS  0.4.15-dev-3299-gbe8e5fc
fxpkggeneral.hpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 Module Name:
6 
7  FxPkgGeneral.hpp
8 
9 Abstract:
10 
11  This module implements a package to handle general dispath entry points
12  such as IRP_MJ_CREATE and IRP_MJ_CLOSE.
13 
14 Author:
15 
16 
17 
18 Environment:
19 
20  Both kernel and user mode
21 
22 Revision History:
23 
24 --*/
25 
26 #ifndef _FXPKGGENERAL_H_
27 #define _FXPKGGENERAL_H_
28 
30 
31 class FxShutDown : public FxCallback {
32 
33 public:
35 
37  VOID
38  ) :
39  FxCallback(),
40  m_Method(NULL)
41  {
42  }
43 
44  VOID
46  __in WDFDEVICE Device
47  )
48  {
49  if (m_Method != NULL) {
50  CallbackStart();
52  CallbackEnd();
53  }
54  }
55 };
56 
57 #define FX_PKG_GENERAL_FLAG_CX_INFO 0x00000001
58 #define FX_PKG_GENERAL_FLAG_CLIENT_INFO 0x00000002
59 #define FX_PKG_GENERAL_FLAG_CX_CREATE 0x00000004
60 #define FX_PKG_GENERAL_FLAG_CLIENT_CREATE 0x00000008
61 
62 #define FX_PKG_GENERAL_FLAG_CREATE \
63  (FX_PKG_GENERAL_FLAG_CX_CREATE | FX_PKG_GENERAL_FLAG_CLIENT_CREATE)
64 
65 
66 class FxPkgGeneral : public FxPackage {
67 
68 private:
69 
70  //
71  // FileObject attributes
72  //
74 
75  //
76  // List of file objects info (driver and cx).
77  //
79 
82 
83  //
84  // Generic file object flags.
85  //
87 
88  //
89  // Execution and synchronization for cx and client driver.
90  //
93 
94  //
95  // This pointer allows the proper lock to be acquired
96  // based on the configuration with a minimal of runtime
97  // checks. This is configured by ConfigureConstraints().
98  // We basically inherit device's lock.
99  //
102 
104 
105 private:
107  NTSTATUS
108  OnCreate(
110  );
111 
113  NTSTATUS
114  OnClose(
116  );
117 
118  BOOLEAN
121  );
122 
124  NTSTATUS
125  OnCleanup(
127  );
128 
130  NTSTATUS
131  OnShutdown(
133  );
134 
136  NTSTATUS
138  __in PLIST_ENTRY FileObjInfoList
139  );
140 
142  NTSTATUS
144  __in PLIST_ENTRY FileObjInfoList
145  );
146 
147  VOID
149  VOID
150  );
151 
153  NTSTATUS
155  __in FxIrp* FxIrp,
158  );
159 
160  static
162 
163  static
165 
166 public:
167 
168  FxPkgGeneral(
169  __in PFX_DRIVER_GLOBALS FxDriverGlobals,
171  );
172 
173  ~FxPkgGeneral();
174 
176  virtual
177  NTSTATUS
178  Dispatch(
180  );
181 
183  NTSTATUS
184  Initialize(
186  );
187 
189  NTSTATUS
192  );
193 
194  VOID
196  __in FxIrp *Irp
197  );
198 
200  NTSTATUS
202  __in FxIoQueue *FxQueue
203  );
204 
205  BOOLEAN
207  VOID
208  );
209 
210  VOID
212  __out_opt WDF_EXECUTION_LEVEL* ExecutionLevel,
213  __out_opt WDF_SYNCHRONIZATION_SCOPE* SynchronizationScope
214  ) ;
215 
219  );
220 
221  __inline
222  FxIoQueue*
224  )
225  {
227  }
228 };
229 
230 #endif // _FXPKGGENERAL_H_
VOID Invoke(__in WDFDEVICE Device)
WUDF_IO_COMPLETION_ROUTINE MdCompletionRoutineType
Definition: mxum.h:142
LONG NTSTATUS
Definition: precomp.h:26
EVT_WDF_DEVICE_SHUTDOWN_NOTIFICATION * PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION
Definition: wdfcontrol.h:62
_Must_inspect_result_ NTSTATUS PostCreateDeviceInitialize(__in PWDFDEVICE_INIT Init)
_Must_inspect_result_ NTSTATUS Initialize(__in PWDFDEVICE_INIT DeviceInit)
FxIoQueue * m_DriverCreatedQueue
Definition: fxirp.hpp:28
_Must_inspect_result_ NTSTATUS ForwardCreateRequest(__in FxIrp *FxIrp, __in MdCompletionRoutine CompletionRoutine, __in PVOID Context)
VOID CreateCompleted(__in FxIrp *Irp)
PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION m_Method
LONG m_OpenHandleCount
#define __out_opt
Definition: dbghelp.h:65
FxPkgGeneral(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in CfxDevice *Device)
_In_ PIRP Irp
Definition: csq.h:116
long LONG
Definition: pedump.c:60
_Must_inspect_result_ NTSTATUS OnCleanup(__inout FxIrp *FxIrp)
unsigned char BOOLEAN
IWudfIrp * MdIrp
Definition: mxum.h:103
static MdCompletionRoutineType _CreateCompletionRoutine2
_Must_inspect_result_ NTSTATUS ConfigureForwarding(__in FxIoQueue *FxQueue)
_Must_inspect_result_ NTSTATUS OnClose(__inout FxIrp *FxIrp)
enum _WDF_SYNCHRONIZATION_SCOPE WDF_SYNCHRONIZATION_SCOPE
FxIoQueue * m_DefaultQueueForCreates
FxCallbackLock * GetCallbackLockPtrHelper(__deref_out_opt FxObject **LockObject)
FxCallbackLock * m_CallbackLockPtr
LIST_ENTRY m_FileObjectInfoHeadList
FxObject * m_CallbackLockObjectPtr
#define __inout
Definition: dbghelp.h:50
Definition: typedefs.h:119
#define _Must_inspect_result_
Definition: ms_sal.h:558
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
_Must_inspect_result_ NTSTATUS ConfigureConstraints(__in PLIST_ENTRY FileObjInfoList)
_Must_inspect_result_ NTSTATUS OnCreate(__inout FxIrp *FxIrp)
FxShutDown(VOID)
WDF_SYNCHRONIZATION_SCOPE m_SynchronizationScope
_Must_inspect_result_ NTSTATUS OnShutdown(__inout FxIrp *FxIrp)
_In_ WDFREQUEST _In_opt_ PFN_WDF_REQUEST_COMPLETION_ROUTINE CompletionRoutine
Definition: wdfrequest.h:893
FxShutDown m_EvtDeviceShutdown
static MdCompletionRoutineType _CreateCompletionRoutine
#define NULL
Definition: types.h:112
#define __deref_out_opt
Definition: dbghelp.h:29
virtual _Must_inspect_result_ NTSTATUS Dispatch(__inout MdIrp Irp)
WUDF_IO_COMPLETION_ROUTINE * MdCompletionRoutine
Definition: mxum.h:142
unsigned int ULONG
Definition: retypes.h:1
WDF_EXTERN_C_START enum _WDF_EXECUTION_LEVEL WDF_EXECUTION_LEVEL
_In_ PWDFDEVICE_INIT DeviceInit
Definition: wdfcontrol.h:113
_Must_inspect_result_ NTSTATUS ConfigureFileObjectClass(__in PLIST_ENTRY FileObjInfoList)
void __inline CallbackStart(VOID)
Definition: fxcallback.hpp:64
VOID GetConstraintsHelper(__out_opt WDF_EXECUTION_LEVEL *ExecutionLevel, __out_opt WDF_SYNCHRONIZATION_SCOPE *SynchronizationScope)
#define __in
Definition: dbghelp.h:35
BOOLEAN CanDestroyControlDevice(VOID)
void __inline CallbackEnd(VOID)
Definition: fxcallback.hpp:74
BOOLEAN AcquireRemoveLockForClose(__inout FxIrp *FxIrp)
VOID DecrementOpenHandleCount(VOID)
__inline FxIoQueue * GetDeafultInternalCreateQueue()
WDF_EXECUTION_LEVEL m_ExecutionLevel
#define LockObject(Object)
Definition: titypes.h:34