This support function enables your ISAPI extension to call the high-performance Win32® API TransmitFile function to send a file to the client browser. This function accepts as a parameter a pointer to a structure, HSE_TF_INFO, so that you can specify the file handle of the file to be sent, HTTP headers for the response, and other important information.
TransmitFile is carried out asynchronously, so your extension must specify a special callback function so IIS can notify your extension when the asynchronous write operation has completed. You can do this either by using the pfnHseIO member of the HSE_TF_INFO used in the function call, or by using the support function HSE_REQ_IO_COMPLETION.
BOOL ServerSupportFunction(
HCONN ConnID,
DWORD HSE_REQ_TRANSMIT_FILE,
LPVOID lpvBuffer,
LPDWORD lpdwSize,
LPDWORD lpdwDataType
);
If your ISAPI extension does not set a proper callback function, then this support function will fail. If all parameters are present, IIS stores the TransmitFile request in its internal asynchronous I/O queue, and your extension can return the HSE_STATUS_PENDING status code.
Tip In general, invoking TransmitFile with the HSE_REQ_TRANSMIT_FILE ServerSupportFunction is the best-performing type of write operation that is currently available to ISAPI extensions. For more information about ISAPI performance, see Developing Scalable Web Applications.