[DllImport("winscard.dll", EntryPoint="SCardConnect", CharSet=CharSet.Auto)]
static extern int SCardConnect(
int hContext,
[MarshalAs(UnmanagedType.LPTStr)] string szReader,
UInt32 dwShareMode,
UInt32 dwPreferredProtocols,
out int phCard,
out UInt32 pdwActiveProtocol);
<b>Value of dwShareMode:</b>
SCARD_SHARE_SHARED = 0x00000002 -
This application will allow others to share the reader
SCARD_SHARE_EXCLUSIVE = 0x00000001 -
This application will NOT allow others to share the reader
SCARD_SHARE_DIRECT = 0x00000003 -
Direct control of the reader, even without a card
Value of dwPreferredProtocols
SCARD_PROTOCOL_T0 - Use the T=0 protocol (value = 0x00000001)
SCARD_PROTOCOL_T1 - Use the T=1 protocol (value = 0x00000002)
SCARD_PROTOCOL_RAW - Use with memory type cards (value = 0x00000004)
None.
Please add some!
SCARDCONTEXT hContext;
SCARDHANDLE hCard;
DWORD dwActiveProtocol;
LONG rv;
rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext);
rv = SCardConnect(hContext, "Reader X", SCARD_SHARE_SHARED,
SCARD_PROTOCOL_T0, &hCard, &dwActiveProtocol);
TODO