Partager via


HSE_TF_INFO Structure

This structure communicates information needed to use the Win32 TransmitFile function. It is supplied by the ISAPI extension when the HSE_REQ_TRANSMIT_FILE parameter is specified for the dwHSERRequest parameter of the ServerSupportFunction Function.

typedef struct _HSE_TF_INFO HSE_TF_INFO {
      PFN_HSE_IO_COMPLETION pfnHseIO;
      PVOID pContext;
      HANDLE hFile;
      LPCSTR pszStatusCode;
      DWORD BytesToWrite;
      DWORD Offset;
      PVOID pHead;
      DWORD HeadLength;
      PVOID pTail;
      DWORD TailLength;
      DWORD dwFlags;
} HSE_TF_INFO, * LPHSE_TF_INFO;

Members

  • pfnHseIO
    Points to the callback function that will be called on asynchronous I/O completion. This value, if non-null, will override values set by calling ServerSupportFunction with the HSE_REQ_IO_COMPLETION value set.

  • pContext
    Points to an application-defined context structure that will be passed as a parameter by IIS when the asynchronous I/O callback function is called.

  • hFile
    Handle to the file to be opened. The file will be opened using the Win32 CreateFile function with the FILE_FLAG_SEQUENTIAL_SCAN and FILE_FLAG_OVERLAPPED values turned on.

  • pszStatusCode
    The HTTP status code.

  • BytesToWrite
    If the value is set to 0, the entire file will be sent.

  • Offset
    The location in the file at which to start reading. Usually, if the Offset is past the end of the file, then the ServerSupportFunction returns a 10022 failure. However, on an SSL request, if the offset is past the end of the file, then it succeeds and continues to the IO completion function, returning the size of the file. The connection is closed, 0 bytes are sent to the client. A Netmon trace returns empty frames.

  • pHead
    An optional pointer to additional data to be sent before the file contents. If HSE_IO_SEND_HEADERS is present in dwFlags, pHead will be interpreted as a NULL terminated string containing optional response headers.

  • HeadLength
    The length of the data in pHead.

  • pTail
    An optional pointer to a tail to be sent after the file.

  • TailLength
    The length of the tail.

  • dwFlags
    Flags that indicate the action to be taken by the server. Can be one of the following values.

    Value

    Meaning

    HSE_IO_ASYNC

    This flag must be set if ServerSupportFunction has been called with the HSE_REQ_TRANSMIT_FILE option.

    HSE_IO_DISCONNECT_AFTER_SEND

    Enables the server to optimally reuse its internal buffers and sockets for future connections. Using this flag improves the responsiveness by using system features optimally. However, the extension will not be able to do any further data transmission if this flag is selected, because the session to the client will be released.

    HSE_IO_NODELAY

    Enables TCP optimization through nagling, which delays the submission of a HTTP packet until the data area is full or a specified timeout period is reached. Nagling is disabled for transmissions if HSE_IO_DELAY is specified on a call to WriteClient or included in the dwFlags member of an HSE_TF_INFO structure that is passed to HSE_REQ_TRANSMIT_FILE.

    HSE_IO_SEND_HEADERS

    Specifies that custom header information should be transmitted to the client. The ISAPI extension can store the status code in the pszStatusCode member of the HSE_TF_INFO structure. When the header flag is turned on, IIS will automatically construct an appropriate HTTP header and send it to the client along with the file contents. If this flag is set, your ISAPI extension must not send its own header using the HSE_REQ_SEND_RESPONSE_HEADERS or HSE_REQ_SEND_RESPONSE_HEADERS_EX values in ServerSupportFunction.

    If this flag is cleared, your ISAPI extension must send all necessary HTTP headers.

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.