ServerSupportFunction (ISAPI Extensions) Request Types
A version of this page is also available for
4/8/2010
This section defines the ServerSupportFunction (ISAPI Extensions) request types. These values can be passed in the dwHSERequest parameter of the ServerSupportFunction.
Note
If a ServerSupportFunction parameter is designated as unused for a particular request type, your extension should set the parameter to NULL or zero, as appropriate.
HSE_APPEND_LOG_PARAMETER
This request type allows the ISAPI extension to write custom log strings to the log record. When the extension calls ServerSupportFunction (ISAPI Extensions), the specified string is appended to the log record for the current HTTP request.
The extension should set the dwHSERequest parameter of ServerSupportFunction to HSE_APPEND_LOG_PARAMETER. The lpvBuffer parameter of ServerSupportFunction should be set to a pointer to a null-terminated string to append to the log record. The lpdwDataType parameter of ServerSupportFunction is unused for this request type.
HSE_REQ_GET_LOCAL_SOCKADDR
This request type retrieves the TCP/IP address upon which the request was received.
In its call to ServerSupportFunction (ISAPI Extensions), the extension should set the dwHSERequest parameter of ServerSupportFunction to HSE_REQ_GET_LOCAL_SOCKADDR. The value returned in lpvBuffer is a pointer to a SOCKADDR data structure containing the local TCP/IP address. The extension should set the lpdwSize parameter of ServerSupportFunction to a pointer to the size of the SOCKADDR indicated by lpvBuffer upon return. The lpdwDataType parameter is not used for this request type. The extension should pass in a SOCKADDR_STORAGE sized buffer in lpvBuffer.
HSE_REQ_GET_REMOTE_SOCKADDR
This request type retrieves the remote address of the client or agent of the client (for example gateway, proxy, or firewall) that sent the request.
In its call to ServerSupportFunction (ISAPI Extensions), the extension should set the dwHSERequest parameter of ServerSupportFunction to HSE_REQ_GET_REMOTE_SOCKADDR. The value returned in lpvBuffer is a pointer to a SOCKADDR data structure containing the remote TCP/IP address. The extension should set the lpdwSize parameter of ServerSupportFunction to a pointer to the size of the SOCKADDR indicated by lpvBuffer upon return. The lpdwDataType parameter is not used for this request type. The extension should pass in a SOCKADDR_STORAGE sized buffer in lpvBuffer.
HSE_REQ_IS_KEEP_CONN
This request type allows the ISAPI extension to determine the Keep-Alive status of the current connection.
In its call to ServerSupportFunction (ISAPI Extensions), the extension should set the dwHSERequest parameter of ServerSupportFunction to HSE_REQ_IS_KEEP_CONN. The lpvBuffer parameter of ServerSupportFunction should be set to a pointer to a value that will contain the status of Keep-Alive upon return. The lpdwSize and lpdwDataType parameters are unused for this request type.
HSE_REQ_MAP_URL_TO_PATH
This request type allows the ISAPI extension to map a logical URL path to a physical path.
In its call to ServerSupportFunction (ISAPI Extensions), the extension should set the dwHSERequest parameter of ServerSupportFunction to HSE_REQ_MAP_URL_TO_PATH. The lpvBuffer parameter of ServerSupportFunction should be set to a pointer to a buffer that contains the null-terminated URL string to map upon entry, and contains the physical path upon return.
The extension should set the lpdwSize parameter of ServerSupportFunction to a pointer to the size of the physical path indicated by lpvBuffer upon return. If the physical path is too large for lpvBuffer, GetLastError returns ERROR_INSUFFICIENT_BUFFER.
The extension must set the lpdwDataType parameter of ServerSupportFunction to NULL.
HSE_REQ_MAP_URL_TO_PATH_EX
This request type allows the ISAPI extension to map a logical URL path to a physical path, as well as gathering several types of attributes that are associated with that physical path, such as access control or cache control flags.
In its call to ServerSupportFunction (ISAPI Extensions), the extension should set the dwHSERequest parameter of ServerSupportFunction to HSE_REQ_MAP_URL_TO_PATH_EX. The lpvBuffer parameter of ServerSupportFunction should be set to a pointer to a pointer to a buffer containing the logical path to map. The string must be null-terminated.
The extension must set the lpdwDataType parameter of ServerSupportFunction to a pointer to an HSE_URL_MAPEX_INFO structure. Upon return, the lpszPath member will contain the physical path mapped by the logical path specified in the lpvBuffer parameter of this function. The path size in the HSE_URL_MAPEX_INFO structure is limited to MAX_PATH length. If the length of the physical path is longer than MAX_PATH, the extension should use HSE_REQ_MAP_URL_TO_PATH to avoid errors.
HSE_REQ_SEND_RESPONSE_HEADER
This request type allows the ISAPI extension to request the Web Server to send a complete HTTP response header to the client browser, including the HTTP status, server version, message time, and MIME version.
Note
This request type is deprecated. You should use HSE_REQ_SEND_RESPONSE_HEADER_EX instead.
HSE_REQ_SEND_RESPONSE_HEADER_EX
This request type allows the ISAPI extension to request the Web Server to send a complete HTTP response header to the client browser in an improved way. The response header includes the HTTP status, server version, message time, and MIME version, as for the HSE_REQ_SEND_RESPONSE_HEADER request type.
Note
For this request type, your extension must only call ServerSupportFunction (ISAPI Extensions) once per HTTP request.
Your extension should set the dwHSERequest parameter of ServerSupportFunction to HSE_REQ_SEND_RESPONSE_HEADER_EX. The extension should set the lpvBuffer parameter of ServerSupportFunction to a pointer to an HSE_SEND_HEADER_EX_INFO structure that contains the connection, header, and status information that will be included in the HTTP response headers. Your extension can optionally append other header information to the end of the Web server-generated header, such as Content-Type or Content-Length.
The lpdwSize and lpdwDataType parameters of ServerSupportFunction are unused for this request type.
In general, by specifying the lengths of the header and status strings, you can expect better performance from ServerSupportFunction with this request type than you could expect from the deprecated request type HSE_REQ_SEND_RESPONSE_HEADER. If your extension appends its own headers to the server-generated headers, the extension must terminate the header string with an extra carriage return and a linefeed.
HSE_REQ_SEND_URL
This request type allows the ISAPI extension to redirect a client browser to a different URL from the one initially requested. When the ServerSupportFunction (ISAPI Extensions) is called with this request type, the extension must provide the new URL. The Web Server then sends the HTTP status code 302, URL Redirect, to the client browser.
Note
This request type is identical in effect to HSE_REQ_SEND_URL_REDIRECT_RESP.
In its call to ServerSupportFunction, the extension should set the dwHSERequest parameter to HSE_REQ_SEND_URL. The lpvBuffer parameter of ServerSupportFunction should be set to a pointer to null-terminated string that contains the absolute URL that will serve as the source of the data to send to the browser. The lpdwDataType parameter is unused in this request type.
Once your extension calls the support function with this request type, no other tasks are required of the extension to process the current request. An HTTP status code 302 response should force the browser to initiate a new connection with the new URL.
HSE_REQ_SEND_URL_REDIRECT_RESP
This request type allows the ISAPI extension to redirect a client browser to a different URL from the one initially requested. When the ServerSupportFunction (ISAPI Extensions) is called with this request type, the extension must provide the new URL. The Web Server then sends the HTTP status code 302, URL Redirect, to the client browser.
Note
This request type is identical in effect to HSE_REQ_SEND_URL.
In its call to ServerSupportFunction, the extension should set the dwHSERequest parameter to HSE_REQ_SEND_URL_REDIRECT_RESP. The lpvBuffer parameter of ServerSupportFunction should be set to a pointer to null-terminated string that contains the absolute URL that will serve as the source of the data to send to the browser. The lpdwDataType parameter is unused in this request type.
Once your extension calls the support function with this request type, no other tasks are required of the extension to process the current request. An HTTP status code 302 response should force the browser to initiate a new connection with the new URL.