HSE_TF_INFO

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;
 

Members

pfnHseIO
Points to the callback function that will be called on asynchronous I/O completion. These values, if non-null, will override values set by calling ServerSupportFunction with the HSE_REQ_IO_COMPLETION value set.
pContext
Points to a Context structure that will be used in the asynchronous I/O callback.
hFile
HTTP header and status code. These fields are used only if HSE_IO_SEND_HEADERS is present in dwFlags. The file should 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.
HeadLength
The length of the headers.
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 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.