PFREEMEM callback function (lpmapi.h)

The PFREEMEM function is a memory-freeing function provided by the PCM. PFREEMEM frees memory buffers that were allocated using PALLOCMEM. The PFREEMEM function is supplied as a parameter of the LPM_Initialize function. The combination of PALLOCMEM and PFREEMEM allows the SBM to experiment with different memory-management schemes without requiring recompilation of LPMs.

Syntax

PFREEMEM Pfreemem;

void Pfreemem(
  [in] void *pv,
       char *szFileName,
       DWORD nLine
)
{...}

Parameters

[in] pv

Pointer to the memory buffer to free.

szFileName

nLine

Return value

None

Remarks

LPMs do not need to use this function to manage their local buffers. LPMs need to use this function to free buffers that were allocated, but were not sent to the PCM. For example, if a buffer is allocated in anticipation of a PCM's response to a request, but a response is never returned (perhaps the remote policy store is unavailable or unresponsive), that buffer must be freed with this function, or a memory leak will ensue.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header lpmapi.h

See also

LPM_Initialize

PALLOCMEM