Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find mapping between Windows heap and modules

I am searching for a way to find a mapping between a heap and the module which owns the heap. I retrieve the heaps in the following way:

HANDLE heaps[1025];
DWORD nheaps = GetProcessHeaps((sizeof(heaps) / sizeof(HANDLE)) - 1, heaps);
for (DWORD i = 0; i < nheaps; ++i) {
  // find module which created for heap 
  // ...
}

The reason why i want to do that is that in my application i find round about 40 heaps, some are standard heaps, other are low-fragmentation heaps. Now i am trying to figure out which module uses which kind of heap.

Thanks a lot!

like image 834
usac Avatar asked Mar 01 '23 09:03

usac


1 Answers

According to the MSDN docs, the GetProcessHeaps call given you the handles for all heaps in your current process, not all heaps in the system so there is no mapping to other processes.

like image 138
Timo Geusch Avatar answered Mar 11 '23 12:03

Timo Geusch