ReactOS 0.4.16-dev-197-g92996da
fxpagedobject.hpp
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation
4
5Module Name:
6
7 FxPagedObject.hpp
8
9Abstract:
10
11 This module defines the abstract FxPagedObject class.
12
13Author:
14
15
16
17--*/
18
19#ifndef _FXPAGEDOBJECT_H_
20#define _FXPAGEDOBJECT_H_
21
22class FxPagedObject : public FxObject
23{
24private:
26
27public:
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
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_
Type
Definition: Type.h:7
LONG NTSTATUS
Definition: precomp.h:26
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
VOID MarkPassiveCallbacks(__in FxObjectLockState State=ObjectLock)
Definition: fxobject.hpp:972
FxPagedObject(__in WDFTYPE Type, __in USHORT Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
VOID Unlock(VOID)
VOID Lock(VOID)
MxPagedLock * m_Lock
_Must_inspect_result_ NTSTATUS Initialize(VOID)
virtual ~FxPagedObject(VOID)
_Must_inspect_result_ __inline NTSTATUS Initialize()
Definition: mxpagedlockkm.h:52
#define __in
Definition: dbghelp.h:35
#define NULL
Definition: types.h:112
#define NonPagedPool
Definition: env_spec_w32.h:307
PFX_DRIVER_GLOBALS fxDriverGlobals
@ ObjectDoNotLock
Definition: fxobject.hpp:128
void FxPoolFree(__in_xcount(ptr is at an offset from AllocationStart) PVOID ptr)
Definition: wdfpool.cpp:361
USHORT WDFTYPE
Definition: fxtypes.h:29
#define _Must_inspect_result_
Definition: ms_sal.h:558
unsigned short USHORT
Definition: pedump.c:61
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533