ReactOS  0.4.15-dev-3287-gfec35dc
fxcallback.hpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 Module Name:
6 
7  FxCallback.hpp
8 
9 Abstract:
10 
11  This represents a delegate object base class for
12  calling back into the driver.
13 
14 Author:
15 
16 
17 
18 
19 Revision History:
20 
21 --*/
22 
23 #ifndef _FXCALLBACK_H_
24 #define _FXCALLBACK_H_
25 
26 extern "C" {
27 #if defined(EVENT_TRACING)
28 #include "FxCallback.hpp.tmh"
29 #endif
30 }
31 
32 class FxCallback {
33 
34 public:
35 
37  __in_opt PFX_DRIVER_GLOBALS FxDriverGlobals = NULL
38  )
39  {
40  UNREFERENCED_PARAMETER(FxDriverGlobals);
41  }
42 
43  PVOID
44  operator new(
45  __in size_t Size,
46  __in PFX_DRIVER_GLOBALS FxDriverGlobals,
48  )
49  {
50  return FxPoolAllocate(FxDriverGlobals, PoolType, Size);
51  }
52 
53  VOID
54  operator delete(
56  )
57  {
59  }
60 
61 protected:
62  void
63  __inline
65  VOID
66  )
67  {
68  // intentionally does nothing, visual place marker only for now
69  DO_NOTHING();
70  }
71 
72  void
73  __inline
75  VOID
76  )
77  {
78  // intentionally does nothing, visual place marker only for now
79  DO_NOTHING();
80  }
81 };
82 
84 
85 private:
87 
88 public:
90  VOID
91  )
92  {
94  }
95 
98  VOID
99  )
100  {
101  return m_CallbackLock;
102  }
103 
104  void
107  )
108  {
110  }
111 
112 protected:
113  __inline
114  void
116  __out PKIRQL PreviousIrql
117  )
118  {
119  if (m_CallbackLock != NULL) {
120  m_CallbackLock->Lock(PreviousIrql);
121  }
122  }
123 
124  __inline
125  void
127  __in KIRQL PreviousIrql
128  )
129  {
130  if (m_CallbackLock != NULL) {
131  m_CallbackLock->Unlock(PreviousIrql);
132  }
133  }
134 };
135 
136 #endif // _FXCALLBACK_H_
FxCallback(__in_opt PFX_DRIVER_GLOBALS FxDriverGlobals=NULL)
Definition: fxcallback.hpp:36
FxLockedCallback(VOID)
Definition: fxcallback.hpp:89
__inline void CallbackStart(__out PKIRQL PreviousIrql)
Definition: fxcallback.hpp:115
GLsizei const GLvoid * pointer
Definition: glext.h:5848
#define __in_opt
Definition: dbghelp.h:38
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
FxCallbackLock * m_CallbackLock
Definition: fxcallback.hpp:86
UCHAR KIRQL
Definition: env_spec_w32.h:591
virtual void Lock(__out PKIRQL PreviousIrql)=0
#define __out
Definition: dbghelp.h:62
__inline void CallbackEnd(__in KIRQL PreviousIrql)
Definition: fxcallback.hpp:126
INT POOL_TYPE
Definition: typedefs.h:78
void SetCallbackLockPtr(FxCallbackLock *Lock)
Definition: fxcallback.hpp:105
KIRQL * PKIRQL
Definition: env_spec_w32.h:592
FxCallbackLock * GetCallbackLockPtr(VOID)
Definition: fxcallback.hpp:97
virtual void Unlock(__in KIRQL PreviousIrql)=0
#define NULL
Definition: types.h:112
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:124
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfdevice.h:3810
void __inline CallbackStart(VOID)
Definition: fxcallback.hpp:64
void FxPoolFree(__in_xcount(ptr is at an offset from AllocationStart) PVOID ptr)
Definition: wdfpool.cpp:361
#define __in
Definition: dbghelp.h:35
void __inline CallbackEnd(VOID)
Definition: fxcallback.hpp:74
#define DO_NOTHING()
Definition: mxgeneral.h:32