@@ -107,7 +107,7 @@ namespace
107107 }
108108 char * mszReaders = new char [dwReaders + 2 ];
109109
110- rv = SCardListReaders (context, nullptr , mszReaders, &dwReaders);
110+ rv = SCardListReaders (context, nullptr , (LPWSTR) mszReaders, &dwReaders);
111111 if (rv == SCARD_S_SUCCESS) {
112112 char * readhead = mszReaders;
113113 // Names are separated by a null byte
@@ -143,7 +143,7 @@ namespace
143143 uint8_t pbAtr[MAX_ATR_SIZE] = {0 }; // ATR record
144144 SCUINT dwAtrLen = sizeof (pbAtr); // ATR record size
145145
146- auto rv = SCardStatus (handle, pbReader, &dwReaderLen, &dwState, &dwProt, pbAtr, &dwAtrLen);
146+ auto rv = SCardStatus (handle, (LPWSTR) pbReader, &dwReaderLen, &dwState, &dwProt, pbAtr, &dwAtrLen);
147147 if (rv == SCARD_S_SUCCESS) {
148148 switch (dwProt) {
149149 case SCARD_PROTOCOL_T0:
@@ -431,7 +431,7 @@ namespace
431431 SCARDHANDLE hCard;
432432 SCUINT dwActiveProtocol = SCARD_PROTOCOL_UNDEFINED;
433433 rv = SCardConnect (context,
434- reader_name.toStdString ().c_str (),
434+ (LPWSTR)( reader_name.toStdString ().c_str () ),
435435 SCARD_SHARE_SHARED,
436436 SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1,
437437 &hCard,
@@ -446,7 +446,7 @@ namespace
446446 uint8_t pbAtr[MAX_ATR_SIZE] = {0 };
447447 SCUINT dwAtrLen = sizeof (pbAtr);
448448
449- rv = SCardStatus (hCard, pbReader, &dwReaderLen, &dwState, &dwProt, pbAtr, &dwAtrLen);
449+ rv = SCardStatus (hCard, (LPWSTR) pbReader, &dwReaderLen, &dwState, &dwProt, pbAtr, &dwAtrLen);
450450 if (rv == SCARD_S_SUCCESS && (dwProt == SCARD_PROTOCOL_T0 || dwProt == SCARD_PROTOCOL_T1)) {
451451 // Find which AID to use
452452 SCardAID satr;
@@ -568,7 +568,7 @@ YubiKey::KeyMap YubiKeyInterfacePCSC::findValidKeys(int& connectedKeys)
568568 SCARDHANDLE hCard;
569569 SCUINT dwActiveProtocol = SCARD_PROTOCOL_UNDEFINED;
570570 auto rv = SCardConnect (m_sc_context,
571- reader_name.toStdString ().c_str (),
571+ (LPWSTR)( reader_name.toStdString ().c_str () ),
572572 SCARD_SHARE_SHARED,
573573 SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1,
574574 &hCard,
@@ -589,7 +589,7 @@ YubiKey::KeyMap YubiKeyInterfacePCSC::findValidKeys(int& connectedKeys)
589589 uint8_t pbAtr[MAX_ATR_SIZE] = {0 };
590590 SCUINT dwAtrLen = sizeof (pbAtr);
591591
592- rv = SCardStatus (hCard, pbReader, &dwReaderLen, &dwState, &dwProt, pbAtr, &dwAtrLen);
592+ rv = SCardStatus (hCard, (LPWSTR) pbReader, &dwReaderLen, &dwState, &dwProt, pbAtr, &dwAtrLen);
593593 if (rv != SCARD_S_SUCCESS || (dwProt != SCARD_PROTOCOL_T0 && dwProt != SCARD_PROTOCOL_T1)) {
594594 // Could not read the ATR record or the protocol is not supported
595595 continue ;
0 commit comments