注意这3个函数:
1. LPVOID WINAPI HeapAlloc( _In_ HANDLE hHeap, _In_ DWORD dwFlags, _In_ SIZE_T dwBytes);
Allocates a block of memory from a heap. The allocated memory is not movable.
hHeap [in]
A handle to the heap from which the memory will be allocated. This handle is returned by the HeapCreate or GetProcessHeap function.
2. HANDLE WINAPI HeapCreate( _In_ DWORD flOptions, _In_ SIZE_T dwInitialSize, _In_ SIZE_T dwMaximumSize);
Creates a private heap object that can be used by the calling process. The function reserves space in the virtual address space of the process and allocates physical storage for a specified initial portion of this block.
3. HANDLE WINAPI GetProcessHeap(void);
Retrieves a handle to the default heap of the calling process. This handle can then be used in subsequent calls to the heap functions.