SCardListInterfaces function
The SCardListInterfaces function provides a list of interfaces supplied by a given card.
The caller supplies the name of a smart card previously introduced to the subsystem, and receives the list of interfaces supported by the card.
Syntax
LONG WINAPI SCardListInterfaces( _In_ SCARDCONTEXT hContext, _In_ LPCTSTR szCard, _Out_ LPGUID pguidInterfaces, _Inout_ LPDWORD pcguidInterfaces );
Parameters
- hContext [in]
-
Handle that identifies the resource manager context for the query. The resource manager context can be set by a previous call to SCardEstablishContext. This parameter cannot be NULL.
- szCard [in]
-
Name of the smart card already introduced to the smart card subsystem.
- pguidInterfaces [out]
-
Array of interface identifiers (GUIDs) that indicate the interfaces supported by the smart card. If this value is NULL, SCardListInterfaces ignores the array length supplied in pcguidInterfaces, returning the size of the array that would have been returned if this parameter had not been NULL to pcguidInterfaces and a success code.
- pcguidInterfaces [in, out]
-
Size of the pcguidInterfaces array, and receives the actual size of the returned array. If the array size is specified as SCARD_AUTOALLOCATE, then pcguidInterfaces is converted to a pointer to a GUID pointer, and receives the address of a block of memory containing the array. This block of memory must be deallocated with SCardFreeMemory.
Return value
This function returns different values depending on whether it succeeds or fails.
| Return code | Description |
|---|---|
|
SCARD_S_SUCCESS. |
|
An error code. For more information, see Smart Card Return Values. |
Remarks
This function is not redirected, but calling the function when attempting a Remote Desktop session will not result in an error. It only means that the result will be from the remote computer instead of the local computer.
The SCardListInterfaces function is a database query function. For more information on other database query functions, see Smart Card Database Query Functions.
Examples
The following example shows listing the interfaces for a smart card.
LPGUID pGuids = NULL; LONG lReturn; DWORD cGuid = SCARD_AUTOALLOCATE; // Retrieve the list of interfaces. lReturn = SCardListInterfaces(NULL, (LPCSTR) "MyCard", (LPGUID)&pGuids, &cGuid ); if ( SCARD_S_SUCCESS != lReturn ) { printf("Failed SCardListInterfaces\n"); exit(1); // Or other appropriate action } if ( 0 != cGuid ) { // Do something with the array of Guids. // Remember to free pGuids when done (by SCardFreeMemory). // ... }
Requirements
|
Minimum supported client |
Windows XP [desktop apps only] |
|---|---|
|
Minimum supported server |
Windows Server 2003 [desktop apps only] |
|
Header |
|
|
Library |
|
|
DLL |
|
|
Unicode and ANSI names |
SCardListInterfacesW (Unicode) and SCardListInterfacesA (ANSI) |
See also
- SCardEstablishContext
- SCardFreeMemory
- SCardGetProviderId
- SCardListCards
- SCardListReaderGroups
- SCardListReaders