diff --git a/src/cryptoki.hxx b/src/cryptoki.hxx index eebe401..5c5ef58 100644 --- a/src/cryptoki.hxx +++ b/src/cryptoki.hxx @@ -2027,7 +2027,7 @@ namespace cryptoki { if (!check(_session._slot.library()->C_GetAttributeValue (_session._session, _object, &attr, 1), CRYPTOKI_FN_LOG("C_GetAttributeValue")) - || !(long)attr.ulValueLen>0l) + || !((long)attr.ulValueLen>0l)) //! Without exception handling, size and type must be checked too. return res; try { diff --git a/src/pcsc.hxx b/src/pcsc.hxx index 87d9b7a..1820369 100644 --- a/src/pcsc.hxx +++ b/src/pcsc.hxx @@ -210,8 +210,9 @@ namespace pcsc { //! State and attribute list of a reader. class Status { public: - Status(unsigned long s, const std::string& a): state(s), atr(a) {} - const unsigned long state; + Status(unsigned DWORD s, const std::string& a): + state(s), atr(a) {} + const unsigned DWORD state; const std::string atr; }; @@ -318,7 +319,7 @@ namespace pcsc { /*! * @note Take care: Strings may contain embedded @c 0. */ - std::string control(unsigned long controlCode, + std::string control(unsigned DWORD controlCode, std::string in) { DWORD len(256); // arbitrary UCHAR dataBuffer[256]; @@ -398,7 +399,7 @@ namespace pcsc { //! Sets state and throws an exception if neccessary. /*! @throw access_error if it is instanciated for exceptions and an error occured in the last command. */ - bool check(long state, const std::string context="") { + bool check(DWORD state, const std::string context="") { _state = state; return _connection->check(state, context); } @@ -585,7 +586,7 @@ namespace pcsc { //! Throws an exception if neccessary. /*! @throw access_error if it is instanciated for exceptions and an error occured in the last command. */ - bool check(long s, const std::string& context="") { + bool check(DWORD s, const std::string& context="") { _state = s; return check(context); } @@ -980,11 +981,11 @@ namespace pcsc { return ss.str(); } //! set state - void state(long s) { + void state(DWORD s) { _state = s; } //! @returns state - long state() { + DWORD state() { return _state; } //! @returns connection id @@ -1000,7 +1001,7 @@ namespace pcsc { bool _exc; SCARDCONTEXT _id; Scope _s; - long _state; + DWORD _state; };