This topic has not yet been rated - Rate this topic

SCardFreeMemory function

Applies to: desktop apps only

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.

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


Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Winscard.h

Library

Winscard.lib

DLL

Winscard.dll

See also

SCardEstablishContext
SCardGetProviderId
SCardListCards
SCardListInterfaces
SCardListReaderGroups
SCardListReaders

 

 

Send comments about this topic to Microsoft

Build date: 3/13/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ