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

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

This function 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] hCard Connection made from SCardConnect().
[in] dwAttrId Identifier for the attribute to set.
[in] pbAttr Pointer to a buffer that receives the attribute.
[in] cbAttrLen Length of the pbAttr buffer in bytes.
Returns:
Error code
Return values:
SCARD_S_SUCCESS Successful (SCARD_S_SUCCESS)
SCARD_E_INVALID_HANDLE Invalid hCard handle (SCARD_E_INVALID_HANDLE)
SCARD_E_NO_SERVICE The server is not runing (SCARD_E_NO_SERVICE)
SCARD_E_NOT_TRANSACTED Data exchange not successful (SCARD_E_NOT_TRANSACTED)
SCARD_E_READER_UNAVAILABLE The reader has been removed (SCARD_E_READER_UNAVAILABLE)
SCARD_F_COMM_ERROR An internal communications error has been detected (SCARD_F_COMM_ERROR)
Test:
 LONG rv;
 SCARDCONTEXT hContext;
 SCARDHANDLE hCard;
 DWORD dwActiveProtocol;
 unsigned char pbAtr[MAX_ATR_SIZE];
 DWORD dwAtrLen;
 ...
 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, "\x12\x34\x56", 3);

Definition at line 2649 of file winscard_clnt.c.

References SCARD_E_INVALID_PARAMETER, 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;
}


Generated by  Doxygen 1.6.0   Back to index