Check-in [6218cc54fc]
Overview
Comment:Added workaround for Google's PCSC where we cannot determine the amount of space required to hold the reader list automatically
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:6218cc54fc39669fa039e2a42819102fa646054f
User & Date: rkeene on 2016-02-16 17:04:58
Other Links: manifest | tags
Context
2016-02-16
23:24
Simplified some slot disconnect logic and updated to store an ID type hint on the slot itself so that if we reinitialize we treat it as the same type of device check-in: fdd66a54cd user: rkeene tags: trunk
17:04
Added workaround for Google's PCSC where we cannot determine the amount of space required to hold the reader list automatically check-in: 6218cc54fc user: rkeene tags: trunk
16:06
Fixed an issue where the mutex released slightly too early check-in: 54d3a148ef user: rkeene tags: trunk
Changes

Modified cackey.c from [3b58f20dd7] to [ebe379d38c].

  4893   4893   
  4894   4894   			cackey_pcsc_disconnect();
  4895   4895   			cackey_pcsc_connect();
  4896   4896   
  4897   4897   			CACKEY_DEBUG_PRINTF("Trying SCardListReaders() again");
  4898   4898   			scard_listreaders_ret = SCardListReaders(*cackey_pcsc_handle, NULL, NULL, &pcsc_readers_len);
  4899   4899   		}
         4900  +
         4901  +		if (scard_listreaders_ret == SCARD_E_INSUFFICIENT_BUFFER) {
         4902  +			CACKEY_DEBUG_PRINTF("Error. SCardListReaders() returned SCARD_E_INSUFFICIENT_BUFFER, assuming this is a bug (e.g., Google PCSC) and allocating a massive amount of space to hold the reader list.");
         4903  +
         4904  +			pcsc_readers_len = 32768;
         4905  +			scard_listreaders_ret = SCARD_S_SUCCESS;
         4906  +		}
  4900   4907   
  4901   4908   		if (scard_listreaders_ret == SCARD_S_SUCCESS && pcsc_readers_len != 0) {
  4902   4909   			pcsc_readers = malloc(pcsc_readers_len);
  4903   4910   			pcsc_readers_s = pcsc_readers;
  4904   4911   
  4905   4912   			scard_listreaders_ret = SCardListReaders(*cackey_pcsc_handle, NULL, pcsc_readers, &pcsc_readers_len);
  4906   4913   			if (scard_listreaders_ret == SCARD_S_SUCCESS) {