Sign in to follow this  

GlobalAlloc shareable?

This topic is 3588 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, there are many people who claim that memory got by GlobalAlloc can be shared between different processes. Other people say that GlobalAlloc is a vestige from win16 days, and it just calls HeapAlloc today (didn't check that myself). But then it would be all in the process's private virtual address space... What's the truth? And how does the Clipboard (SetClipboardData) for example share data between processes if the GlobalAlloc handle which it can get doesn't do it? Bye Zoomby

Share this post


Link to post
Share on other sites
It's obsolete, and doesn't do what you think it does. GlobalAlloc will not allocate memory that can be shared between processes. It's just a (slow) wrapper around the standard heap allocation functions, for legacy code compatibility. There is no global heap on Win32/64 anymore.

If you want to share data between processes, look into pipes, memmapped files, or something like VirtualAllocEx. Memory mapped files are the preferred method.

Share this post


Link to post
Share on other sites

This topic is 3588 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this