OSEC

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: Eric Perlin (ericperlWINDOWS.MICROSOFT.COM)
Date: Sun Sep 07 2003 - 19:34:59 CDT


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:SmartCardSDKDISCUSS.MICROSOFT.COM] On Behalf
Of Paul Benware
Sent: Wednesday, September 03, 2003 11:11 AM
To: SmartCardSDKDISCUSS.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

pbenwarekoolspan.com