EXTENSION_CONTROL_BLOCK
This structure is used by IIS and the extension to exchange information.
typedef struct _EXTENSION_CONTROL_BLOCK
{DWORD cbSize; // Size of this struct.
DWORD dwVersion; // Version info of this spec
HCONN ConnID; // Context number not to be modified!
DWORD dwHttpStatusCode; // HTTP Status code
CHAR lpszLogData[HSE_LOG_BUFFER_LEN];// null terminated log info specific to this Extension DLL
LPSTR lpszMethod; // REQUEST_METHOD
LPSTR lpszQueryString; // QUERY_STRING
LPSTR lpszPathInfo; // PATH_INFO
LPSTR lpszPathTranslated; // PATH_TRANSLATED
DWORD cbTotalBytes; // Total bytes indicated from client
DWORD cbAvailable; // Available number of bytes
LPBYTE lpbData; // Pointer to cbAvailable bytes
LPSTR lpszContentType; // Content type of client data
BOOL (WINAPI * GetServerVariable);
BOOL (WINAPI * WriteClient);
BOOL (WINAPI * ReadClient);
BOOL (WINAPI * ServerSupportFunction);
}
Members
-
cbSize (IN)
-
The size of this structure.
-
dwVersion (IN)
-
The version information of this specification. The HIWORD has the major version number and the LOWORD has the minor version number.
-
connID (IN)
-
A unique number assigned by the HTTP server which should not be modified.
-
dwHttpStatusCode (OUT)
-
The status of the current transaction when the request is completed.
-
lpszLogData (OUT)
-
Buffer of size HSE_LOG_BUFFER_LEN. Contains a null-terminated log information string, specific to the ISAPI Extension, of the current transaction. This log information will be entered in the HTTP server log. Maintaining a single log file with both HTTP server and ISAPI extension transactions is very useful for administration purposes.
-
lpszMethod (IN)
-
The HTTP method with which the request was made, for example, GET, or POST. This is equivalent to the CGI variable REQUEST_METHOD.
-
lpszQueryString (IN)
-
A null-terminated string that contains the query information. This is the part of the URL string that appears after the questions mark (?). This is equivalent to the CGI variable QUERY_STRING.
-
lpszPathInfo (IN)
-
A null-terminated string that contains extra path information given by the client. This is the part of the string that appears between the DLL/script name in the URL and the question mark (?). The value is equivalent to the CGI variable PATH_INFO.
-
lpszPathTranslated (IN)
-
A null-terminated string that contains the translated path. This is equivalent to the CGI variable PATH_TRANSLATED.
-
cbTotalBytes (IN)
-
The total number of bytes to be received from the client. This is equivalent to the CGI variable CONTENT_LENGTH. If this value is 0xffffffff, then there are 4 gigabytes or more of available data. In this case, ReadClient should be called until no more data is returned.
-
cbAvailable (IN)
-
The available number of bytes (out of a total of cbTotalBytes) in the buffer pointed to by lpbData. If cbTotalBytes is the same as cbAvailable, the lpbData variable will point to a buffer that contains all the data as sent by the client. Otherwise, cbTotalBytes will contain the total number of bytes of data received. The ISAPI extensions will then need to use the callback function ReadClient to read the rest of the data (beginning from an offset of cbAvailable). With IIS 4.0, you can also use the asynchronous ReadClient facility through ServerSupportFunction with the HSE_REQ_ASYNC_READ_CLIENT value set.
-
lpbData (IN)
-
Points to a buffer of size cbAvailable that has the data sent by the client.
-
lpszContentType (IN)
-
A null-terminated string containing the content type of the data sent by the client. This is equivalent to the CGI variable CONTENT_TYPE.
-
GetServerVariable
-
GetServerVariable retrieves information about a connection or about the server itself.
-
WriteClient
-
WriteClient sends the data present in the given buffer to the client that made the request.
-
ReadClient
-
ReadClient reads data from the body of the client's HTTP request.
-
ServerSupportFunction
-
ServerSupportFunction returns data for several auxiliary functions not covered by other callback functions.
Remarks
When IIS receives a request for an ISAPI extension, it tries to include the amount of data in the lpbData parameter as is specified in the MD_UPLOAD_READAHEAD_SIZE property of the metabase. The default value for this property is 48K, however, it can be set to any size in the range of 0 bytes to 4GB.