Code Monkey home page Code Monkey logo

pcsc's People

Contributors

ccy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pcsc's Issues

make TPCSC.GetPCSCReaderList() a public method

I tried to use the TPCSC class but I was not able to find a method to list the smart card readers.
It looks like the only way to get the reader list is to use events using TPCSC.OnReaderFound.

I am able to use the list TPCSC.ReaderList[] but the list is empty even if a reader is connected.
The list .ReaderList[] is updated by TPCSC.GetPCSCReaderList() at https://github.com/ccy/pcsc/blob/master/MD_PCSC.pas#L895 but I can't call this method as it is private.

Did I miss something?

Using THandle for SCARDCONTEXT and SCARDHANDLE is wrong on GNU/Linux

On GNU/Linux and Windows we have something like:

typedef LONG SCARDCONTEXT;
typedef LONG SCARDHANDLE;

See https://pcsclite.apdu.fr/api/pcsclite_8h.html#a22530ffaff18b5d3e32260a5f1ce4abd
And we also have:

typedef long LONG;

See https://github.com/LudovicRousseau/PCSC/blob/master/src/PCSC/wintypes.h#L92

On a 64-bits CPU the long is 32 bits on Windows but is 64 bits on GNU/Linux.
This is because Windows is a LLP64 system but Linux is a LP64 system. See https://en.wikipedia.org/wiki/64-bit_computing#64-bit_data_models

And THandle is System.THandle which is LongInt which is 32-bits https://www.freepascal.org/docs-html/rtl/sysutils/thandle.html

So your code at https://github.com/ccy/pcsc/blob/master/MD_PCSCRaw.pas#L209 is wrong and will create a stack overflow.
pcsc-lite will write a 64 bits value when your wrapper only provides room for 32 bits.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.