[Pcsclite-muscle] What is CLASS2_IOCTL_MAGIC?

Ludovic Rousseau ludovic.rousseau
Sun Aug 9 01:33:38 PDT 2015


Hello,

2015-08-07 17:26 GMT+02:00 Elfi Heck <EHeck at intarsys.de>:
> I'm asking because it conflicts with this code in rdesktop's scard.c:
>
>         /* Is this a proper Windows smart card ioctl? */
>         if ((dwControlCode & 0xffff0000) == (49 << 16))
>
> rdesktop transforms any control codes you get from a GET_FEATURE_REQUEST into the Windows format for SCARD_CTL_CODE. When you use one of these, the code following the two lines above should transform them back to the Pcsclite format. Except that this doesn't work because the bytes contain CLASS2_IOCTL_MAGIC which overlaps the 0x31 << 16 from the Windows format and the condition always evaluates to false. Makes all class 2 reader functions inaccessible via rdesktop.
>
> I'd like to understand what these bytes do, before reporting a problem to the rdesktop people.

The dwControlCode returned by GET_FEATURE_REQUEST are arbitrary and
should not be interpreted by the application.
These codes are selected by the driver and only the driver need to
interpret them.

What does rdesktop do if the test you copy/pasted fails?

Bye

-- 
 Dr. Ludovic Rousseau




More information about the pcsclite-muscle mailing list