HttpExtensionProc Function

The HttpExtensionProc function is the main entry point for an ISAPI extension called by IIS. It exposes methods that IIS uses to access the functionality exposed by the extension.

DWORD WINAPI HttpExtensionProc(
      LPEXTENSION_CONTROL_BLOCK lpECB
);

Parameters

Return Values

Returns a DWORD containing HSE_STATUS codes. Possible return values are:

Value

Meaning

HSE_STATUS_SUCCESS

The extension has finished processing and the server should disconnect the client and free up allocated resources.

HSE_STATUS_SUCCESS_AND_KEEP_CONN

The extension has finished processing and the server should wait for the next HTTP request if the client supports Keep-Alive connections. The extension can return this only if it was able to send the correct Content-Length header to the client.

HSE_STATUS_PENDING

The extension has queued the request for processing and will notify the server when it has finished. See HSE_REQ_DONE_WITH_SESSION under ServerSupportFunction.

If the ISAPI extension is using HSE_STATUS_PENDING, then responses can be sent from work done in another thread after returning HSE_STATUS_PENDING.

HSE_STATUS_ERROR

The extension has encountered an error while processing the request, so the server can disconnect the client and free up allocated resources. An HTTP status code of 500 is written to the IIS log for the request.

Remarks

This entry point is similar to a main() function in a C++ program. The code in this entry point uses callback functions in the EXTENSION_CONTROL_BLOCK structure to read client data and decide which action to take. Before returning to the server, a properly formatted response must be sent to the client through either the WriteClient function or ServerSupportFunction. Return codes are defined in httpext.h.

ms525010.alert_caution(en-us,VS.90).gifImportant Note:

In IIS versions 4.0 and later, the return values HSE_STATUS_SUCCESS and HSE_STATUS_SUCCESS_AND_KEEP_CONN are functionally identical: Keep-Alive connections are maintained, if supported by the client.

Requirements

Client: Requires Windows XP Professional, Windows 2000 Professional, or Windows NT Workstation 4.0.

Server: Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server 4.0.

Product: IIS

Header: Declared in httpext.h.