1 // Windows/Memory.cpp
\r
5 #include "Windows/Memory.h"
\r
10 bool CGlobal::Alloc(UINT flags, SIZE_T size)
\r
12 HGLOBAL newBlock = ::GlobalAlloc(flags, size);
\r
13 if (newBlock == NULL)
\r
15 m_MemoryHandle = newBlock;
\r
19 bool CGlobal::Free()
\r
21 if (m_MemoryHandle == NULL)
\r
23 m_MemoryHandle = ::GlobalFree(m_MemoryHandle);
\r
24 return (m_MemoryHandle == NULL);
\r
27 bool CGlobal::ReAlloc(SIZE_T size)
\r
29 HGLOBAL newBlock = ::GlobalReAlloc(m_MemoryHandle, size, GMEM_MOVEABLE);
\r
30 if (newBlock == NULL)
\r
32 m_MemoryHandle = newBlock;
\r