commit instead of cancel for win; closes #8

master
Marc Wäckerlin 14 years ago
parent fac3d6b34b
commit e1275ef81c
  1. 12
      src/pcsc.hxx

@ -180,7 +180,10 @@ namespace pcsc {
[...] [...]
t.commit(); // commit if we reach this line t.commit(); // commit if we reach this line
} // cancelled, unless commit reaced } // cancelled, unless commit reaced
@endcode */ @endcode
@note Micro$oft QinSCard does not know cancel, therefore
on Windoze cancel is replaced by commit. */
class Transaction { class Transaction {
public: public:
//! Begins a transaction. //! Begins a transaction.
@ -356,8 +359,15 @@ namespace pcsc {
} }
//! Use scoped transactions with @ref Transaction //! Use scoped transactions with @ref Transaction
/*! @note Micro$oft QinSCard does not know cancel, therefore
on Windoze cancel is replaced by commit. */
void cancelTransaction() { void cancelTransaction() {
#ifdef WIN32
check(SCardEndTransaction(_id, SCARD_LEAVE_CARD),
"smartcard end transaction");
#else
check(SCardCancelTransaction(_id), "smartcard cancel transaction"); check(SCardCancelTransaction(_id), "smartcard cancel transaction");
#endif
} }
/*! @throw not_implemented if _protocol is unknown. */ /*! @throw not_implemented if _protocol is unknown. */

Loading…
Cancel
Save