다음을 통해 공유


EXTENSION_CONTROL_BLOCK Structure

This structure is used by IIS and the ISAPI extension to exchange information.

typedef struct _EXTENSION_CONTROL_BLOCK EXTENSION_CONTROL_BLOCK {
      DWORD cbSize;
      DWORD dwVersion;
      HCONN connID;
      DWORD dwHttpStatusCode;
      CHAR lpszLogData[HSE_LOG_BUFFER_LEN];
      LPSTR lpszMethod;
      LPSTR lpszQueryString;
      LPSTR lpszPathInfo;
      LPSTR lpszPathTranslated;
      DWORD cbTotalBytes;
      DWORD cbAvailable;
      LPBYTE lpbData;
      LPSTR lpszContentType;
      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 Function retrieves information about a connection or about the server itself.

  • WriteClient
    WriteClient Function sends the data present in the given buffer to the client that made the request.

  • ReadClient
    ReadClient Function reads data from the body of the client's HTTP request.

  • ServerSupportFunction
    ServerSupportFunction Function returns data for several auxiliary functions not covered by other callback functions.

Remarks

When IIS receives a request for an ISAPI extension, it includes the amount of data in the lpbData parameter up to the amount specified in the UploadReadAheadSize property of the metabase. The UploadReadAheadSize property has a range of 0 bytes to 4 GB and a default value of 48 KB.

Warning

Setting EXTENSION_CONTROL_BLOCK to a large size such as a gigabyte opens your system to the risk of denial-of-service attacks, which can take the form of an encoded request for an infinite-sized chunk transfer.

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.