commit instead of cancel for win; closes #8

This commit is contained in:
Marc Wäckerlin
2010-09-23 15:20:05 +00:00
parent fac3d6b34b
commit e1275ef81c

View File

@@ -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. */