5.1 WFPCancelAsyncRequest

HRESULT WFPCancelAsyncRequest( hService, RequestID )

Cancels the specified (or every) asynchronous request being performed on the specified service provider, before its (their) completion.

Parameters HSERVICE hService

Handle to the service provider.

REQUESTID RequestID

The request identifier (NULL to cancel all requests for the specified hService).

Mode Immediate. Although the cancellation process itself is asynchronous, the completion message(s) are associated with the original request, not the cancel request (even if they indicate a WFS_ERR_CANCELED status).

Comments If the RequestID parameter is set to NULL, the command will cancel all asynchronous requests on the specified service that are in progress on behalf of the calling application.

A previously initiated asynchronous request is canceled prior to completion by issuing the WFSCancelAsyncRequest function, specifying the request identifier returned by the asynchronous function. This function is immediate with respect to its calling application, but the cancellation process is inherently asynchronous. On completion, the specified request (or all the requests) will have finished, with a completion message indicating a status of WFS_ERR_CANCELED, unless the cancel request was made after the request had completed.

The cancellation applies to the service provider level. The request is passed through the SPI, and the service provider normally then also cancels any physical I/O or other device operation in progress, in the appropriate manner for the device or service.

Error Codes If the function return is not WFS_SUCCESS, it is one of the following error conditions:

WFS_ERR_CONNECTION_LOST
The connection to the service is lost.
WFS_ERR_INTERNAL_ERROR
An internal inconsistency or other unexpected error occurred in the WOSA/XFS subsystem.
WFS_ERR_INVALID_HSERVICE
The hService parameter is not a valid service handle.
WFS_ERR_INVALID_REQ_ID
The RequestID parameter does not correspond to an outstanding request on the service.