Kernel exception on SCardListReaders with no smart card reader fou
From: topixler (topixler_at_noemail.nospam)
Date: Fri, 18 Mar 2005 06:43:15 -0800
I call the following simple sequence in my C++ application source on a
Windows XP Pro SP2 where the SCardSvr is properly running, in order to get
the list of smart card readers installed in the system (I've included all the
Win32 libraries as well as the winscard lib):
LPTSTR pmszReaders = NULL;
DWORD cch = SCARD_AUTOALLOCATE;
SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &x);
LONG lReturn = ::SCardListReaders(x, NULL, (LPTSTR)&pmszReaders, &cch);
// ..... do something to show the card readers list .....
But everytime no card reader is installed, I get a kernel C++ exception from
the SCardListReaders call, even if the call returns
If a smart card reader is found, no exception occures!
All consequent SCardXX calls throw exceptions too!
Any idea what I goes wrong and how to fix it?