Hello, On Feb 3, 2011, at 11:14 PM, Andre Zepezauer wrote: > On Thu, 2011-02-03 at 14:04 -0600, Douglas E. Engert wrote: >> I have updates #321 with a new version of the cardmod patch >> and would like to start to commit it in pieces. >> >> Piece 1 is the attachment I sent on 1/28 as new.martin.patch >> based on Martin's patch from 1/19. This was the patch that would >> work for Brian. The main change is adding two parameters to all >> the *_detect_readers routines. Martin's patch already required these >> to be added in a number of places. >> >> Is there any objection to adding this patch now? > > Yes, why you want to call 'sc_context_create()' altogether. There is not > much functionality in it. So you could easily implement the required > initialisation in 'CardAcquireContext()'.
As the context object is fundamental to all OpenSC API calls, there should be the basic building blocks readily available to be able to use and create contexts in virtually any condition. Minidriver is one such condition, sc_context_create() must be in a shape that it would be usable. The operations done by sc_context_create() documented and suitable for such use. > Next point is reader-pcsc.c: Why do you belief that squeezing in a > second driver namely cardmod is a good idea? I think Douglas is incrementally working on the existing codebase. Why the cardmod driver was squeezed into reader-pcsc.c the way it is in the first place is beyond me, as Francois noted, I "was not very hot about it" [1]. > Why not implement a new > one? Read the documents provided by Microsoft. Most things are managed > by the CSP framework and therefore a reader-cardmod would be straight > forward consisting mostly of stub functions. This requires defining what a reader driver in OpenSC is and what it does? My idea is that reader-XXX.c incorporates the necessary code that translate from the generic sc_*** operations to the API calls to talk to such reader type. Thus OpenCT (ct_* in reader-openct.c), CT-API (CT_* API in loadable modules in reader-ctapi.c) and PC/SC (SCard* API calls in reader-pcsc.c). In this picture there is no new driver, just the code in reader-pcsc.c must be modified to adapt to the way a MiniDriver uses libopensc. > To make things short: Not calling 'sc_context_create()' and implementing > a new reader-driver would make your proposal obsolete. [1] http://www.opensc-project.org/pipermail/opensc-devel/2011-January/015764.html -- @MartinPaljak.net +3725156495 _______________________________________________ opensc-devel mailing list opensc-devel@lists.opensc-project.org http://www.opensc-project.org/mailman/listinfo/opensc-devel