SCardReadCacheW function (winscard.h)

The SCardReadCache function retrieves the value portion of a name-value pair from the global cache maintained by the Smart Card Resource Manager.

Syntax

LONG SCardReadCacheW(
  [in]  SCARDCONTEXT hContext,
  [in]  UUID         *CardIdentifier,
  [in]  DWORD        FreshnessCounter,
  [in]  LPWSTR       LookupName,
  [out] PBYTE        Data,
  [out] DWORD        *DataLen
);

Parameters

[in] hContext

A handle that identifies the resource manager context. The resource manager context is set by a previous call to SCardEstablishContext.

[in] CardIdentifier

A pointer to a value that uniquely identifies a smart card. The name-value pair that this function reads from the global cache is associated with this smart card.

[in] FreshnessCounter

The current revision of the cached data.

[in] LookupName

A pointer to a null-terminated string that contains the name portion of the name-value pair for which to retrieve the value portion.

[out] Data

A pointer to an array of byte values that contain the value portion of the name-value pair specified by the LookupName parameter.

[out] DataLen

A pointer to the size, in bytes, of the Data buffer.

Return value

If the function succeeds, it returns SCARD_S_SUCCESS.

If the function fails, it returns one of the following error codes. For more information, see Smart Card Return Values.

Return code/value Description
SCARD_W_CACHE_ITEM_NOT_FOUND
0x80100070
The specified name-value pair was not found in the global cache.
SCARD_W_CACHE_ITEM_STALE
0x80100071
The specified name-value pair was older than requested and has been deleted from the cache.

Remarks

Note

The winscard.h header defines SCardReadCache as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header winscard.h
Library Winscard.lib
DLL Winscard.dll

See also

SCardWriteCache