View Single Post
  #4  
Old 03-22-2014, 01:13
mcp mcp is offline
Friend
 
Join Date: Dec 2011
Posts: 73
Rept. Given: 4
Rept. Rcvd 12 Times in 11 Posts
Thanks Given: 7
Thanks Rcvd at 47 Times in 35 Posts
mcp Reputation: 12
@qkumba
Actually, that API is fundamentally broken because it is not free of side effects, e.g., consider the case where you use that API on a guard page. After using that API, that page won't be a guard page anymore!

Due to race conditions, there is no general safe way to test if a pointer is valid, other than making sure it is only obtained for safe addresses. Pretty much any address can become invalid after you tested the pointer, and vice versa.

The right question would be to ask: what are you actually trying to do?
Reply With Quote