PC/SC Guide
Prox–DU & Prox–SU
www.gemalto.com
DOC119811A Public Use Page 79/129
Linux WinSCard API
The Linux WinSCard API is similar to the Microsoft Windows API with the following
exception:
SCardStatus()
SCardStatus() returns a bit field on pcsc-lite but a enumeration on Windows.
This difference may be resolved in a future version of pcsc-lite. The bit-fields would
then only contain one bit set.
You can have a portable code using:
if (dwState & SCARD_PRESENT)
{
// card is present
}
SCARD_E_UNSUPPORTED_FEATURE
Windows may return ERROR_NOT_SUPPORTED instead of
SCARD_E_UNSUPPORTED_FEATURE
This difference will not be corrected. pcsc-lite only uses SCARD_E_* error codes.
SCARD_E_UNSUPPORTED_FEATURE
For historical reasons the value of SCARD_E_UNSUPPORTED_FEATURE is
0x8010001F in pcsc-lite but 0x80100022 in Windows WinSCard. You should not
have any problem if you always use the symbolic name.
The value 0x8010001F is also used by SCARD_E_UNEXPECTED on pcsc-lite but
SCARD_E_UNEXPECTED is never returned by pcsc-lite. So 0x8010001F does
always means SCARD_E_UNSUPPORTED_FEATURE.
Applications like rdekstop that allow a Windows application to talk to pcsc-lite
should take care of this difference and convert the value between the two worlds.
SCardConnect()
If SCARD_SHARE_DIRECT is used the reader is accessed in shared mode (like
with SCARD_SHARE_SHARED) and not in exclusive mode (like with
SCARD_SHARE_EXCLUSIVE) as on Windows.
SCardEstablishContext()
Each thread of an application shall use its own SCARDCONTEXT. SCardCancel()
is the only exception to the rule. On Windows the same SCARDCONTEXT can be
shared by different threads of same application.
The next functions are available:
SCardEstablishContext
Creates an Application Context for a client.
SCardReleaseContext
Destroys a communication context to the PC/SC Resource
Manager.
SCardIsValidContext
Check if a SCARDCONTEXT is valid.
SCardConnect
Establishes a connection to the reader specified in *
szReader.
SCardReconnect
Reestablishes a connection to a reader that was previously