ReactOS 0.4.16-dev-297-gc569aee
fxuserobject.hpp
Go to the documentation of this file.
1
2/*++
3
4Copyright (c) Microsoft. All rights reserved.
5
6Module Name:
7
8 FxUserObject.hpp
9
10Abstract:
11
12 This module implements the user object that device
13 driver writers can use to take advantage of the
14 driver frameworks infrastructure.
15
16Author:
17
18
19
20
21Environment:
22
23 Both kernel and user mode
24
25Revision History:
26
27
28 Made mode agnostic
29
30--*/
31
32#ifndef _FXUSEROBJECT_H_
33#define _FXUSEROBJECT_H_
34
36
37private:
38
39public:
40
41 static
44 _Create(
45 __in PFX_DRIVER_GLOBALS FxDriverGlobals,
48 );
49
51 __in PFX_DRIVER_GLOBALS FxDriverGlobals
52 );
53
54 virtual
58 )
59 {
60 switch (Params->Type) {
62 *Params->Object = (FxUserObject*) this;
63 break;
64
65 default:
66 return FxNonPagedObject::QueryInterface(Params); // __super call
67 }
68
69 return STATUS_SUCCESS;
70 }
71
72 __inline
75 VOID
76 )
77 {
78 return (WDFOBJECT) GetObjectHandle();
79 }
80
81private:
82
83#ifdef INLINE_WRAPPER_ALLOCATION
84#if (FX_CORE_MODE==FX_CORE_USER_MODE)
85 static
86 USHORT
87 GetWrapperSize(
88 VOID
89 );
90
91public:
93 PVOID
95 VOID
96 )
97 {
98 PBYTE ptr = (PBYTE) this;
99 return (ptr + (USHORT) WDF_ALIGN_SIZE_UP(sizeof(*this), MEMORY_ALLOCATION_ALIGNMENT));
100 }
101#endif
102#endif
103};
104
105#endif // _FXUSEROBJECT_H_
106
LONG NTSTATUS
Definition: precomp.h:26
PVOID GetCOMWrapper()
Definition: fxobject.hpp:518
virtual _Must_inspect_result_ NTSTATUS QueryInterface(__in FxQueryInterfaceParams *Params)
Definition: fxobject.cpp:255
static _Must_inspect_result_ NTSTATUS _Create(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __out FxUserObject **Object)
__inline WDFOBJECT GetHandle(VOID)
virtual NTSTATUS QueryInterface(__in FxQueryInterfaceParams *Params)
#define __in
Definition: dbghelp.h:35
#define __in_opt
Definition: dbghelp.h:38
#define __out
Definition: dbghelp.h:62
return pObject GetObjectHandle()
@ FX_TYPE_USEROBJECT
Definition: fxtypes.h:57
static PVOID ptr
Definition: dispmode.c:27
#define _Must_inspect_result_
Definition: no_sal2.h:62
#define MEMORY_ALLOCATION_ALIGNMENT
Definition: ntbasedef.h:90
BYTE * PBYTE
Definition: pedump.c:66
unsigned short USHORT
Definition: pedump.c:61
#define STATUS_SUCCESS
Definition: shellext.h:65
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
FORCEINLINE size_t WDF_ALIGN_SIZE_UP(_In_ size_t Length, _In_ size_t AlignTo)
Definition: wdfcore.h:129
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
Definition: wdfrequest.h:308
#define FORCEINLINE
Definition: wdftypes.h:67