PC/SC Guide
Prox–DU & Prox–SU
www.gemalto.com
DOC119811A Public Use Page 41/129
SCardReleaseContext Function
The SCardReleaseContext function closes an established resource manager context,
freeing any resources allocated under that context, including SCARDHANDLE objects and
memory allocated using the SCARD_AUTOALLOCATE length designator.
Syntax:
LONG WINAPI SCardReleaseContext(
__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.
Examples:
The following example shows releasing a context.
// Free the context.
// lReturn is of type LONG.
// hSC was set by an earlier call to SCardEstablishContext.
lReturn = SCardReleaseContext(hSC);
if ( SCARD_S_SUCCESS != lReturn )
printf("Failed SCardReleaseContext\n")