AllocMemoryPerRequest callback function

Applies to: desktop apps only

The AllocMemoryPerRequest callback function is used to allocate memory (from the process heap to a buffer) per request. Any memory allocated by using this function will automatically be freed by the Forefront TMG Web proxy at the end of the request (after the SF_NOTIFY_END_OF_REQUEST notification) even if the session continues. For more information about the types of event notifications that are sent to Web filters, see Event Notifications.

If the memory cannot be allocated, this function returns NULL.

The AllocMemoryPerRequest callback function is declared as:

Syntax

VOID * WINAPI AllocMemoryPerRequest(
  _In_  struct _HTTP_FILTER_CONTEXT *pfc,
  _In_  DWORD cbSize,
  _In_  DWORD dwReserved
);

Parameters

  • pfc [in]
    Pointer to the HTTP_FILTER_CONTEXT data structure that is associated with the current, active HTTP session. Pass the filter context in this parameter.

  • cbSize [in]
    Indicates the size of the buffer to be allocated, in bytes.

  • dwReserved [in]
    Reserved for use by the server.

Return value

This callback function does not return a value.

Remarks

The AllocMemoryPerRequest function is called through a pointer that is a member of the WPX_FILTER_CONTEXT structure. To get a pointer to the WPX_FILTER_CONTEXT structure for calling the AllocMemoryPerRequest function, use the TO_WPX_FILTER_CONTEXT macro as follows:

WPX_FILTER_CONTEXT* pwfc = TO_WPX_FILTER_CONTEXT(pfc);
if (pwfc != NULL) {
...
}

Requirements

Minimum supported client

None supported

Minimum supported server

Windows Server 2008 R2, Windows Server 2008 with SP2 (64-bit only)

Version

Forefront Threat Management Gateway (TMG) 2010

Header

Wpxhttpfilt.h

See also

Callback Functions

 

 

Build date: 7/12/2010