This is a little advanced question and didn't know where to post it. I'm doing windows system programming. We can create several Heaps for the same Process. My question is, how can I copy and duplicate a Heap and create an exact copy of it in a different Heap. Both Heaps will be in the same Process of course.

Having several Heaps
WaltXS
I just tried it and it is not going to be easy. But for a moment imagine I was able to duplicate the first heap to a second heap. My new problem would be that there are pointers inside heap 1 that point to data in heap1. Now with my heap2, I will have pointers inside it that point to heap1, but I want them to point to their duplicate in heap2.
Anyway the whole idea is that I have some data in a heap. I want to launch n threads on n copy of the heap. 1 heap per thread. Using synchronization and the same heap is too difficult.
MRMOU812
Perhaps you could use HeapWalk and CopyMemory