HSE_TF_INFO

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.

For more information about TransmitFile, consult the Win32 API SDK.

typedef struct _HSE_TF_INFO  {

  PFN_HSE_IO_COMPLETION pfnHseIO;  // Pointer to callback function.

  PVOID pContext;      // Pointer to context value.

  HANDLE hFile;         // File handle to open.

  LPCSTR pszStatusCode; // HTTP status code; for example, "200 OK".

  DWORD BytesToWrite;  // Value of "0" means send entire file.

  DWORD Offset;        // Offset value within file to start from.

  PVOID pHead;         // Pointer to Headers to be sent before file.

  DWORD HeadLength;    // Header length.

  PVOID pTail;         // Pointer to Tail to be sent after file data.

  DWORD TailLength;    // Tail length.

  DWORD dwFlags;       // Includes HSE_IO_DISCONNECT_AFTER_SEND, and so on.

} 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 to start reading.
pHead
An optional pointer to the headers which are to be sent before the file. This field is used only if HSE_IO_SEND_HEADERS is present in dwFlags.
HeadLength
The length of the headers. This field is used only if HSE_IO_SEND_HEADERS is present in dwFlags.
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_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.