Export (0) Print
Expand All
div
Expand Minimize
This topic has not yet been rated - Rate this topic

_CrtDoForAllClientObjects

Calls an application-supplied function for all _CLIENT_BLOCK types in the heap (debug version only).

void _CrtDoForAllClientObjects( 
   void (* pfn )(void *, void * ),
   void *context
);

Parameters

pfn
Pointer to the application-supplied function call-back function. The first parameter to this function points to the data. The second parameter is the context pointer that is passed in to the call to _CrtDoForAllClientObjects.
context
Pointer to the application-supplied context to pass to the application-supplied function.

Remarks

The _CrtDoForAllClientObjects function searches the heap's linked list for memory blocks with the _CLIENT_BLOCK type and calls the application-supplied function when a block of this type is found. The found block and the context parameter are passed as arguments to the application-supplied function. During debugging, an application can track a specific group of allocations by explicitly calling the debug heap functions to allocate the memory and specifying that the blocks be assigned the _CLIENT_BLOCK block type. These blocks can then be tracked separately and reported on differently during leak detection and memory state reporting.

If the _CRTDBG_ALLOC_MEM_DF bit field of the _crtDbgFlag flag is not turned on, _CrtDoForAllClientObjects immediately returns. When _DEBUG is not defined, calls to _CrtDoForAllClientObjects are removed during preprocessing.

For more information about the _CLIENT_BLOCK type and how it can be used by other debug functions, see Types of Blocks on the Debug Heap. For information about how memory blocks are allocated, initialized, and managed in the debug version of the base heap, see Memory Management and the Debug Heap.

Requirements

Routine Required header Compatibility
_CrtDoForAllClientObjects <crtdbg.h> Win 98, Win Me, Win NT, Win 2000, Win XP

For additional compatibility information, see Compatibility in the Introduction.

Libraries

Debug versions of C run-time libraries only.

Example

For a sample of how to use _CrtDoForAllClientObjects, see dfacobjs.

See Also

Debug Functions | _CrtSetDbgFlag | Heap State Reporting Functions | _CrtReportBlockType | Run-Time Routines and .NET Framework Equivalents

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.