WriteClient

This function is a callback function that is supplied in the EXTENSION_CONTROL_BLOCK for a request sent to the ISAPI extension. It sends the data present in the given buffer to the client that made the request.

BOOL WriteClient(
HCONN ConnID,
LPVOID Buffer,
LPDWORD lpdwBytes,
DWORD dwSync );

Parameters

  • ConnID
    Specifies the connection identifier of the client to which the response data should be sent.
  • Buffer
    Points to the data to be sent.
  • lpdwBytes
    Points to a DWORD that contains the number of bytes from the buffer that will be written to the client when the call is made. The DWORD also contains the number of bytes successfully sent out for synchronous write operations. For asynchronous write operations the returned value has no meaning.
  • dwReserved
    Reserved for future use.

Return Values

If the function succeeds, the return value is TRUE. If an error occurs, the return value is FALSE. The GetLastError function can be called to determine the cause of the error.

Remarks

This function attempts to write the data in the supplied buffer to the same socket that was used for the client request. For synchronous writes, it attempts to write in the calling thread. The thread may become blocked while trying to send the data to client. On completion, WriteClient returns the number of bytes sent in *lpdwBytes.

If you attempt to send more than 16 KB of data over an SSL connection, IIS will break your outgoing data into multiple chunks of 16 KB or smaller.

For asynchronous writes, WriteClient submits the write operation to the system asynchronously and returns from the call immediately. At this point the ISAPI extension may choose to do more background processing or return from the HttpExtensionProc function with a HSE_STATUS_PENDING. When the I/O operation completes, the server calls the callback function submitted by the ISAPI extension with the EXTENSION_CONTROL_BLOCK, context value, number of bytes sent and error codes, if any. It is the responsibility of the ISAPI extension to do further processing and finally use ServerSupportFunction with HSE_DONE_WITH_SESSION set to notify the server when it is finished processing the request.

Only one outstanding asynchronous I/O operation is permitted per request. This limitation applies to calls to asynchronous WriteClient, or to the asynchronous TransmitFile function through the HSE_REQ_TRANSMIT_FILE ServerSupportFunction.

Requirements

Runs On Versions Defined in Include Link to
Windows CE OS 3.0 and later httpext.h   Httpextn.lib, Httpfilt.lib

Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

GetLastError, HttpExtensionProc, ServerSupportFunction, EXTENSION_CONTROL_BLOCK

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.