#include <winscard.h>
LONG SCardSetAttrib(SCARDHANDLE hCard,
DWORD dwAttrId,
LPCBYTE pbAttr,
DWORD cbAttrLen);
| hCard | IN | Connection made from SCardConnect |
| dwAttrId | IN | Identifier for the attribute to get |
| pbAttr | IN | Pointer to a buffer that receives the attribute |
| pcbAttrLen | IN | Length of the pbAttr buffer in bytes |
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.
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);
| SCARD_S_SUCCESS | Successful |
| SCARD_E_NOT_TRANSACTED | Data exchange not successful |