SCardConnect (winscard)
Last changed: -60.49.32.216

.
Summary
The SCardConnect function establishes a connection (using a specific resource manager context) between the calling application and a smart card contained by a specific reader. If no card exists in the specified reader, an error is returned.

C# Signature:

[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);

User-Defined Types:

Value of dwShareMode

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

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Alternative Managed API:

TODO

Documentation