PC/SC Guide
Prox–DU & Prox–SU
www.gemalto.com
DOC119811A Public Use Page 56/129
SCardBeginTransaction Function
The SCardBeginTransaction function starts a transaction.
The function waits for the completion of all other transactions before it begins. After the
transaction starts, all other applications are blocked from accessing the smart card while the
transaction is in progress.
Syntax:
LONG WINAPI SCardBeginTransaction(
__in SCARDHANDLE hCard
);
Parameters:
hCard [in]
A reference value obtained from a previous call to SCardConnect.
Return Value:
If the function succeeds, it returns SCARD_S_SUCCESS.
If the function fails, it returns an error code. For more information, see Smart Card Return
Values.
Note: This function returns SCARD_S_SUCCESS even if another process or thread has
reset the card. To determine whether the card has been reset, call the SCardStatus function
immediately after calling this function.
Remarks:
The SCardBeginTransaction function is a smart card and reader access function. For more
information on other access functions, see Smart Card and Reader Access Functions.
Examples:
The following example demonstrates how to begin a smart card transaction. The example
assumes that lReturn is an existing variable of type LONG and that hCard is a valid handle
received from a previous call to SCardConnect.
lReturn = SCardBeginTransaction( hCard );
if ( SCARD_S_SUCCESS != lReturn )
printf("Failed SCardBeginTransaction\n");