Logo Search packages:      
Sourcecode: pcsc-lite version File versions  Download package

LONG SCardSetAttrib ( SCARDHANDLE  hCard,
DWORD  dwAttrId,
LPCBYTE  pbAttr,
DWORD  cbAttrLen 
)

Set an attribute of the IFD Handler.

The list of attributes you can set is dependent on the IFD Handler you are using.

Parameters:
[in]hCardConnection made from SCardConnect().
[in]dwAttrIdIdentifier for the attribute to set.
[in]pbAttrPointer to a buffer that receives the attribute.
[in]cbAttrLenLength of the pbAttr buffer in bytes.
Returns:
Error code
Return values:
SCARD_S_SUCCESSSuccessful (SCARD_S_SUCCESS)
SCARD_E_INSUFFICIENT_BUFFERcbAttrLen is too big (SCARD_E_INSUFFICIENT_BUFFER)
SCARD_E_INVALID_HANDLEInvalid hCard handle (SCARD_E_INVALID_HANDLE)
SCARD_E_INVALID_PARAMETERA parameter is NULL and should not (SCARD_E_INVALID_PARAMETER)
SCARD_E_NO_SERVICEThe server is not running (SCARD_E_NO_SERVICE)
SCARD_E_NOT_TRANSACTEDData exchange not successful (SCARD_E_NOT_TRANSACTED)
SCARD_E_READER_UNAVAILABLEThe reader has been removed (SCARD_E_READER_UNAVAILABLE)
SCARD_F_COMM_ERRORAn internal communications error has been detected (SCARD_F_COMM_ERROR)
 LONG rv;
 SCARDCONTEXT hContext;
 SCARDHANDLE hCard;
 DWORD dwActiveProtocol;
 unsigned char pbAttr[] = { 0x12, 0x34, 0x56 };
 ...
 rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext);
 rv = SCardConnect(hContext, "Reader X", SCARD_SHARE_SHARED,
          SCARD_PROTOCOL_RAW, &hCard, &dwActiveProtocol);
 rv = SCardSetAttrib(hCard, 0x42000001, pbAttr, sizeof(pbAttr));

Definition at line 2536 of file winscard_clnt.c.

References IFD_ERROR_TAG, IFD_SUCCESS, IFDSetCapabilities(), SCARD_E_INVALID_HANDLE, SCARD_E_INVALID_PARAMETER, SCARD_E_NOT_TRANSACTED, SCARD_E_UNSUPPORTED_FEATURE, SCARD_S_SUCCESS, and SCARD_SET_ATTRIB.

{
      LONG ret;

      PROFILE_START

      if (NULL == pbAttr || 0 == cbAttrLen)
            return SCARD_E_INVALID_PARAMETER;

      ret = SCardGetSetAttrib(hCard, SCARD_SET_ATTRIB, dwAttrId, (LPBYTE)pbAttr,
            &cbAttrLen);

      PROFILE_END(ret)

      return ret;
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index