Microsoft Internet Security and Acceleration Server 2004 SDK

WriteServer

The WriteServer callback function writes a data buffer to the server.

The WriteServer callback function is declared as:

BOOL WINAPI * WriteServer(
  struct _HTTP_FILTER_CONTEXT* pfc,
  LPVOID Buffer,
  LPDWORD lpdwBytes,
  DWORD dwReserved
);

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.
Buffer
Pointer to the buffer to write.
lpdwBytes
Pointer to the size of the buffer pointed to by the Buffer parameter.
dwReserved
Reserved for future use.

Return Values

Returns TRUE if the function succeeded, or FALSE if the function failed.

Remarks

The WriteServer 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 WriteServer function, use the TO_WPX_FILTER_CONTEXT macro as follows:

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

The WriteServer callback function is synchronous and and blocks the thread from which it is called until the IO operation is completed. A Web filter sending a large amount of data in calls to this function can block all of the available worker threads with a resultant denial of service (DoS).

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