Smart Card

Benedykt Kubica 1 Reputation point
2021-12-08T09:28:48.233+00:00

How to use SmartCard library (SCardConnect, SCardEstablishContext, etc.) in Win64? They work perfectly well in Win32.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,997 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Benedykt Kubica 1 Reputation point
    2021-12-13T15:13:20.17+00:00

    I'm using Embarcadero RAD Studio (Delphi).


  2. Benedykt Kubica 1 Reputation point
    2021-12-14T08:42:42.63+00:00

    Currently I don't have C++ compiler so I cannot test it.

    I found that in fact the problem is in SCardEstablishContext.

    FReturnCode := SCardEstablishContext(SCARD_SCOPE_USER,
    nil,
    nil,
    @FContext);

    In Win32 FReturnCode is 0 and the handle (FContext) is valid, i.e. SCardIsValidContext(FContext) returns 0.
    In Win64 FReturnCode is still 0 but the handle is also 0, thus invalid.

    0 comments No comments