Microsoft Internet Security and Acceleration Server 2004 SDK

GetHeader

The GetHeader callback function retrieves an HTTP header. The function retrieves a header for an incoming request after an SF_NOTIFY_PREPROC_HEADERS or SF_NOTIFY_AUTH_COMPLETE notification, for an incoming response after an SF_NOTIFY_RECEIVE_RESPONSE_HEADERS notification, and for an outgoing response after an SF_NOTIFY_SEND_RESPONSE notification. For more information on the types of event notifications that are sent to Web filters, see Event Notifications.

The GetHeader callback function is declared as:

BOOL WINAPI * GetHeader(
  struct _HTTP_FILTER_CONTEXT* pfc,
  LPSTR lpszName,
  LPVOID lpvBuffer,
  LPDWORD lpdwSize
);

Parameters

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

Pointer to a null-terminated string containing the name of the header to retrieve. Header names should include the trailing colon (:). This parameter is not case-sensitive.

The special values "method", "url", "version", and "body" (for requests only) can be used to retrieve individual portions of the request line. When the value "body" is specified, the function retrieves the part of the body that has already been received.

The special value "status" can be used to retrieve the status from the response line.

Note that the special values do not include a trailing colon.

lpvBuffer
Pointer to a buffer of size lpdwSize for receiving the header requested.
lpdwSize
The size of the buffer. This should be set to the size of the buffer specified in lpvBuffer, for example, sizeof(achBuffer). After the call, it contains the number of bytes retrieved including the null terminator. Therefore, for retrieved strings, it is equal to strlen(lpvBuffer) + 1.

Return Values

This callback function returns TRUE if the call is successful; otherwise, it returns FALSE.

Remarks

A pointer to this function is included as a member of the following structures:

If the header is larger than the buffer size specified in the lpdwSize parameter, the function will fail. In that case GetLastError will return ERROR_INSUFFICIENT_BUFFER and lpdwSize will contain the required buffer size.

Requirements

Server: Requires Windows Server 2003 or Windows 2000.
Version: Requires Internet Security and Acceleration Server 2004.
Header: Declared in Wpxhttpfilt.h.

See Also

Callback Functions