winscard topic
Windows Smartcard APIs
The Smart Card subsystem, used to provide smartcard-aware applications with access to smartcard-related software resources and readers.
Functions
-
SCardAccessStartedEvent(
) → Win32Result< winscardHANDLE> - Returns an event handle when an event signals that the smart card resource manager is started.
-
SCardAddReaderToGroup(
int hContext, PCWSTR szReaderName, PCWSTR szGroupName) → int winscard - Adds a reader to a reader group.
-
SCardAudit(
int hContext, int dwEvent) → int winscard - Writes event messages to the Windows application log Microsoft-Windows-SmartCard-Audit/Authentication.
-
SCardBeginTransaction(
int hCard) → int winscard - Starts a transaction.
-
SCardCancel(
int hContext) → int winscard - Terminates all outstanding actions within a specific resource manager context.
-
SCardConnect(
int hContext, PCWSTR szReader, int dwPreferredProtocols, Pointer< winscardIntPtr> phCard, Pointer<Uint32> pdwActiveProtocol) → int - Establishes a connection (using a specific resource manager context) between the calling application and a smart card contained by a specific reader.
-
SCardControl(
int hCard, int dwControlCode, Pointer< winscardNativeType> lpInBuffer, int cbInBufferSize, Pointer<NativeType> lpOutBuffer, int cbOutBufferSize, Pointer<Uint32> lpBytesReturned) → int - Gives you direct control of the reader.
-
SCardDisconnect(
int hCard, int dwDisposition) → int winscard - Terminates a connection previously opened between the calling application and a smart card in the target reader.
-
SCardEndTransaction(
int hCard, int dwDisposition) → int winscard - Completes a previously declared transaction, allowing other applications to resume interactions with the card.
-
SCardEstablishContext(
SCARD_SCOPE dwScope, Pointer< winscardIntPtr> phContext) → int - Establishes the resource manager context (the scope) within which database operations are performed.
-
SCardForgetCardType(
int hContext, PCWSTR szCardName) → int winscard - Removes an introduced smart card from the smart card subsystem.
-
SCardForgetReader(
int hContext, PCWSTR szReaderName) → int winscard - Removes a previously introduced reader from control by the smart card subsystem.
-
SCardForgetReaderGroup(
int hContext, PCWSTR szGroupName) → int winscard - Removes a previously introduced smart card reader group from the smart card subsystem.
-
SCardFreeMemory(
int hContext, Pointer< winscardNativeType> pvMem) → int - Releases memory that has been returned from the resource manager using the SCARD_AUTOALLOCATE length designator.
-
SCardGetAttrib(
int hCard, int dwAttrId, Pointer< winscardUint8> ? pbAttr, Pointer<Uint32> pcbAttrLen) → int - Retrieves the current reader attributes for the given handle.
-
SCardGetCardTypeProviderName(
int hContext, PCWSTR szCardName, int dwProviderId, PWSTR szProvider, Pointer< winscardUint32> pcchProvider) → int - Returns the name of the module (dynamic link library) that contains the provider for a given card name and provider type.
-
SCardGetDeviceTypeId(
int hContext, PCWSTR szReaderName, Pointer< winscardUint32> pdwDeviceTypeId) → int - Gets the device type identifier of the card reader for the given reader name.
-
SCardGetProviderId(
int hContext, PCWSTR szCard, Pointer< winscardGUID> pguidProviderId) → int - Returns the identifier (GUID) of the primary service provider for a given card.
-
SCardGetReaderDeviceInstanceId(
int hContext, PCWSTR szReaderName, PWSTR? szDeviceInstanceId, Pointer< winscardUint32> pcchDeviceInstanceId) → int - Gets the device instance identifier of the card reader for the given reader name.
-
SCardGetReaderIcon(
int hContext, PCWSTR szReaderName, Pointer< winscardUint8> pbIcon, Pointer<Uint32> pcbIcon) → int - Gets an icon of the smart card reader for a given reader's name.
-
SCardGetStatusChange(
int hContext, int dwTimeout, Pointer< winscardSCARD_READERSTATE> rgReaderStates, int cReaders) → int - Blocks execution until the current availability of the cards in a specific set of readers changes.
-
SCardGetTransmitCount(
int hCard, Pointer< winscardUint32> pcTransmitCount) → int - Retrieves the number of transmit operations that have completed since the specified card reader was inserted.
-
SCardIntroduceCardType(
int hContext, PCWSTR szCardName, Pointer< winscardGUID> ? pguidPrimaryProvider, Pointer<GUID> ? rgguidInterfaces, int dwInterfaceCount, Pointer<Uint8> pbAtr, Pointer<Uint8> pbAtrMask, int cbAtrLen) → int - Introduces a smart card to the smart card subsystem (for the active user) by adding it to the smart card database.
-
SCardIntroduceReader(
int hContext, PCWSTR szReaderName, PCWSTR szDeviceName) → int winscard - Introduces a new name for an existing smart card reader.
-
SCardIntroduceReaderGroup(
int hContext, PCWSTR szGroupName) → int winscard - Introduces a reader group to the smart card subsystem.
-
SCardIsValidContext(
int hContext) → int winscard - Determines whether a smart card context handle is valid.
-
SCardListCards(
int hContext, Pointer< winscardUint8> ? pbAtr, Pointer<GUID> ? rgquidInterfaces, int cguidInterfaceCount, PWSTR? mszCards, Pointer<Uint32> pcchCards) → int - Searches the smart card database and provides a list of named cards previously introduced to the system by the user.
-
SCardListInterfaces(
int hContext, PCWSTR szCard, Pointer< winscardGUID> pguidInterfaces, Pointer<Uint32> pcguidInterfaces) → int - Provides a list of interfaces supplied by a given card.
-
SCardListReaderGroups(
int hContext, PWSTR? mszGroups, Pointer< winscardUint32> pcchGroups) → int - Provides the list of reader groups that have previously been introduced to the system.
-
SCardListReaders(
int hContext, PCWSTR? mszGroups, PWSTR? mszReaders, Pointer< winscardUint32> pcchReaders) → int - Provides the list of readers within a set of named reader groups, eliminating duplicates.
-
SCardListReadersWithDeviceInstanceId(
int hContext, PCWSTR szDeviceInstanceId, PWSTR? mszReaders, Pointer< winscardUint32> pcchReaders) → int - Gets the list of readers that have provided a device instance identifier.
-
SCardLocateCards(
int hContext, PCWSTR mszCards, Pointer< winscardSCARD_READERSTATE> rgReaderStates, int cReaders) → int - Searches the readers listed in the rgReaderStates parameter for a card with an ATR string that matches one of the card names specified in mszCards, returning immediately with the result.
-
SCardLocateCardsByATR(
int hContext, Pointer< winscardSCARD_ATRMASK> rgAtrMasks, int cAtrs, Pointer<SCARD_READERSTATE> rgReaderStates, int cReaders) → int - Searches the readers listed in the rgReaderStates parameter for a card with a name that matches one of the card names contained in one of the SCARD_ATRMASK structures specified by the rgAtrMasks parameter.
-
SCardReadCache(
int hContext, Pointer< winscardGUID> cardIdentifier, int freshnessCounter, PCWSTR lookupName, Pointer<Uint8> data, Pointer<Uint32> dataLen) → int - Retrieves the value portion of a name-value pair from the global cache maintained by the Smart Card Resource Manager.
-
SCardReconnect(
int hCard, int dwPreferredProtocols, int dwInitialization, Pointer< winscardUint32> ? pdwActiveProtocol) → int - Reestablishes an existing connection between the calling application and a smart card.
-
SCardReleaseContext(
int hContext) → int winscard - Closes an established resource manager context, freeing any resources allocated under that context, including SCARDHANDLE objects and memory allocated using the SCARD_AUTOALLOCATE length designator.
-
SCardReleaseStartedEvent(
) → void winscard - Decrements the reference count for a handle acquired by a previous call to the SCardAccessStartedEvent function.
-
SCardRemoveReaderFromGroup(
int hContext, PCWSTR szReaderName, PCWSTR szGroupName) → int winscard - Removes a reader from an existing reader group.
-
SCardSetAttrib(
int hCard, int dwAttrId, Pointer< winscardUint8> pbAttr, int cbAttrLen) → int - Sets the given reader attribute for the given handle.
-
SCardSetCardTypeProviderName(
int hContext, PCWSTR szCardName, int dwProviderId, PCWSTR szProvider) → int winscard - Specifies the name of the module (dynamic link library) containing the provider for a given card name and provider type.
-
SCardStatus(
int hCard, PWSTR? mszReaderNames, Pointer< winscardUint32> ? pcchReaderLen, Pointer<Uint32> ? pdwState, Pointer<Uint32> ? pdwProtocol, Pointer<Uint8> ? pbAtr, Pointer<Uint32> ? pcbAtrLen) → int - Provides the current status of a smart card in a reader.
-
SCardTransmit(
int hCard, Pointer< winscardSCARD_IO_REQUEST> pioSendPci, Pointer<Uint8> pbSendBuffer, int cbSendLength, Pointer<SCARD_IO_REQUEST> ? pioRecvPci, Pointer<Uint8> pbRecvBuffer, Pointer<Uint32> pcbRecvLength) → int - Sends a service request to the smart card and expects to receive data back from the card.
-
SCardUIDlgSelectCard(
Pointer< winscardOPENCARDNAME_EX> param0) → int - Displays the smart card Select Card dialog box.
-
SCardWriteCache(
int hContext, Pointer< winscardGUID> cardIdentifier, int freshnessCounter, PCWSTR lookupName, Pointer<Uint8> data, int dataLen) → int - Writes a name-value pair from a smart card to the global cache maintained by the Smart Card Resource Manager.