ReactOS  0.4.15-dev-3163-gf17c2c0
fxpagedobject.hpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 Module Name:
6 
7  FxPagedObject.hpp
8 
9 Abstract:
10 
11  This module defines the abstract FxPagedObject class.
12 
13 Author:
14 
15 
16 
17 --*/
18 
19 #ifndef _FXPAGEDOBJECT_H_
20 #define _FXPAGEDOBJECT_H_
21 
22 class FxPagedObject : public FxObject
23 {
24 private:
26 
27 public:
28 
32  __in PFX_DRIVER_GLOBALS FxDriverGlobals
33  ) :
34  FxObject(Type, Size, FxDriverGlobals)
35  {
36  m_Lock = NULL;
37 
38  // no need to hold the lock while the object is being constructed
40  }
41 
42  virtual
44  VOID
45  )
46  {
47  if (m_Lock != NULL) {
49  m_Lock = NULL;
50  }
51  }
52 
53  VOID
55  VOID
56  )
57  {
58  m_Lock->Acquire();
59  }
60 
61  VOID
63  VOID
64  )
65  {
66  m_Lock->Release();
67  }
68 
70  NTSTATUS
72  VOID
73  )
74  {
76 
78  m_Lock = (MxPagedLock*) FxPoolAllocate(fxDriverGlobals,
80  sizeof(MxPagedLock));
81  if (m_Lock != NULL) {
82  return m_Lock->Initialize();
83  }
84  else {
86  }
87  }
88 };
89 
90 #endif // _FXPAGEDOBJECT_H_
VOID Lock(VOID)
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
LONG NTSTATUS
Definition: precomp.h:26
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
virtual ~FxPagedObject(VOID)
_Must_inspect_result_ NTSTATUS Initialize(VOID)
VOID MarkPassiveCallbacks(__in FxObjectLockState State=ObjectLock)
Definition: fxobject.hpp:972
FxPagedObject(__in WDFTYPE Type, __in USHORT Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
Type
Definition: Type.h:6
VOID Unlock(VOID)
_Must_inspect_result_ __inline NTSTATUS Initialize()
Definition: mxpagedlockkm.h:52
#define _Must_inspect_result_
Definition: ms_sal.h:558
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
unsigned short USHORT
Definition: pedump.c:61
PFX_DRIVER_GLOBALS fxDriverGlobals
USHORT WDFTYPE
Definition: fxtypes.h:29
#define NULL
Definition: types.h:112
void FxPoolFree(__in_xcount(ptr is at an offset from AllocationStart) PVOID ptr)
Definition: wdfpool.cpp:361
#define __in
Definition: dbghelp.h:35
MxPagedLock * m_Lock