PC/SC Guide
Prox–DU & Prox–SU
www.gemalto.com
DOC119811A Public Use Page 72/129
SCardSetAttrib Function
The SCardSetAttrib function sets the given reader attribute for the given handle. It does not
affect the state of the reader, reader driver, or smart card. Not all attributes are supported by
all readers (nor can they be set at all times) as many of the attributes are under direct
control of the transport protocol.
Syntax:
LONG WINAPI SCardSetAttrib(
__in SCARDHANDLE hCard,
__in DWORD dwAttrId,
__in LPCBYTE pbAttr,
__in DWORD cbAttrLen
);
Parameters:
hCard [in]
Reference value returned from SCardConnect.
dwAttrId [in]
Identifier for the attribute to set. The values are write-only. Note that vendors may
not support all attributes:
SCARD_ATTR_SUPRESS_T1_IFS_REQUEST: Suppress sending of T=1 IFSD
packet from the reader to the card. (Can be used if the currently inserted card does
not support an IFSD request.)
pbAttr [in]
Pointer to a buffer that supplies the attribute whose ID is supplied in dwAttrId.
cbAttrLen [in]
Length (in bytes) of the attribute value in the pbAttr buffer.
Return Value:
This function returns different values depending on whether it succeeds or fails:
Success: SCARD_S_SUCCESS.
Failure: An error code. For more information, see Smart Card Return Values.
Remarks:
The SCardSetAttrib function is a direct card access function. For information about other
direct access functions, see Direct Card Access Functions.
Examples:
The following example shows how to set an attribute.
// Set the attribute.
// hCardHandle was set by a previous call to SCardConnect.
// dwAttrID is a DWORD value, specifying the attribute ID.
// pbAttr points to the buffer of the new value.
// cByte is the count of bytes in the buffer.
lReturn = SCardSetAttrib(hCardHandle,