Skip to content
This repository was archived by the owner on May 16, 2024. It is now read-only.

Commit a0f3c5f

Browse files
committed
fix(SCardCall): handle ERROR_IO_DEVICE return code
Signed-off-by: Mart Somermaa <[email protected]>
1 parent 606383c commit a0f3c5f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/SCardCall.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828

2929
#include <string>
3030

31+
#ifdef _WIN32
32+
#include <winerror.h>
33+
#endif // _WIN32
34+
3135
namespace pcsc_cpp
3236
{
3337

@@ -58,11 +62,17 @@ void SCardCall(const char* callerFunctionName, const char* file, int line,
5862
throw ScardNoReadersError(
5963
buildErrorMessage(callerFunctionName, scardFunctionName, result, file, line));
6064
case SCARD_E_NO_SMARTCARD:
65+
#ifdef _WIN32
66+
case ERROR_NO_MEDIA_IN_DRIVE:
67+
#endif // _WIN32
6168
throw ScardNoCardError(
6269
buildErrorMessage(callerFunctionName, scardFunctionName, result, file, line));
6370
case SCARD_E_NOT_READY:
6471
case SCARD_E_INVALID_VALUE:
6572
case SCARD_E_COMM_DATA_LOST:
73+
#ifdef _WIN32
74+
case ERROR_IO_DEVICE:
75+
#endif // _WIN32
6676
throw ScardCardCommunicationFailedError(
6777
buildErrorMessage(callerFunctionName, scardFunctionName, result, file, line));
6878
case SCARD_W_REMOVED_CARD:

0 commit comments

Comments
 (0)