Platform SDK: Smart Card

SCardFreeMemory

The SCardFreeMemory function releases memory that has been returned from the resource manager using the SCARD_AUTOALLOCATE length designator.

LONG SCardFreeMemory(
  IN SCARDCONTEXT hContext,  
  IN LPCVOID pvMem
);

Parameters

hContext
Supplies the handle that identifies the resource manager context returned from SCardEstablishContext, or NULL if the creating function also specified NULL for its hContext (see Smart Card Database Query Functions).
pvMem
Supplies the memory block to be released.

Return Values

This function returns different values depending on whether it succeeds or fails.

Outcome Return value
Success SCARD_S_SUCCESS.
Failure An error code (see Error Codes for a list of all error codes).

Example Code

// Free the memory.
// lReturn is of type LONG.
// hSC was set by an earlier call to SCardEstablishContext.
// pmszReaders was set by an earlier call to SCardListReaders.
lReturn = SCardFreeMemory(hSC,
                          pmszReaders );
if ( SCARD_S_SUCCESS != lReturn )
    printf("Failed SCardFreeMemory\n");

Requirements

  Windows NT/2000: Requires Windows NT 4.0 SP3 or later.
  Windows 95/98: Requires Windows 95 OSR2.1 or later.
  Header: Declared in Winscard.h.  Library: Use Winscard.lib.

See Also

SCardEstablishContext, SCardGetProviderId, SCardListCards' SCardListInterfaces, SCardListReaderGroups, SCardListReaders