Karsten Ohme wrote:
I believe the problem is the following:
Usually the context should only released, if the library is unloaded.
But SCardReleaseContext is called in the Release function, that means
not only the connection to the card is closed, but also the connection
to the resource manager of the system. So, the value of the handle
localHContext is also invalid, because it is a value, which context was
destroyed. So an error occurs.
Set localHContext to 0 is not necessary, because the context should be
cached, so the solution, which would fit better the idea of caching, is
to remove the whole SCardReleaseContext branch, the disconnection is enough.
I think, I have not such problem.
I agree that if the SCardReleaseContext is not called, then
localHContext does not need to be cleared and remains valid. Indeed,
this is what previous beta releases did and our software works fine with
those releases, but the context release was added so I could only assume
that there is some reason for this.
Unfortunately, due to the way the openssl engine code is implemented, it
is not possible to open a context when the library is loaded and release
it when it is unloaded because one does not have the reader and key
identifiers at those points. Moreover, I think it would be impossible to
use more than one reader because the connection to the first card would
cache the context and all other operations would attempt to use the
cached copy.
Cheers,
scott.
_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle