2009/10/2 Emmanuel Deloget <[email protected]>:
> Ludovic Rousseau a écrit :
>>
>>
>> I just say the reference implementation is winscard in Windows. If
>> pcsc-lite is different then pcsc-lite must be corrected (unless it is
>> a bug on the Windows side)
>>
>> Regards,
>>
>>
>
> Hi Ludovic (and other members of this list),
>
> Your statement is somewhat interesting given the fact that as of today
> there are a few differences between pcsc-lite and winscard which (in my
> opinion) should be addressed in order to enhance  source compatibility
> with existing Windows code. The problem is that some of them might also
> break existing pcsc-lite based applications, so it's kinda hard to
> decide what shall be done in these cases.

I just added a section "Known differences with Microsoft Windows
WinSCard implementation:" in the Doxygen documentation. It is visible
here: http://pcsclite.alioth.debian.org/api/group__API.html#_details

> 1) regarding SCardStatus(): (*pdwState) is filled with a bit field in
> pcsc-lite and an enumeration in winscard. It make sense to tranform the
> internal state bitfield to an enumeration before returning it since the
> card cannot be in two different states at the same time. Unfortunately,
> I believe that such a change would greatly impact existing pcsc-lite
> applications in a subtle way - existing source would appear to be valid
> (compile with no warning or error) but would contain logical errors.

I do not plan to fix this. See the Doxygen note.

> 2) regarding return codes: when writing an ifd handler, it's quite
> difficult (if not impossible) to make sure that a specific error
> condition in the handler will trigger a specific error code on the
> pcsc-lite side. A typical example is SCardGetAttrib() which translate to
> IFDHGetCapabilities() (which, according to
> http://pcsclite.alioth.debian.org/ifdhandler-3/node15.html, can only
> return IFD_SUCCESS, IFD_ERROR_TAG or IFD_NO_SUCH_DEVICE). How do we
> ensure that pcsc-lite would return (for example)
> SCARD_E_INSUFFICIENT_BUFFER when the output buffer is too small ?

I will work on this later. I agree the ifdhandler API can be improved
regarding return codes.
It is easy to add a IFD_INSUFFICIENT_BUFFER.
Do you also want other return codes?

> 3) SCARD_E_UNSUPPORTED_FEATURE: functions that return this error code
> shall return ERROR_NOT_SUPPORTED instead. This is just a change in the
> error name and value, but such change would enhance source compatibility
> with Windows application - and would break source compatibility with
> existing pcsc-lite applications as well.

I do not want to fix this. Using ERROR_NOT_SUPPORTED is stupid. An
SCard* function should only return SCARD_* error codes.

> There are many other cases - I can't list them all right now.

Please list all the other cases you know so they can be fixed or, at
least, documented.

Thanks a lot

-- 
 Dr. Ludovic Rousseau

_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle

Reply via email to