WinAPPCCancelAsyncRequest()

This function cancels an outstanding WinAsyncAPPC-based request.

Syntax

int WINAPI WinAPPCCancelAsyncRequest(HANDLE handle);

Parameters

handle
Supplied parameter; specifies the handle of the request to be canceled.

Returned Values

The return value specifies whether the asynchronous request was canceled. If the value is 0, Personal Communications canceled the request. Otherwise, the value is one of the following error codes:
WAPPCINVALID
The specified asynchronous task ID was not valid.
WAPPCALREADY
The asynchronous routine to be canceled has already completed.

Usage Notes

An application program can cancel an asynchronous task that was previously issued with one of the WinAsyncAPPC functions prior to completion, by issuing the WinAPPCCancelAsyncRequest() call, and specifying the asynchronous event as returned by the initial function in the handle.

If the outstanding verb relates to a conversation (for example, SEND_DATA or RECEIVE_AND_WAIT), Personal Communications purges the verb and deactivates the session. If the verb relates to a transaction program (for example, RECEIVE_ALLOCATE or TP_STARTED), Personal Communications ends the transaction program. In both cases, although Personal Communications deactivates conversations and sessions as cleanly as possible, it does not flush send buffers or waiting-for-confirmations or other pending actions. This call is synchronous. After the previously described processing is complete, Personal Communications posts a completion message for the canceled verb.

If an attempt to cancel an existing asynchronous WinAsyncAPPC routine fails with an error code of WAPPCALREADY, the original routine has already completed. Either the application has dealt with the resulting notification, or the application has not dealt with the completion notification. It is not possible to cancel an asynchronous verb issued through the APPC queue-level nonblocking entry point.

See also: