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 structure.

  DWORD dwVersion;   // Version info of this specification.

  HCONN ConnID;      // Context number not to be modified!

  DWORD dwHttpStatusCode;                // HTTP Status code.

  CHAR   lpszLogData[HSE_LOG_BUFFER_LEN]; // Null-terminated log info.

  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);

} EXTENSION_CONTROL_BLOCK;

 

Members
cbSize
The size of this structure.
dwVersion
The version information of this specification. The HIWORD has the major version number and the LOWORD has the minor version number.
connID
A unique number assigned by the HTTP server; this number should not be modified.
dwHttpStatusCode
The status of the current transaction when the request is completed.
lpszLogData
Buffer of size HSE_LOG_BUFFER_LEN. Contains a null-terminated log information string, specific to the ISAPI extension, for the current transaction. This log information will be entered into the HTTP server log. Maintaining a single log file with both HTTP server and ISAPI extension transactions is useful for administration purposes.
lpszMethod
The HTTP method with which the request was made, for example, GET or POST. This is equivalent to the CGI variable REQUEST_METHOD.
lpszQueryString
A null-terminated string that contains the query information. This is the part of the URL string that appears after the question mark (?). This is equivalent to the CGI variable QUERY_STRING.
lpszPathInfo
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 or script name in the URL and the question mark (?). The value is equivalent to the CGI variable PATH_INFO.
lpszPathTranslated
A null-terminated string that contains the translated path. This is equivalent to the CGI variable PATH_TRANSLATED.
cbTotalBytes
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 four gigabytes or more of available data. In this case, ReadClient should be called until no more data is returned.
cbAvailable
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 version 4.0 and later, you can also use the asynchronous ReadClient facility through ServerSupportFunction with the HSE_REQ_ASYNC_READ_CLIENT value set.
lpbData
Points to a buffer of size cbAvailable that has the data sent by the client.
lpszContentType
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 UploadReadAheadSize property of the metabase. The default value for this property is 48 KB; however, it can be set to any size in the range of 0 bytes to 4 GB.