|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
Re: SCardConnect fails with 0xcccccccc
From: Paul Benware (pbenware
KOOLSPAN.COM)
Date: Sun Sep 07 2003 - 22:14:39 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Thanks Eric.
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?
Thanks,
Paul
-----Original Message-----
From: SmartCardSDK [mailto:SmartCardSDK
DISCUSS.MICROSOFT.COM] On Behalf Of
Eric Perlin
Sent: Sunday, September 07, 2003 7:35 PM
To: SmartCardSDK
DISCUSS.MICROSOFT.COM
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]
-----Original Message-----
From: SmartCardSDK [mailto:SmartCardSDK
DISCUSS.MICROSOFT.COM] On Behalf
Of Paul Benware
Sent: Wednesday, September 03, 2003 11:11 AM
To: SmartCardSDK
DISCUSS.MICROSOFT.COM
Subject: SCardConnect fails with 0xcccccccc
Hi,
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
card?
Thanks,
Paul
pbenware
koolspan.com
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]