8.4.2 Walking the Local Heap

The LocalInfo function fills a LOCALINFO structure with the total number of items on the local heap. This information enables the application to determine how much memory to allocate for a local-heap walk. The application must allocate the memory before starting the walk. If the application allocates any memory after starting the walk, the results of the heap walk will be corrupt.

The LocalFirst function fills a LOCALENTRY structure with information about the first object on the local heap. This information includes the structure size; the handle, address, and size of the object; the lock count; and so on.

You can use LocalFirst to begin a walk through the local heap. The LocalNext function continues the walk by filling a LOCALENTRY structure with information about the next object on the local heap.