Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

AllocateMemory callback function

Providers implement this function to provide custom memory management for PERFLIB. PERFLIB calls this callback when it needs to allocate memory. By default, PERFLIB uses the process heap to allocate memory.

The PERF_MEM_ALLOC type defines a pointer to this callback function. The AllocateMemory function is a placeholder for the application-defined function name.

Syntax


LPVOID CALLBACK AllocateMemory(
  _In_  SIZE_T AllocSize,
  _In_  LPVOID pContext
);

Parameters

AllocSize [in]

Number of bytes to allocate.

pContext [in]

Context information set in the pMemContext member of PERF_PROVIDER_CONTEXT.

Return value

Pointer to the allocated memory or NULL if an error occurred.

Remarks

If you used the -MemoryRoutines when calling CTRPP, you must implement this callback function. You pass the name of your callback function to CounterInitialize.

Windows Vista:  The CounterInitialize function is named PerfAutoInitialize.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Perflib.h

See also

PERF_PROVIDER_CONTEXT
FreeMemory

 

 

Community Additions

Show:
© 2015 Microsoft