I'm using Embarcadero RAD Studio (Delphi).
Smart Card
Benedykt Kubica
1
Reputation point
How to use SmartCard library (SCardConnect, SCardEstablishContext, etc.) in Win64? They work perfectly well in Win32.
2 answers
Sort by: Most helpful
-
-
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.