O'Reilly logo

Windows® via C/C++, Fifth Edition by Christophe Nasarre, Jeffrey Richter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Miscellaneous Heap Functions

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: Heap32First, Heap32Next, Heap32ListFirst, and Heap32ListNext.

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);

To call GetProcessHeaps, you must first allocate an array of HANDLEs and then call the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required