From e1275ef81cc287779a22ebcb32eb6148c8d8b951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Thu, 23 Sep 2010 15:20:05 +0000 Subject: [PATCH] commit instead of cancel for win; closes #8 --- src/pcsc.hxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/pcsc.hxx b/src/pcsc.hxx index 4e32906..f20409a 100644 --- a/src/pcsc.hxx +++ b/src/pcsc.hxx @@ -180,7 +180,10 @@ namespace pcsc { [...] t.commit(); // commit if we reach this line } // cancelled, unless commit reaced - @endcode */ + @endcode + + @note Micro$oft QinSCard does not know cancel, therefore + on Windoze cancel is replaced by commit. */ class Transaction { public: //! Begins a transaction. @@ -356,8 +359,15 @@ namespace pcsc { } //! Use scoped transactions with @ref Transaction + /*! @note Micro$oft QinSCard does not know cancel, therefore + on Windoze cancel is replaced by commit. */ void cancelTransaction() { +#ifdef WIN32 + check(SCardEndTransaction(_id, SCARD_LEAVE_CARD), + "smartcard end transaction"); +#else check(SCardCancelTransaction(_id), "smartcard cancel transaction"); +#endif } /*! @throw not_implemented if _protocol is unknown. */