Поделиться через


PFN_HSE_IO_COMPLETION Function

Generally, if you use asynchronous I/O operations in your ISAPI extension, then you must provide a special asynchronous callback function of type PFN_HSE_IO_COMPLETION. Unlike the other callback functions, this function must be provided and exposed by your extension, and will be called by IIS. When IIS completes an asynchronous read or write that your extension requested, IIS calls your callback function. The function can be used to read or write more data, or perform necessary resource de-allocation and cleanup.

VOID WINAPI * PFN_HSE_IO_COMPLETION_CALLBACK(
      LPEXTENSION_CONTROL_BLOCK lpECB,
      PVOID pContext,
      DWORD cbIO,
      DWORD dwError
);

Parameters

  • lpECB
    Points to the EXTENSION_CONTROL_BLOCK data structure that is associated with the current, active request.

  • pContext
    Points to an application-defined context that was supplied to IIS when the asynchronous I/O callback function was registered.

  • cbIO
    A DWORD that contains the number of bytes of I/O in the last call.

  • dwError
    The error code returned.

Remarks

If the asynchronous I/O operation was a read operation, and the cbIO parameter indicates that zero bytes were read, then you can assume that the client has closed the connection.

If there is no more work to be done for the current request, this function should clean up the state and notify IIS that the request has ended by using the HSE_REQ_DONE_WITH_SESSION support function.

The error code, specified by the parameter dwError, contains any Win32 error code generated by the asynchronous I/O operation. In addition to the typical Win32 network error codes, there are several special values that are important. If your ISAPI extension has used the HSE_REQ_CLOSE_CONNECTION function of ServerSupportFunction Function, the error ERROR_NETNAME_DELETED will be set. If the connection was broken from the client side, however, the error ERROR_OPERATION_ABORTED will be used.

Requirements

Client: Requires Windows XP Professional, Windows 2000 Professional, or Windows NT Workstation 4.0.

Server: Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server 4.0.

Product: IIS

Header: Declared in httpext.h.

See Also