I'm looking for an explanation of where the memory returned from GlobalAlloc comes from. Based on the fact that this memory can be accessed across module and process boundaries, it seems that this must be a system-wide heap that is mapped into the same virtual address for all processes. Is this essentially how it works?
If this is the case, then the pages that malloc allocates from the OS must come from a different heap since those addresses are not valid across modules. However, when reading about heap management in win32, it looks like there are *not* two different heaps (though back in Win 3.1 there used to be the docs say).