SCardGetAttrib
The SCardGetAttrib function gets the current reader attributes for the given handle. It does not affect the state of the reader, driver, or card.
LONG SCardGetAttrib(
IN SCARDHANDLE hCard,
IN DWORD dwAttrId,
OUT LPBYTE pbAttr,
IN OUT LPDWORD pcbAttrLen
);
Parameters
-
hCard
-
Supplies the reference value returned from SCardConnect.
-
dwAttrId
-
Supplies the identifier for the attribute to get.
-
pbAttr
-
Points to a buffer that receives the attribute whose ID is supplied in dwAttrId. If this value is NULL, SCardGetAttrib ignores the buffer length supplied in pcbAttrLength, writes the length of the buffer that would have been returned if this parameter had not been NULL to pcbAttrLength, and returns a success code.
-
pcbAttrLength
-
Supplies the length of the pbAttr buffer in bytes, and receives the actual length of the received attribute. If the buffer length is specified as SCARD_AUTOALLOCATE, then pbAttrBuffer is converted to a pointer to a byte pointer, and receives the address of a block of memory containing the attribute. This block of memory must be deallocated with SCardFreeMemory.
Return Values
If the function… |
The return value is… |
Succeeds |
SCARD_S_SUCCESS. |
Fails |
An error code (see Error Codes for a list of all error codes). |
Remarks
SCardGetAttrib is a direct card access function. For a description of other direct access functions, see Direct Card Access Functions.
QuickInfo
Windows NT: Use version 4.0 SP3 and later.
Windows: Use Windows 95 OSR2.1.
Windows CE: Unsupported.
Header: Declared in winscard.h.
Import Library: Link with winscard.lib.
See Also
SCardConnect, SCardFreeMemory, SCardSetAttrib