ReactOS 0.4.16-dev-306-g647d351
ATL::CWin32Heap Class Reference

#include <atlmem.h>

Inheritance diagram for ATL::CWin32Heap:
Collaboration diagram for ATL::CWin32Heap:

Public Member Functions

 CWin32Heap ()
 
 CWin32Heap (_In_ HANDLE hHeap)
 
virtual ~CWin32Heap ()
 
_Ret_maybenull_ _Post_writable_byte_size_ (SizeBytes) virtual void *Allocate(_In_ size_t SizeBytes)
 
virtual void Free (_In_opt_ void *Buffer)
 
_Ret_maybenull_ _Post_writable_byte_size_ (SizeBytes) virtual void *Reallocate(_In_opt_ void *Buffer
 
virtual size_t GetSize (_Inout_ void *Buffer)
 
- Public Member Functions inherited from ATL::IAtlMemMgr
virtual ~IAtlMemMgr ()
 
virtual _Ret_maybenull_ _Post_writable_byte_size_ (SizeBytes) void *Allocate(_In_ size_t SizeBytes)=0
 
virtual void Free (_Inout_opt_ void *Buffer)=0
 
virtual _Ret_maybenull_ _Post_writable_byte_size_ (SizeBytes) void *Reallocate(_Inout_updates_bytes_opt_(SizeBytes) void *Buffer
 
virtual size_t GetSize (_In_ void *Buffer)=0
 

Public Attributes

HANDLE m_hHeap
 
_Ret_maybenull_ _In_ size_t SizeBytes
 
- Public Attributes inherited from ATL::IAtlMemMgr
virtual _Ret_maybenull_ _In_ size_t SizeBytes = 0
 

Detailed Description

Definition at line 35 of file atlmem.h.

Constructor & Destructor Documentation

◆ CWin32Heap() [1/2]

ATL::CWin32Heap::CWin32Heap ( )
inline

Definition at line 41 of file atlmem.h.

41 :
43 {
44 }
HANDLE m_hHeap
Definition: atlmem.h:38
#define NULL
Definition: types.h:112

◆ CWin32Heap() [2/2]

ATL::CWin32Heap::CWin32Heap ( _In_ HANDLE  hHeap)
inline

Definition at line 46 of file atlmem.h.

46 :
47 m_hHeap(hHeap)
48 {
49 ATLASSERT(hHeap != NULL);
50 }
#define ATLASSERT(x)
Definition: CComVariant.cpp:10

◆ ~CWin32Heap()

virtual ATL::CWin32Heap::~CWin32Heap ( )
inlinevirtual

Definition at line 52 of file atlmem.h.

53 {
54 }

Member Function Documentation

◆ _Post_writable_byte_size_() [1/2]

_Ret_maybenull_ ATL::CWin32Heap::_Post_writable_byte_size_ ( SizeBytes  )
inlinevirtual

Implements ATL::IAtlMemMgr.

Definition at line 58 of file atlmem.h.

61 {
62 return ::HeapAlloc(m_hHeap, 0, SizeBytes);
63 }
_Ret_maybenull_ _In_ size_t SizeBytes
Definition: atlmem.h:80

◆ _Post_writable_byte_size_() [2/2]

_Ret_maybenull_ ATL::CWin32Heap::_Post_writable_byte_size_ ( SizeBytes  )
virtual

Implements ATL::IAtlMemMgr.

◆ Free()

virtual void ATL::CWin32Heap::Free ( _In_opt_ void Buffer)
inlinevirtual

Definition at line 65 of file atlmem.h.

68 {
69 if (Buffer)
70 {
71 if (!::HeapFree(m_hHeap, 0, Buffer))
73 }
74 }
Definition: bufpool.h:45
#define FALSE
Definition: types.h:117
#define HeapFree(x, y, z)
Definition: compat.h:735

◆ GetSize()

virtual size_t ATL::CWin32Heap::GetSize ( _Inout_ void Buffer)
inlinevirtual

Definition at line 95 of file atlmem.h.

98 {
99 return ::HeapSize(m_hHeap, 0, Buffer);
100 }

Member Data Documentation

◆ m_hHeap

HANDLE ATL::CWin32Heap::m_hHeap

Definition at line 38 of file atlmem.h.

Referenced by _Post_writable_byte_size_(), Free(), and GetSize().

◆ SizeBytes

_Ret_maybenull_ _In_ size_t ATL::CWin32Heap::SizeBytes
Initial value:
{
if (SizeBytes == 0)
{
return NULL;
}
if (Buffer == NULL)
{
}
return ::HeapReAlloc(m_hHeap, 0, Buffer, SizeBytes)
_In_opt_ PALLOCATE_FUNCTION Allocate
Definition: exfuncs.h:814
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:815

Definition at line 78 of file atlmem.h.

Referenced by _Post_writable_byte_size_().


The documentation for this class was generated from the following file: