Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy
scardgetattrib (winscard)
 
.
Summary
"The SCardGetAttrib function gets the current reader attributes for the specified handle. It does not affect the state of the reader, driver, or card." [http://msdn.microsoft.com/en-us/library/aa379559(VS.85).aspx]

C# Signature:

[DllImport("winscard.dll", SetLastError=true)]
static extern Int32 SCardGetAttrib(
   IntPtr hCard,            // Reference value returned from SCardConnect
   UInt32 dwAttrId,         // Identifier for the attribute to get
   byte[] pbAttr,           // Pointer to a buffer that receives the attribute
   ref IntPtr pcbAttrLen    // Length of pbAttr in bytes
);

VB Signature:

Declare Function SCardGetAttrib Lib "winscard.dll" (TODO) As TODO

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

  // SCARD_ATTR_ATR_STRING = SCARD_ATTR_VALUE(SCARD_CLASS_ICC_STATE, 0x0303) in WinSCard.h
  const UInt32 SCARD_ATTR_ATR_STRING = 0x00090303;    
  IntPtr hCard;    // Handle to the card
  Int32 ret;

  // Copy code to establish context here

  // Copy code to connect to the card here

  // Get the Answer to Rest
  byte[] pbAttr = new byte[255];
  IntPtr pcbAttrLen = new IntPtr(pbAttr.Length);
  ret = SCardGetAttrib(hCard, SCARD_ATTR_ATR_STRING, pbAttr, ref pcbAttrLen);

Documentation

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions