DXIsBadReadPtr function

Verifies that the calling process has read access to the specified range of memory.

Syntax

BOOL DXIsBadReadPtr(
  _In_ const void *pMem,
  _In_       UINT Size
);

Parameters

  • pMem [in]
    A pointer to a read buffer.

  • Size [in]
    A value of type UINT that specifies the size of the read buffer.

Return value

Returns TRUE if the calling process has read access and the application is compiled as a debugging version, or FALSE otherwise.

Remarks

If the application is compiled as a debugging version and the calling process does not have read access to the specified range of memory, then the function causes an assertion and breaks into the debugger.

Combinations of two compiler directives, defining _DEBUG and defining DXTRANS_NOROBUST, determine whether this function has an effect at run time. This function verifies access to the memory range according to the following table.

#define _DEBUG #define DXTRANS_NOROBUST Pointer verified
Yes Yes Yes
Yes No Yes
No Yes No
No No Yes

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows 2000 Server

Header

Dxhelper.h

See also

Reference

DXIsBadWritePtr

DXIsBadInterfacePtr