Say process 1 has allocated some space with VirtualAlloc in a function and the function already returned at that time. Is it possible that a second process frees the space with VirtualFreeEx if it knows the right address(es)?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The answer to this question is yes.
Memory is owned by the process in which it resides. It is not owned by the process which allocated it.
In many ways, this is similar to calling
mallocfrom one thread and thenfreefrom another. That’s perfectly fine. And it’s perfectly fine to do the equivalent withVirtualAllocExandVirtualFreeEx.