1 /*++ 2 3 Copyright (c) Microsoft Corporation 4 5 Module Name: 6 7 FxMemoryBufferPreallocated.hpp 8 9 Abstract: 10 11 Author: 12 13 Environment: 14 15 kernel mode only 16 17 Revision History: 18 19 --*/ 20 21 #ifndef _FXMEMORYBUFFERPREALLOCATED_H_ 22 #define _FXMEMORYBUFFERPREALLOCATED_H_ 23 24 class FxMemoryBufferPreallocated : public FxMemoryObject { 25 public: 26 27 FxMemoryBufferPreallocated( 28 _In_ PFX_DRIVER_GLOBALS FxDriverGlobals, 29 _Pre_notnull_ _Pre_writable_byte_size_(BufferSize) PVOID Buffer, 30 _In_ size_t BufferSize 31 ); 32 33 virtual 34 PVOID 35 GetBuffer( 36 VOID 37 ) 38 { 39 return m_pBuffer; 40 } 41 42 VOID 43 UpdateBuffer( 44 _Pre_notnull_ _Pre_writable_byte_size_(BufferSize) PVOID Buffer, 45 _In_ size_t BufferSize 46 ); 47 48 _Must_inspect_result_ 49 NTSTATUS 50 QueryInterface( 51 __inout FxQueryInterfaceParams* Params 52 ); 53 54 protected: 55 // for derived classes 56 FxMemoryBufferPreallocated( 57 __in USHORT ObjectSize, 58 __in PFX_DRIVER_GLOBALS Globals 59 ); 60 61 FxMemoryBufferPreallocated( 62 _In_ PFX_DRIVER_GLOBALS FxDriverGlobals, 63 _In_ USHORT ObjectSize, 64 _Pre_notnull_ _Pre_writable_byte_size_(BufferSize) PVOID Buffer, 65 _In_ size_t BufferSize 66 ); 67 68 ~FxMemoryBufferPreallocated(); 69 70 PVOID m_pBuffer; 71 }; 72 #endif // _FXMEMORYBLOCKPREALLOCATED_H_ 73