HTTP_FILTER_CONTEXT
typedef struct _HTTP_FILTER_CONTEXT
{
DWORD cbSize;
DWORD Revision;
PVOID ServerContext;
DWORD ulReserved;
BOOL fIsSecurePort;
PVOID pFilterContext;
BOOL (WINAPI * GetServerVariable) (
struct
_HTTP_FILTER_CONTEXT * pfc,
LPSTR lpszVariableName,
LPVOID lpvBuffer,
LPDWORD lpdwSize
);
BOOL
(WINAPI * AddResponseHeaders) (
struct
_HTTP_FILTER_CONTEXT * pfc,
LPSTR lpszHeaders,
DWORD dwReserved
);
BOOL
(WINAPI * WriteClient) (
struct
_HTTP_FILTER_CONTEXT * pfc,
LPVOID Buffer,
LPDWORD lpdwBytes,
DWORD dwReserved
);
VOID *
(WINAPI * AllocMem) (
struct
_HTTP_FILTER_CONTEXT * pfc,
DWORD cbSize,
DWORD dwReserved
);
BOOL
(WINAPI * ServerSupportFunction) (
struct
_HTTP_FILTER_CONTEXT * pfc,
enum
SF_REQ_TYPE sfReq,
PVOID pData,
DWORD ul1,
DWORD ul2
);
} HTTP_FILTER_CONTEXT, *PHTTP_FILTER_CONTEXT;
Members
cbSize
[in] The size
of this structure, in bytes.
Revision
[in] The
revision level of this structure. This is less than or equal to the version of
the document, HTTP_FILTER_REVISION.
ServerContext
[in] Reserved
for server use.
ulReserved
[in] Reserved
for server use.
fIsSecurePort
[in] A value
of TRUE indicates that this event is over a secure port.
pFilterContext
[in/out] A
pointer to be used by the filter for any context information that the filter
wants to associate with this request. Any memory associated with this request
can be safely freed during the SF_NOTIFY_END_OF_NET_SESSION notification.
BOOL (WINAPI * GetServerVariable) (
struct _HTTP_FILTER_CONTEXT *pfc,
LPSTR lpszVariableName,
LPVOID lpvBuffer,
LPDWORD lpdwSize
);
A pointer to
a function to retrieve information about the server and this connection. See GetServerVariable
Parameters
pfc
The pfc
passed to HttpFilterProc.
lpszVariableName
The server
variable to retrieve.
lpvBuffer
The buffer in
which to store the value of the variable.
lpdwSize
The size of
the buffer pointed to by lpvBuffer.
BOOL (WINAPI * AddResponseHeaders) (
struct _HTTP_FILTER_CONTEXT *pfc,
LPSTR lpszHeaders,
DWORD dwReserved
);
A pointer to
a function that adds a header to the HTTP response. See ServerSupportFunction
Parameters
pfc
The pfc
passed to HttpFilterProc.
lpszHeaders
A pointer
string containing the headers to add.
dwReserved
Reserved for
future use. This must be zero.
BOOL (WINAPI * )
(
struct _HTTP_FILTER_CONTEXT *pfc,
. LPVOID buffer,
LPDWORD lpdwBytes,
DWORD dwReserved
);
A pointer to
a function that sends raw data back to the client. See WriteClient
Parameters
pfc
The pfc
passed to HttpFilterProc.
buffer
A buffer
containing data to send to the client.
lpdwBytes
The size of
the buffer pointed to by buffer.
dwReserved
Reserved for
future use.
VOID
* (WINAPI * AllocMem) (
struct _HTTP_FILTER_CONTEXT *pfc,
DWORD cbSize,
DWORD dwReserved
);
A pointer to
a function used to allocate memory. Any memory allocated with this function
will automatically be freed when the request is completed.
Parameters
pfc
The pfc
passed to HttpFilterProc.
cbSize
The size of
the buffer to allocate.
dwReserved
Reserved for
future use.
BOOL (WINAPI * ServerSupportFunction) (
struct _HTTP_FILTER_CONTEXT *pfc,
enum SF_REQ_TYPE sfReq,
PVOID pData,
DWORD ul1,
DWORD ul2
);
A pointer to
a function used to extend the ISAPI filter functions. Parameters are specific
to the extensions. Possible values for sfReq are SF_REQ_SEND_RESPONSE_HEADER,
SF_REQ_ADD_HEADERS_ON_DENIAL, and SF_REQ_SET_NEXT_READ_SIZE.
SF_REQ_SEND_RESPONSE_HEADER
This sends a
complete HTTP server response header including the status, server version,
message time, and MIME version. Server extensions should append other
information, such as content type and content length, followed by an extra
\r\n .
Parameters
pData
A
zero-terminated string pointing to optional status string (for example,
"401 Access Denied") or NULL for the default response of "200
OK".
ul1
A zero-terminated
string pointing to optional data to be appended and sent with the header. If
NULL, the header will be terminated with an empty line.
SF_REQ_ADD_HEADERS_ON_DENIAL
If the server
denies the HTTP request, add the specified headers to the server error
response. This allows an authentication filter to advertise its services
without filtering every request. Generally, the headers will be
WWW-Authenticate headers with custom authentication schemes. However, no
restriction is placed on which headers can be specified.
Parameters
pData
A
zero-terminated string pointing to one or more header lines with terminating
\r\n.
SF_REQ_SET_NEXT_READ_SIZE
This is used
only by raw data filters that return SF_STATUS_READ_NEXT.
Parameters
ul1
The size in
bytes for the next read.