This structure is used by to communicate 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.
typedef struct _HSE_TF_INFO {
PFN_HSE_IO_COMPLETION pfnHseIO;
PVOID pContext; //open files with FILE_FLAG_SEQUENTIAL_SCAN
HANDLE hFile;
LPCSTR pszStatusCode; // HTTP Status Code eg: "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_DISCONNET_AFTER_SEND, ...
} 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 used for header transmission, the ISAPI extension should not send its own header using the HSE_REQ_SEND_RESPONSE_HEADERS or HSE_REQ_SEND_RESPONSE_HEADERS_EX values in ServerSupportFunction. |