Microsoft DirectX 9.0

CheckPointer

Checks whether a pointer is NULL. If the pointer is NULL, the function or method in which the macro appears returns the specified value.

Syntax

CheckPointer(
    p,
    ret
);

Parameters

p

Pointer to check.

ret

Value that the function or method returns if p is NULL.

Example

HRESULT MyFunction(VOID *pSomeParameter)
{
    CheckPointer(pSomeParameter, E_INVALIDARG)

    // Rest of the function (not shown).
}

See Also