ReactOS 0.4.16-dev-320-g3bd9ddc
fxmemorybuffer.hpp
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation
4
5Module Name:
6
7 FxMemoryBuffer.hpp
8
9Abstract:
10
11Author:
12
13Environment:
14
15 kernel mode only
16
17Revision History:
18
19
20--*/
21
22#ifndef _FXMEMORYBUFFER_H_
23#define _FXMEMORYBUFFER_H_
24
26
27public:
28
29 // Factory function
30 static
33 _Create(
37 __in size_t BufferSize,
40 );
41
43 __in PFX_DRIVER_GLOBALS FxDriverGlobals,
44 __in size_t BufferSize
45 );
46
47 PVOID
49 VOID
50 );
51
52 PVOID
53 __inline
54 operator new(
55 __in size_t Size,
56 __in PFX_DRIVER_GLOBALS FxDriverGlobals,
58 __in USHORT ExtraSize,
61 )
62 {
63 //
64 // PoolType must be non paged pool but it can be NonPagedPool
65 // or NonPagedPoolNx or their variants
66 //
68
69 //
70 // Specialize operator new so that we can use the caller's tag when
71 // making the object allocation vs using the default driver-wide tag.
72 //
73 return FxObjectHandleAlloc(FxDriverGlobals,
75 Size,
76 Tag,
78 ExtraSize,
80 }
81
82protected:
83
85 __in PFX_DRIVER_GLOBALS FxDriverGlobals,
86 __in USHORT ObjectSize,
87 __in size_t BufferSize
88 );
89
91};
92
93#endif // _FXMEMORYBUFFER_H_
LONG NTSTATUS
Definition: precomp.h:26
static _Must_inspect_result_ NTSTATUS _Create(__in PFX_DRIVER_GLOBALS DriverGlobals, __in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __in ULONG PoolTag, __in size_t BufferSize, __in POOL_TYPE PoolType, __out FxMemoryObject **Object)
#define __in
Definition: dbghelp.h:35
#define __in_opt
Definition: dbghelp.h:38
#define __out
Definition: dbghelp.h:62
DriverGlobals
PVOID FxObjectHandleAlloc(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in POOL_TYPE PoolType, __in size_t Size, __in ULONG Tag, __in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __in USHORT ExtraSize, __in FxObjectType ObjectType)
Definition: handleapi.cpp:163
return pMemory GetBuffer()
@ FxObjectTypeExternal
Definition: fxobject.hpp:120
BOOLEAN FxIsPagedPoolType(__in POOL_TYPE Type)
Definition: wdfpool.cpp:43
#define ASSERT(a)
Definition: mode.c:44
#define _Must_inspect_result_
Definition: no_sal2.h:62
unsigned short USHORT
Definition: pedump.c:61
INT POOL_TYPE
Definition: typedefs.h:78
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4065
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfdevice.h:3815
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _Strict_type_match_ POOL_TYPE _In_opt_ ULONG PoolTag
Definition: wdfmemory.h:164