Re: Validating a Function Address
- From: "Michael C" <nospam@xxxxxxxxxx>
- Date: Tue, 12 Dec 2006 13:22:20 +1100
"Thorsten Albers" <albersRE@xxxxxxxxxxxxxxxxxxx> wrote in message
news:01c71d90$9ea29620$214bf8d9@xxxxxxxxxxx
What, if the function to call resides in a DLL, and this DLL in the
meantime has been unloaded willingly or due to a crash? With every code
pointer one should at least check with IsBadCodePtr() if the memory at the
given address is executable. Of course, there are lots of other
possibilities for a GPF, but if we can exclude one, why not do it?
I think you're going too far with checks and will get odd side effects.
You'd need to check it every time you called the function pointer so will
get a reduction in performance. If you do happen to find a bad pointer then
your app will start to malfunction anyway which might cause other odd side
effects. Extra testing would be required to check for these side effects as
they might cause loss of data. The general thinking I believe is if you get
something as serious as an invalid function pointer then your app should
terminate as something is seriously wrong and continuing might cause a loss
of data.
Michael
.
- Follow-Ups:
- Re: Validating a Function Address
- From: Thorsten Albers
- Re: Validating a Function Address
- From: J French
- Re: Validating a Function Address
- References:
- Validating a Function Address
- From: Chip Pearson
- Re: Validating a Function Address
- From: Karl E. Peterson
- Re: Validating a Function Address
- From: Thorsten Albers
- Validating a Function Address
- Prev by Date: Re: Validating a Function Address
- Next by Date: Re: Validating a Function Address
- Previous by thread: Re: Validating a Function Address
- Next by thread: Re: Validating a Function Address
- Index(es):
Relevant Pages
|
Loading