I am trying Connecting to smartcard with using connect function of winscard.dll in my WCF project. Wcf service, is publishing with remote machine which machine is installed on windows server 8.1
ScardConnect function is returning value of 6.
public int Connect()
{
int returnCode = -2;
string[] tempStr = new string[3];
returnCode = ModWinsCard.SCardEstablishContext(ModWinsCard.SCARD_SCOPE_USER,
0, 0, ref hContext);
if (returnCode == ModWinsCard.SCARD_S_SUCCESS)
{
returnCode = ModWinsCard.SCardConnect(hContext, "ACS ACR1281 1S Dual Reader PICC 0", ModWinsCard.SCARD_SHARE_SHARED, ModWinsCard.SCARD_PROTOCOL_T0 | ModWinsCard.SCARD_PROTOCOL_T1, ref hCard, ref pdwActiveProtocol);
if (returnCode == ModWinsCard.SCARD_S_SUCCESS)
return 1;
else
return returnCode;
}
else
return returnCode;
}
Interface (IService1)
[OperationContract] [FaultContract(typeof(Service1))] int Connect(int hContext, string szReaderName, ref int phCard, ref int ActiveProtocol);
ScardConnect function
[DllImport("winscard.dll")]
public static extern int SCardConnect(int hContext, string szReaderName, int dwShareMode, int dwPrefProtocol, ref int phCard, ref int ActiveProtocol);
What does it mean return code '6'.
Note: Wcf project build action : x86 Client project build action: x86