PC/SC Guide
Prox–DU & Prox–SU
www.gemalto.com
DOC119811A Public Use Page 42/129
SCardFreeMemory Function
The SCardFreeMemory function releases memory that has been returned from the resource
manager using the SCARD_AUTOALLOCATE length designator.
Syntax:
LONG WINAPI SCardFreeMemory(
__in SCARDCONTEXT hContext,
__in LPCVOID pvMem
);
Parameters:
hContext [in]
Handle that identifies the resource manager context returned from
SCardEstablishContext, or NULL if the creating function also specified NULL for its
hContext parameter. For more information, see Smart Card Database Query
Functions.
pvMem [in]
Memory block to be released.
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 how to free memory allocated by the resource manager. The
example assumes that lReturn is an existing variable of type LONG, that hSC is a valid
handle to a resource manager context obtained from a previous call to the
SCardEstablishContext function, and that pmszReaders is a string initialized in a previous
call to the SCardListReaders function.
lReturn = SCardFreeMemory(hSC,
pmszReaders );
if ( SCARD_S_SUCCESS != lReturn )
printf("Failed SCardFreeMemory\n");