Export (0) Print
Expand All
Expand Minimize

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.

Return codeDescription
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");


Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Winscard.h

Library

Winscard.lib

DLL

Winscard.dll

See also

SCardEstablishContext

 

 

Community Additions

ADD
Show:
© 2014 Microsoft