Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than winscard, prefix the name with the module name and a period.
SCardGetStatusChange (winscard)
.
C# Signature:
[DllImport("winscard.dll", CharSet=CharSet.Auto)]
static extern int SCardGetStatusChange(int hContext, int dwTimeout, [In, Out] SCARD_READERSTATE[] rgReaderStates, int cReaders);
User-Defined Types:
None.
Notes:
None.
Tips & Tricks:
Please add some!
Sample Code:
private const int SCARD_STATE_UNAWARE = 0x00000000;
// get ATR of card
// hContext - previously established context
// reader - ATR will be read from card in this reader
private static byte[] atr(int hContext, string reader)
{
int ret;
byte[] atr = null;
SCARD_READERSTATE[] rs = new SCARD_READERSTATE[1];
rs[0].szReader = reader;
rs[0].dwCurrentState = SCARD_STATE_UNAWARE;
ret = SCardGetStatusChange(hContext, 100, rs, 1);
if (ret == 0 && rs[0].cbAtr > 0 && rs[0].rgbAtr != null)
{
atr = new byte[rs[0].cbAtr];
Array.Copy(rs[0].rgbAtr, atr, rs[0].cbAtr);
}
return atr;
}
Alternative Managed API:
TODO
The SCardGetStatusChange function blocks execution until the current availability of the cards in a specific set of readers changes.
12/18/2012 1:16:42 PM - -173.167.132.185
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).