HANDLE hHeap = HeapCreate(0, 5*1024*1024, 0);
PROCESS_HEAP_ENTRY entry;
entry.lpData = NULL;
TRACE("Mem Heap Dump\n");
TRACE(" Address Size\n");
TRACE("----------------\n");
while (HeapWalk(hHeap, &entry))
{
if (entry.wFlags & PROCESS_HEAP_ENTRY_BUSY)
{
TRACE(" %p %8d\n", entry.lpData, entry.cbData);
}
}
A quick guess: the additional memory block is used to maintain information
about what the heap contains.
BTW. Are you sure you need HeapCreate and can't just use GetProcessHeap() ?
Or some other memory allocation (LocalAlloc, GlobalAlloc, malloc, calloc,
new, ...)...
- Sten