The AllocMem callback function allocates memory from the process heap to a buffer. Any memory allocated with this function will automatically be freed by IIS when the session ends.
VOID * WINAPI * AllocMem(
PHTTP_FILTER_CONTEXT pfc,
DWORD cbSize,
DWORD dwReserved
);