#define ValidateReadPtr(p,cb) 0
I can't think of a use case for this kind of macro,what about you?
#define ValidateReadPtr(p,cb) 0
I can't think of a use case for this kind of macro,what about you?
It was probably used for something else, and then was redefined as 0
.
That's the beauty of macros, you can use them in your code, and then, one simple redefinition is good enough to change all occurrences of that macro in the code.
What's probably happening now is the programmer wants that validation (ValidateReadPtr
) always return FALSE
(0
in C/C++).
I can only find the ValidateReadPtr()
macro in the wxdebug.h
header for the Windows Mobile SDK (even though MSDN indicates it's part of the DirectShow APIs).
In wxdebug.h
it's defined as:
#define ValidateReadPtr(p,cb) \
{if(IsBadReadPtr((PVOID)p,cb) == TRUE) \
DbgBreak("Invalid read pointer");}
I suspect that in your project it's defined as 0
for one or both of the following reasons:
wxdebug.h
header isn't available (ie., not using the Windows Mobile SDK)IsBadreadPtr()
say, "Important This function is obsolete and should not be used. Despite its name, it does not guarantee that the pointer is valid or that the memory pointed to is safe to use. For more information, see Remarks...". And Raymond Chen wrote an article about the problems with IsBadReadPtr()
: IsBadXxxPtr should really be called CrashProgramRandomly