ReactOS 0.4.15-dev-7842-g558ab78
fxmemorybufferpreallocated.cpp
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation
4
5Module Name:
6
7 FxMemoryBufferPreallocated.cpp
8
9Abstract:
10
11 This module implements a frameworks managed FxMemoryBufferPreallocated
12
13Author:
14
15Environment:
16
17 kernel mode only
18
19Revision History:
20
21--*/
22
23#include "coreprivshared.hpp"
25
27 _In_ PFX_DRIVER_GLOBALS FxDriverGlobals,
29 _In_ size_t BufferSize
30 ) :
31 FxMemoryObject(FxDriverGlobals, sizeof(*this), BufferSize),
32 m_pBuffer(Buffer)
33/*++
34
35Routine Description:
36 Contstructor for this object. Stores off all the pointers and sizes passed
37 in by the caller.
38
39Arguments:
40 Buffer - Buffer to associate with this object
41
42 BufferSize - Size of Buffer in bytes
43
44Return Value:
45 None
46
47 --*/
48{
49}
50
52 _In_ PFX_DRIVER_GLOBALS FxDriverGlobals,
53 _In_ USHORT ObjectSize,
55 _In_ size_t BufferSize
56 ) :
57 FxMemoryObject(FxDriverGlobals, ObjectSize, BufferSize),
58 m_pBuffer(Buffer)
59/*++
60
61Routine Description:
62 Contstructor for this object. Stores off all the pointers and sizes passed
63 in by the caller.
64
65Arguments:
66 ObjectSize - Size of the derived object
67
68 Buffer - Buffer to associate with this object
69
70 BufferSize - Size of Buffer in bytes
71
72Return Value:
73 None
74
75 --*/
76{
77}
78
79
81 __in USHORT ObjectSize,
82 __in PFX_DRIVER_GLOBALS FxDriverGlobals
83 ) : FxMemoryObject(FxDriverGlobals, ObjectSize, 0), m_pBuffer(NULL)
84/*++
85
86Routine Description:
87 Contstructor for this object. Stores off all the pointers and sizes passed
88 in by the caller.
89
90Arguments:
91 ObjectSize - Size of the derived object.
92
93Return Value:
94 None
95
96 --*/
97{
98}
99
101/*++
102
103Routine Description:
104 Destructor for this object. Does nothing with the client memory since
105 the client owns it.
106
107Arguments:
108 None
109
110Return Value:
111 None
112
113 --*/
114{
115}
116
121 )
122{
123 if (Params->Type == FX_TYPE_MEMORY_PREALLOCATED) {
124 *Params->Object = (FxMemoryBufferPreallocated*) this;
125 return STATUS_SUCCESS;
126 }
127 else {
128 return FxMemoryObject::QueryInterface(Params); // __super call
129 }
130}
131
132VOID
135 _In_ size_t BufferSize
136 )
137/*++
138
139Routine Description:
140 Updates the internal pointer to a new value.
141
142
143Arguments:
144 Buffer - new buffer
145
146 BufferSize - length of Buffer in bytes
147
148Return Value:
149 None.
150
151 --*/
152
153{
156}
LONG NTSTATUS
Definition: precomp.h:26
Definition: bufpool.h:45
_Must_inspect_result_ NTSTATUS QueryInterface(__inout FxQueryInterfaceParams *Params)
VOID UpdateBuffer(_Pre_notnull_ _Pre_writable_byte_size_(BufferSize) PVOID Buffer, _In_ size_t BufferSize)
FxMemoryBufferPreallocated(_In_ PFX_DRIVER_GLOBALS FxDriverGlobals, _Pre_notnull_ _Pre_writable_byte_size_(BufferSize) PVOID Buffer, _In_ size_t BufferSize)
virtual _Must_inspect_result_ NTSTATUS QueryInterface(__inout FxQueryInterfaceParams *Params)
#define __in
Definition: dbghelp.h:35
#define __inout
Definition: dbghelp.h:50
#define BufferSize
Definition: mmc.h:75
#define NULL
Definition: types.h:112
@ FX_TYPE_MEMORY_PREALLOCATED
Definition: fxtypes.h:75
#define _Pre_writable_byte_size_(size)
Definition: ms_sal.h:647
#define _Pre_notnull_
Definition: ms_sal.h:680
#define _Must_inspect_result_
Definition: ms_sal.h:558
#define _In_
Definition: ms_sal.h:308
unsigned short USHORT
Definition: pedump.c:61
#define STATUS_SUCCESS
Definition: shellext.h:65
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
Definition: wdfrequest.h:308
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList