In addition to the heap functions I’ve already mentioned, Windows offers several more. In this section, I’ll just briefly mention them.
The ToolHelp functions (mentioned at the end of Chapter 4) allow you to enumerate a process’ heaps as well as the allocations within those heaps. For more information, look up the following functions in the Platform SDK documentation:
Because a process can have multiple heaps within its address space, the
GetProcessHeaps function allows you to get the handles of the existing heaps:
DWORD GetProcessHeaps( DWORD dwNumHeaps, PHANDLE phHeaps);
GetProcessHeaps, you must first allocate an array of
HANDLEs and then call the ...