Is a pointer readable/writeable?

I know it's possible to find out i just don't know the command. any help?
It depends on the pointer and what it is pointing to...be more specific please.
On WIN32, there's IsBadReadPtr, IsBadWrietPtr.
a const pointer is not writable. :D
Sorry, I am making a dll to go with a language that doesn't natively have raw data access, so i am creating alloc, poke, peek, and all that kind of stuff in the dll, but i have no test to see if the pointer that is sent is valid or readable/writeable.

I have heard of IsBadReadPtr and IsBadWritePtr but i have heard the way that it checks can currupt other things, and it isn't recommended to be used(never used it but i have read a some stuff on it)

I know a cont pointer is writable :P lol as stated above, I will not necassarely be the one attaining or sending the pointers.
No, you can't really "check" besides trying to read/write there and somehow catching the possible exception (you might not be able to "catch" them, they might be signals or something instead of exceptions).
These functions check if the pointer is in your address space. There's also IsCodePtr. It's entirely possible to point to some nonsense in your address space.
Last edited on
Ok, thanks guys.

I have just heard that the way those functions check is catching exeptions and if the pointer is to something that is supposed to trigger a exeption, because of the way the function probes, it will activate it and catch it. which will in turn cause other programs to mess up since this wasn't supposed to hapen then and it wasn't sent where it shoud have been.
They probably use Structured Exceptions which are different from C++ exceptions.
Topic archived. No new replies allowed.