resolve problem with very old compiler and Mac 10.5; refs #28
This commit is contained in:
		
							
								
								
									
										145
									
								
								src/pcsc.hxx
									
									
									
									
									
								
							
							
						
						
									
										145
									
								
								src/pcsc.hxx
									
									
									
									
									
								
							@@ -573,6 +573,10 @@ namespace pcsc {
 | 
				
			|||||||
      //................................................................methods
 | 
					      //................................................................methods
 | 
				
			||||||
    private:
 | 
					    private:
 | 
				
			||||||
      
 | 
					      
 | 
				
			||||||
 | 
					      mrw::Shared<Reader> newreader(const std::string& name) {
 | 
				
			||||||
 | 
					        return new Reader(name, *this);
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      
 | 
				
			||||||
      //! Sets state and throws an exception if neccessary.
 | 
					      //! Sets state and throws an exception if neccessary.
 | 
				
			||||||
      /*! @throw access_error if it is instanciated for exceptions and
 | 
					      /*! @throw access_error if it is instanciated for exceptions and
 | 
				
			||||||
          an error occured in the last command. */
 | 
					          an error occured in the last command. */
 | 
				
			||||||
@@ -651,17 +655,25 @@ namespace pcsc {
 | 
				
			|||||||
          bool check(const std::string& context="") {
 | 
					          bool check(const std::string& context="") {
 | 
				
			||||||
            if (_exc&&!*this) {
 | 
					            if (_exc&&!*this) {
 | 
				
			||||||
              if (context.size()) {
 | 
					              if (context.size()) {
 | 
				
			||||||
 | 
					#ifdef SCARD_W_WRONG_CHV
 | 
				
			||||||
                if (_state==SCARD_W_WRONG_CHV) {
 | 
					                if (_state==SCARD_W_WRONG_CHV) {
 | 
				
			||||||
                  throw wrong_pin(context+": "+error());
 | 
					                  throw wrong_pin(context+": "+error());
 | 
				
			||||||
                } else {
 | 
					                } else {
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
                  throw access_error(context+": "+error());
 | 
					                  throw access_error(context+": "+error());
 | 
				
			||||||
 | 
					#ifdef SCARD_W_WRONG_CHV
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
              } else {
 | 
					              } else {
 | 
				
			||||||
 | 
					#ifdef SCARD_W_WRONG_CHV
 | 
				
			||||||
                if (_state==SCARD_W_WRONG_CHV) {
 | 
					                if (_state==SCARD_W_WRONG_CHV) {
 | 
				
			||||||
                  throw wrong_pin(error());
 | 
					                  throw wrong_pin(error());
 | 
				
			||||||
                } else {
 | 
					                } else {
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
                  throw access_error(error());
 | 
					                  throw access_error(error());
 | 
				
			||||||
 | 
					#ifdef SCARD_W_WRONG_CHV
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
              }
 | 
					              }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            return *this;
 | 
					            return *this;
 | 
				
			||||||
@@ -671,216 +683,337 @@ namespace pcsc {
 | 
				
			|||||||
          std::string error() const {
 | 
					          std::string error() const {
 | 
				
			||||||
            std::stringstream ss;
 | 
					            std::stringstream ss;
 | 
				
			||||||
            switch (_state) {
 | 
					            switch (_state) {
 | 
				
			||||||
 | 
					#ifdef SCARD_E_CANCELLED
 | 
				
			||||||
              case SCARD_E_CANCELLED:
 | 
					              case SCARD_E_CANCELLED:
 | 
				
			||||||
                ss<<"The action was canceled by an SCardCancel request.";
 | 
					                ss<<"The action was canceled by an SCardCancel request.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_CANT_DISPOSE
 | 
				
			||||||
              case SCARD_E_CANT_DISPOSE:
 | 
					              case SCARD_E_CANT_DISPOSE:
 | 
				
			||||||
                ss<<"The system could not dispose of the media in the requested"
 | 
					                ss<<"The system could not dispose of the media in the requested"
 | 
				
			||||||
                  <<" manner.";
 | 
					                  <<" manner.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_CARD_UNSUPPORTED
 | 
				
			||||||
              case SCARD_E_CARD_UNSUPPORTED:
 | 
					              case SCARD_E_CARD_UNSUPPORTED:
 | 
				
			||||||
                ss<<"The smart card does not meet minimal requirements for"
 | 
					                ss<<"The smart card does not meet minimal requirements for"
 | 
				
			||||||
                  <<" support.";
 | 
					                  <<" support.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_DUPLICATE_READER
 | 
				
			||||||
              case SCARD_E_DUPLICATE_READER:
 | 
					              case SCARD_E_DUPLICATE_READER:
 | 
				
			||||||
                ss<<"The reader driver did not produce a unique reader name.";
 | 
					                ss<<"The reader driver did not produce a unique reader name.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_INSUFFICIENT_BUFFER
 | 
				
			||||||
              case SCARD_E_INSUFFICIENT_BUFFER:
 | 
					              case SCARD_E_INSUFFICIENT_BUFFER:
 | 
				
			||||||
                ss<<"The data buffer for returned data is too small for the"
 | 
					                ss<<"The data buffer for returned data is too small for the"
 | 
				
			||||||
                  <<" returned data.";
 | 
					                  <<" returned data.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_INVALID_ATR
 | 
				
			||||||
              case SCARD_E_INVALID_ATR:
 | 
					              case SCARD_E_INVALID_ATR:
 | 
				
			||||||
                ss<<"An ATR string obtained from the registry is not a valid"
 | 
					                ss<<"An ATR string obtained from the registry is not a valid"
 | 
				
			||||||
                  <<" ATR string.";
 | 
					                  <<" ATR string.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_INVALID_HANDLE
 | 
				
			||||||
              case SCARD_E_INVALID_HANDLE:
 | 
					              case SCARD_E_INVALID_HANDLE:
 | 
				
			||||||
                ss<<"The supplied handle was not valid.";
 | 
					                ss<<"The supplied handle was not valid.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_INVALID_PARAMETER
 | 
				
			||||||
              case SCARD_E_INVALID_PARAMETER:
 | 
					              case SCARD_E_INVALID_PARAMETER:
 | 
				
			||||||
                ss<<"One or more of the supplied parameters could not be properly"
 | 
					                ss<<"One or more of the supplied parameters could not be properly"
 | 
				
			||||||
                  <<" interpreted.";
 | 
					                  <<" interpreted.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_INVALID_TARGET
 | 
				
			||||||
              case SCARD_E_INVALID_TARGET:
 | 
					              case SCARD_E_INVALID_TARGET:
 | 
				
			||||||
                ss<<"Registry startup information is missing or not valid.";
 | 
					                ss<<"Registry startup information is missing or not valid.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_INVALID_VALUE
 | 
				
			||||||
              case SCARD_E_INVALID_VALUE:
 | 
					              case SCARD_E_INVALID_VALUE:
 | 
				
			||||||
                ss<<"One or more of the supplied parameters values could not"
 | 
					                ss<<"One or more of the supplied parameters values could not"
 | 
				
			||||||
                  <<" be properly interpreted.";
 | 
					                  <<" be properly interpreted.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_NOT_READY
 | 
				
			||||||
              case SCARD_E_NOT_READY:
 | 
					              case SCARD_E_NOT_READY:
 | 
				
			||||||
                ss<<"The reader or smart card is not ready to accept commands.";
 | 
					                ss<<"The reader or smart card is not ready to accept commands.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_NOT_TRANSACTED
 | 
				
			||||||
              case SCARD_E_NOT_TRANSACTED:
 | 
					              case SCARD_E_NOT_TRANSACTED:
 | 
				
			||||||
                ss<<"An attempt was made to end a nonexistent transaction.";
 | 
					                ss<<"An attempt was made to end a nonexistent transaction.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_NO_MEMORY
 | 
				
			||||||
              case SCARD_E_NO_MEMORY:
 | 
					              case SCARD_E_NO_MEMORY:
 | 
				
			||||||
                ss<<"Not enough memory available to complete this command.";
 | 
					                ss<<"Not enough memory available to complete this command.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_NO_SERVICE
 | 
				
			||||||
              case SCARD_E_NO_SERVICE:
 | 
					              case SCARD_E_NO_SERVICE:
 | 
				
			||||||
                ss<<"The smart card resource manager is not running.";
 | 
					                ss<<"The smart card resource manager is not running.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_NO_SMARTCARD
 | 
				
			||||||
              case SCARD_E_NO_SMARTCARD:
 | 
					              case SCARD_E_NO_SMARTCARD:
 | 
				
			||||||
                ss<<"The operation requires a smart card, but no smart card"
 | 
					                ss<<"The operation requires a smart card, but no smart card"
 | 
				
			||||||
                  <<" is currently in the device.";
 | 
					                  <<" is currently in the device.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_PCI_TOO_SMALL
 | 
				
			||||||
              case SCARD_E_PCI_TOO_SMALL:
 | 
					              case SCARD_E_PCI_TOO_SMALL:
 | 
				
			||||||
                ss<<"The PCI receive buffer was too small.";
 | 
					                ss<<"The PCI receive buffer was too small.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_PROTO_MISMATCH
 | 
				
			||||||
              case SCARD_E_PROTO_MISMATCH:
 | 
					              case SCARD_E_PROTO_MISMATCH:
 | 
				
			||||||
                ss<<"The requested protocols are incompatible with the protocol"
 | 
					                ss<<"The requested protocols are incompatible with the protocol"
 | 
				
			||||||
                  <<" currently in use with the smart card.";
 | 
					                  <<" currently in use with the smart card.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_READER_UNAVAILABLE
 | 
				
			||||||
              case SCARD_E_READER_UNAVAILABLE:
 | 
					              case SCARD_E_READER_UNAVAILABLE:
 | 
				
			||||||
                ss<<"The specified reader is not currently available for use.";
 | 
					                ss<<"The specified reader is not currently available for use.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_READER_UNSUPPORTED
 | 
				
			||||||
              case SCARD_E_READER_UNSUPPORTED:
 | 
					              case SCARD_E_READER_UNSUPPORTED:
 | 
				
			||||||
                ss<<"The reader driver does not meet minimal requirements for"
 | 
					                ss<<"The reader driver does not meet minimal requirements for"
 | 
				
			||||||
                  <<" support.";
 | 
					                  <<" support.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_SERVICE_STOPPED
 | 
				
			||||||
              case SCARD_E_SERVICE_STOPPED:
 | 
					              case SCARD_E_SERVICE_STOPPED:
 | 
				
			||||||
                ss<<"The smart card resource manager has shut down.";
 | 
					                ss<<"The smart card resource manager has shut down.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_SHARING_VIOLATION
 | 
				
			||||||
              case SCARD_E_SHARING_VIOLATION:
 | 
					              case SCARD_E_SHARING_VIOLATION:
 | 
				
			||||||
                ss<<"The smart card cannot be accessed because of other"
 | 
					                ss<<"The smart card cannot be accessed because of other"
 | 
				
			||||||
                  <<" outstanding connections.";
 | 
					                  <<" outstanding connections.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_SYSTEM_CANCELLED
 | 
				
			||||||
              case SCARD_E_SYSTEM_CANCELLED:
 | 
					              case SCARD_E_SYSTEM_CANCELLED:
 | 
				
			||||||
                ss<<"The action was cancelled by the system, presumably to log"
 | 
					                ss<<"The action was cancelled by the system, presumably to log"
 | 
				
			||||||
                  <<" off or shut down.";
 | 
					                  <<" off or shut down.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_TIMEOUT
 | 
				
			||||||
              case SCARD_E_TIMEOUT:
 | 
					              case SCARD_E_TIMEOUT:
 | 
				
			||||||
                ss<<"The user-specified time-out value has expired.";
 | 
					                ss<<"The user-specified time-out value has expired.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_UNKNOWN_CARD
 | 
				
			||||||
              case SCARD_E_UNKNOWN_CARD:
 | 
					              case SCARD_E_UNKNOWN_CARD:
 | 
				
			||||||
                ss<<"The specified smart card name is not recognized.";
 | 
					                ss<<"The specified smart card name is not recognized.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_UNKNOWN_READER
 | 
				
			||||||
              case SCARD_E_UNKNOWN_READER:
 | 
					              case SCARD_E_UNKNOWN_READER:
 | 
				
			||||||
                ss<<"The specified reader name is not recognized.";
 | 
					                ss<<"The specified reader name is not recognized.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
              case SCARD_E_UNSUPPORTED_FEATURE:
 | 
					#endif
 | 
				
			||||||
                ss<<"This smart card does not support the requested feature.";
 | 
					#ifdef SCARD_F_COMM_ERROR
 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
              case SCARD_F_COMM_ERROR:
 | 
					              case SCARD_F_COMM_ERROR:
 | 
				
			||||||
                ss<<"An internal communications error has been detected.";
 | 
					                ss<<"An internal communications error has been detected.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_F_INTERNAL_ERROR
 | 
				
			||||||
              case SCARD_F_INTERNAL_ERROR:
 | 
					              case SCARD_F_INTERNAL_ERROR:
 | 
				
			||||||
                ss<<"An internal consistency check failed.";
 | 
					                ss<<"An internal consistency check failed.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_F_UNKNOWN_ERROR
 | 
				
			||||||
              case SCARD_F_UNKNOWN_ERROR:
 | 
					              case SCARD_F_UNKNOWN_ERROR:
 | 
				
			||||||
                ss<<"An internal error has been detected, but the source is"
 | 
					                ss<<"An internal error has been detected, but the source is"
 | 
				
			||||||
                  <<" unknown.";
 | 
					                  <<" unknown.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_F_WAITED_TOO_LONG
 | 
				
			||||||
              case SCARD_F_WAITED_TOO_LONG:
 | 
					              case SCARD_F_WAITED_TOO_LONG:
 | 
				
			||||||
                ss<<"An internal consistency timer has expired.";
 | 
					                ss<<"An internal consistency timer has expired.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_S_SUCCESS
 | 
				
			||||||
              case SCARD_S_SUCCESS:
 | 
					              case SCARD_S_SUCCESS:
 | 
				
			||||||
                ss<<"No error was encountered.";
 | 
					                ss<<"No error was encountered.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_W_REMOVED_CARD
 | 
				
			||||||
              case SCARD_W_REMOVED_CARD:
 | 
					              case SCARD_W_REMOVED_CARD:
 | 
				
			||||||
                ss<<"The smart card has been removed, so that further"
 | 
					                ss<<"The smart card has been removed, so that further"
 | 
				
			||||||
                  <<" communication is not possible.";
 | 
					                  <<" communication is not possible.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_W_RESET_CARD
 | 
				
			||||||
              case SCARD_W_RESET_CARD:
 | 
					              case SCARD_W_RESET_CARD:
 | 
				
			||||||
                ss<<"The smart card was reset.";
 | 
					                ss<<"The smart card was reset.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_W_UNPOWERED_CARD
 | 
				
			||||||
              case SCARD_W_UNPOWERED_CARD:
 | 
					              case SCARD_W_UNPOWERED_CARD:
 | 
				
			||||||
                ss<<"Power has been removed from the smart card, so that"
 | 
					                ss<<"Power has been removed from the smart card, so that"
 | 
				
			||||||
                  <<" further communication is not possible.";
 | 
					                  <<" further communication is not possible.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_W_UNRESPONSIVE_CARD
 | 
				
			||||||
              case SCARD_W_UNRESPONSIVE_CARD:
 | 
					              case SCARD_W_UNRESPONSIVE_CARD:
 | 
				
			||||||
                ss<<"The smart card is not responding to a reset.";
 | 
					                ss<<"The smart card is not responding to a reset.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_W_UNSUPPORTED_CARD
 | 
				
			||||||
              case SCARD_W_UNSUPPORTED_CARD:
 | 
					              case SCARD_W_UNSUPPORTED_CARD:
 | 
				
			||||||
                ss<<"The reader cannot communicate with the smart card,"
 | 
					                ss<<"The reader cannot communicate with the smart card,"
 | 
				
			||||||
                  <<" due to ATR configuration conflicts.";
 | 
					                  <<" due to ATR configuration conflicts.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
#ifndef __APPLE__
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_NO_READERS_AVAILABLE
 | 
				
			||||||
              case SCARD_E_NO_READERS_AVAILABLE:
 | 
					              case SCARD_E_NO_READERS_AVAILABLE:
 | 
				
			||||||
                ss<<"No smart card reader is available.";
 | 
					                ss<<"No smart card reader is available.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
#ifdef WIN32
 | 
					#ifdef ERROR_BROKEN_PIPE
 | 
				
			||||||
              case ERROR_BROKEN_PIPE:
 | 
					              case ERROR_BROKEN_PIPE:
 | 
				
			||||||
                ss<<"The client attempted a smart card operation in a"
 | 
					                ss<<"The client attempted a smart card operation in a"
 | 
				
			||||||
                  <<" remote session, such as a client session running"
 | 
					                  <<" remote session, such as a client session running"
 | 
				
			||||||
                  <<" on a terminal server, and the operating system in"
 | 
					                  <<" on a terminal server, and the operating system in"
 | 
				
			||||||
                  <<" use does not support smart card redirection.";
 | 
					                  <<" use does not support smart card redirection.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_BAD_SEEK
 | 
				
			||||||
              case SCARD_E_BAD_SEEK:
 | 
					              case SCARD_E_BAD_SEEK:
 | 
				
			||||||
                ss<<"There was an error trying to set the smart card file"
 | 
					                ss<<"There was an error trying to set the smart card file"
 | 
				
			||||||
                  <<" object pointer.";
 | 
					                  <<" object pointer.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_CERTIFICATE_UNAVAILABLE
 | 
				
			||||||
              case SCARD_E_CERTIFICATE_UNAVAILABLE:
 | 
					              case SCARD_E_CERTIFICATE_UNAVAILABLE:
 | 
				
			||||||
                ss<<"The requested certificate could not be obtained.";
 | 
					                ss<<"The requested certificate could not be obtained.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_COMM_DATA_LOST
 | 
				
			||||||
              case SCARD_E_COMM_DATA_LOST:
 | 
					              case SCARD_E_COMM_DATA_LOST:
 | 
				
			||||||
                ss<<"A communications error with the smart card has been detected.";
 | 
					                ss<<"A communications error with the smart card has been detected.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_DIR_NOT_FOUND
 | 
				
			||||||
              case SCARD_E_DIR_NOT_FOUND:
 | 
					              case SCARD_E_DIR_NOT_FOUND:
 | 
				
			||||||
                ss<<"The specified directory does not exist in the smart card.";
 | 
					                ss<<"The specified directory does not exist in the smart card.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_FILE_NOT_FOUND
 | 
				
			||||||
              case SCARD_E_FILE_NOT_FOUND:
 | 
					              case SCARD_E_FILE_NOT_FOUND:
 | 
				
			||||||
                ss<<"The specified file does not exist in the smart card.";
 | 
					                ss<<"The specified file does not exist in the smart card.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_ICC_CREATEORDER
 | 
				
			||||||
              case SCARD_E_ICC_CREATEORDER:
 | 
					              case SCARD_E_ICC_CREATEORDER:
 | 
				
			||||||
                ss<<"The requested order of object creation is not supported.";
 | 
					                ss<<"The requested order of object creation is not supported.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_ICC_INSTALLATION
 | 
				
			||||||
              case SCARD_E_ICC_INSTALLATION:
 | 
					              case SCARD_E_ICC_INSTALLATION:
 | 
				
			||||||
                ss<<"No primary provider can be found for the smart card.";
 | 
					                ss<<"No primary provider can be found for the smart card.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_INVALID_CHV
 | 
				
			||||||
              case SCARD_E_INVALID_CHV:
 | 
					              case SCARD_E_INVALID_CHV:
 | 
				
			||||||
                ss<<"The supplied PIN is incorrect.";
 | 
					                ss<<"The supplied PIN is incorrect.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_NO_ACCESS
 | 
				
			||||||
              case SCARD_E_NO_ACCESS:
 | 
					              case SCARD_E_NO_ACCESS:
 | 
				
			||||||
                ss<<"Access is denied to this file.";
 | 
					                ss<<"Access is denied to this file.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_NO_DIR
 | 
				
			||||||
              case SCARD_E_NO_DIR:
 | 
					              case SCARD_E_NO_DIR:
 | 
				
			||||||
                ss<<"The supplied path does not represent a smart card directory.";
 | 
					                ss<<"The supplied path does not represent a smart card directory.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_NO_FILE
 | 
				
			||||||
              case SCARD_E_NO_FILE:
 | 
					              case SCARD_E_NO_FILE:
 | 
				
			||||||
                ss<<"The supplied path does not represent a smart card file.";
 | 
					                ss<<"The supplied path does not represent a smart card file.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_NO_KEY_CONTAINER
 | 
				
			||||||
              case SCARD_E_NO_KEY_CONTAINER:
 | 
					              case SCARD_E_NO_KEY_CONTAINER:
 | 
				
			||||||
                ss<<"The requested key container does not exist on the smart card.";
 | 
					                ss<<"The requested key container does not exist on the smart card.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_NO_SUCH_CERTIFICATE
 | 
				
			||||||
              case SCARD_E_NO_SUCH_CERTIFICATE:
 | 
					              case SCARD_E_NO_SUCH_CERTIFICATE:
 | 
				
			||||||
                ss<<"The requested certificate does not exist.";
 | 
					                ss<<"The requested certificate does not exist.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_SERVER_TOO_BUSY
 | 
				
			||||||
              case SCARD_E_SERVER_TOO_BUSY:
 | 
					              case SCARD_E_SERVER_TOO_BUSY:
 | 
				
			||||||
                ss<<"The Smart card resource manager is too busy to complete this"
 | 
					                ss<<"The Smart card resource manager is too busy to complete this"
 | 
				
			||||||
                  <<" operation.";
 | 
					                  <<" operation.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_UNSUPPORTED_FEATURE
 | 
				
			||||||
 | 
					              case SCARD_E_UNSUPPORTED_FEATURE:
 | 
				
			||||||
 | 
					                ss<<"This smart card does not support the requested feature.";
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					#ifdef SCARD_E_UNEXPECTED
 | 
				
			||||||
              case SCARD_E_UNEXPECTED:
 | 
					              case SCARD_E_UNEXPECTED:
 | 
				
			||||||
                ss<<"An unexpected card error has occurred.";
 | 
					                ss<<"An unexpected card error has occurred.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_UNKNOWN_RES_MNG
 | 
				
			||||||
              case SCARD_E_UNKNOWN_RES_MNG:
 | 
					              case SCARD_E_UNKNOWN_RES_MNG:
 | 
				
			||||||
                ss<<"An unrecognized error code was returned from a layered"
 | 
					                ss<<"An unrecognized error code was returned from a layered"
 | 
				
			||||||
                  <<" component.";
 | 
					                  <<" component.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_E_WRITE_TOO_MANY
 | 
				
			||||||
              case SCARD_E_WRITE_TOO_MANY:
 | 
					              case SCARD_E_WRITE_TOO_MANY:
 | 
				
			||||||
                ss<<"The smartcard does not have enough memory to store the"
 | 
					                ss<<"The smartcard does not have enough memory to store the"
 | 
				
			||||||
                  <<" information.";
 | 
					                  <<" information.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_P_SHUTDOWN
 | 
				
			||||||
              case SCARD_P_SHUTDOWN:
 | 
					              case SCARD_P_SHUTDOWN:
 | 
				
			||||||
                ss<<"The operation has been aborted to allow the server application"
 | 
					                ss<<"The operation has been aborted to allow the server application"
 | 
				
			||||||
                  <<" to exit.";
 | 
					                  <<" to exit.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_W_CANCELLED_BY_USER
 | 
				
			||||||
              case SCARD_W_CANCELLED_BY_USER:
 | 
					              case SCARD_W_CANCELLED_BY_USER:
 | 
				
			||||||
                ss<<"The action was cancelled by the user.";
 | 
					                ss<<"The action was cancelled by the user.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_W_CARD_NOT_AUTHENTICATED
 | 
				
			||||||
              case SCARD_W_CARD_NOT_AUTHENTICATED:
 | 
					              case SCARD_W_CARD_NOT_AUTHENTICATED:
 | 
				
			||||||
                ss<<"No PIN was presented to the smart card.";
 | 
					                ss<<"No PIN was presented to the smart card.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_W_CHV_BLOCKED
 | 
				
			||||||
              case SCARD_W_CHV_BLOCKED:
 | 
					              case SCARD_W_CHV_BLOCKED:
 | 
				
			||||||
                ss<<"The card cannot be accessed because the maximum number"
 | 
					                ss<<"The card cannot be accessed because the maximum number"
 | 
				
			||||||
                  <<" of PIN entry attempts has been reached.";
 | 
					                  <<" of PIN entry attempts has been reached.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_W_EOF
 | 
				
			||||||
              case SCARD_W_EOF:
 | 
					              case SCARD_W_EOF:
 | 
				
			||||||
                ss<<"The end of the smart card file has been reached.";
 | 
					                ss<<"The end of the smart card file has been reached.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_W_SECURITY_VIOLATION
 | 
				
			||||||
              case SCARD_W_SECURITY_VIOLATION:
 | 
					              case SCARD_W_SECURITY_VIOLATION:
 | 
				
			||||||
                ss<<"Access was denied because of a security violation.";
 | 
					                ss<<"Access was denied because of a security violation.";
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef SCARD_W_WRONG_CHV
 | 
				
			||||||
              case SCARD_W_WRONG_CHV:
 | 
					              case SCARD_W_WRONG_CHV:
 | 
				
			||||||
                ss<<"The card cannot be accessed because the wrong PIN was"
 | 
					                ss<<"The card cannot be accessed because the wrong PIN was"
 | 
				
			||||||
                  <<" presented.";
 | 
					                  <<" presented.";
 | 
				
			||||||
@@ -927,7 +1060,7 @@ namespace pcsc {
 | 
				
			|||||||
          mrw::Shared<Reader> reader(const std::string& name, Connection* c) {
 | 
					          mrw::Shared<Reader> reader(const std::string& name, Connection* c) {
 | 
				
			||||||
            CRYPTOLOG("get reader: "<<name<<" from "<<(void*)&_readers);
 | 
					            CRYPTOLOG("get reader: "<<name<<" from "<<(void*)&_readers);
 | 
				
			||||||
            if (_readers.find(name)==_readers.end())
 | 
					            if (_readers.find(name)==_readers.end())
 | 
				
			||||||
              _readers.insert(std::make_pair(name, new Reader(name, *c)));
 | 
					              _readers.insert(std::make_pair(name, c->newreader(name)));
 | 
				
			||||||
            return _readers.find(name)->second;
 | 
					            return _readers.find(name)->second;
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user