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