Using ISAPI Extension Callback Functions

When an Internet Server Application Programming Interface (ISAPI) extension processes a request, it needs a way of communicating with IIS. Several common tasks, such as writing across a socket to the client, are complicated to implement in your own function.

IIS already implements much of this functionality, and provides useful callback functions. Pointers to callback functions are made available to the ISAPI extension through the EXTENSION_CONTROL_BLOCK structure, and a pointer to this structure is passed to the ISAPI extension for each request.

The following callback functions are used with ISAPI extensions:

  • WriteClient: Sends a response back to the client.

  • ReadClient: Reads client-supplied data into a buffer. This function is necessary to perform HTTP POST operations.

  • GetServerVariable: Obtains server variables that contain information about the request and the server.

  • ServerSupportFunction: Provides a variety of functions for use in processing requests.

For specific examples of how to use callback functions, see Sending a Response Header from an ISAPI Extension and Asynchronous I/O Processing.