Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email email@example.com
Re: SCardConnect fails with 0xcccccccc
From: Paul Benware (pbenwareKOOLSPAN.COM)
Date: Sun Sep 07 2003 - 22:14:39 CDT
I found my problem (very strange cut and paste scoping error with two
same-named variables declared - the lazy convenience of on-the-fly C++
variable declarations bit me).
The info on contexts is helpful too. My application needs to do a lot with
the card at startup, but once it's rolling, it's only looking periodically
for the card to see if it's still there.
What about the SCardConnect? How expensive is it to get and release card
handles in comparison to the contexts?
From: SmartCardSDK [mailto:SmartCardSDKDISCUSS.MICROSOFT.COM] On Behalf Of
Sent: Sunday, September 07, 2003 7:35 PM
On which platform are you experiencing this?
There is no limit to the number of times you do the operation below.
On the other hand, establishing a context is expensive in terms of
processing time and memory.
I recommend that you hold to contexts. A context is a communication
channel to the SCRM.
You probably only need one per card your application handles plus one
per thread that does card monitoring (SCardGetStatusChange).
Eric Perlin [MS]
From: SmartCardSDK [mailto:SmartCardSDKDISCUSS.MICROSOFT.COM] On Behalf
Of Paul Benware
Sent: Wednesday, September 03, 2003 11:11 AM
Subject: SCardConnect fails with 0xcccccccc
I have a program that is calling SCardEstablishContext, SCardConnect,
SCardDisconnect, and SCardReleaseContext multiple times successfully
(performing various tasks in between to navigate directories and reading
records from files). At some point in there I call
SCardEstablishContext and get SCARD_ERROR_SUCCESS, and I proceed to call
SCardConnect and I receive an error of 0xcccccccc. This looks
suspiciously like a debugger initialized variable to me, but my return
code variable is set to zero (from the call to SCardEstablishContext.)
So, what could possibly be going on here? Is there a limit to the
number of times you can establish a context, connect to a card and then
disconnect? What is the "normal" practice? Should I try to leave the
context open the card connected throughout all my interactions with the