Skip to content

Commit

Permalink
Restrict MAX_BUFFER_SIZE_EXTENDED to 65535 (0xFFFF)
Browse files Browse the repository at this point in the history
The previous value 65544 (0x10008) caused problems with Lenovo laptop
with NXP NFC readers.
The output was truncated at 8 bytes. I guess only the low 16bits of the
length were used.

Thanks to Jacopo Jannone to help me find the fix
Fixes #100
"Built-in NFC reader is truncating responses"
  • Loading branch information
LudovicRousseau committed Sep 8, 2021
1 parent 5b43ef5 commit d921883
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions smartcard/scard/scard.i
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#else // !PCSCLITE
// SCARD_CTL_CODE defined in WinSmCrd.h included by Win32 winscard.h
// MAX_BUFFER_SIZE_EXTENDED is pcsc-lite specific
// Windows 7 does not support more than 65544 bytes for SCardControl()
// See https://github.com/LudovicRousseau/pyscard/issues/19
#define MAX_BUFFER_SIZE_EXTENDED 65544
// Issues on Lenovo laptop with NXP reader for higher values
// See https://github.com/LudovicRousseau/pyscard/issues/100
#define MAX_BUFFER_SIZE_EXTENDED 65535
#endif //PCSCLITE

#include "pcsctypes.h"
Expand Down

0 comments on commit d921883

Please sign in to comment.