PCSC and WINE

Dion Houston Sr <[email protected]>
Newsgroups gmane.comp.lib.muscle
Message-ID <[email protected]>
Hi all,

I am interested in adding SmartCard support for WINE to support 
digitally signing documents on the Mac through Windows only software.  
It seems the most logical way is to ironically use PCSC-Lite to simulate 
the WINSCARD API.

Since the APIs have the same names, and this is C, my plan is to use 
pointers to functions, load them from the shared library, then use them 
in the equivalent named functions... i.e.

LONG     (*fnSCardEstablishContext) (DWORD, LPCVOID, LPCVOID, 
LPSCARDCONTEXT);
fnSCardEstablishContext = dlsym(lib_handle, "SCardEstablishContext");

LONG SCardEstablishContext(...)
{
     return fnSCardEstablishContext(...)
}

I found a blog post from 2010 that describes well the differences 
between the Windows and Linux/OSX implementations:

http://ludovicrousseau.blogspot.com/2010/04/pcsc-sample-in-c.html

So here are the questions:

- Has anyone already done this?  I've looked in the WINE source tree, 
and the source for WINSCARD.DLL appears to just contact stubs.
- Anyone see any caveats / better ways of doing this?  Specifically I'm 
writing this to work for the Mac, but would like it to be portable.

Thanks in advance - this is my first project for WINE, and the first 
real C programming I've done in a while, but it seems like it's doable.

Dion
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.