PC/SC Guide
Prox–DU & Prox–SU
www.gemalto.com
DOC119811A Public Use Page 49/129
SCardCancel Function
The SCardCancel function terminates all outstanding actions within a specific resource
manager context.
The only requests that you can cancel are those that require waiting for external action by
the smart card or user. Any such outstanding action requests will terminate with a status
indication that the action was canceled. This is especially useful to force outstanding
SCardGetStatusChange calls to terminate.
Syntax:
LONG WINAPI SCardCancel(
__in SCARDCONTEXT hContext
);
Parameters:
hContext [in]
Handle that identifies the resource manager context. The resource manager context
is set by a previous call to SCardEstablishContext.
Return Value:
This function returns different values depending on whether it succeeds or fails:
Success: SCARD_S_SUCCESS.
Failure: An error code. For more information, see Smart Card Return Values.
Remarks:
The SCardCancel function is a smart card tracking function. For a description of other
tracking functions, see Smart Card Tracking Functions.
Examples:
The following example cancels all outstanding actions in the specified context. The example
assumes that lReturn is an existing variable of type LONG and that hContext is a valid
handle received from a previous call to SCardEstablishContext.
lReturn = SCardCancel( hContext );
if ( SCARD_S_SUCCESS != lReturn )
printf("Failed SCardCancel\n");