Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pokusew/pcsclite",
"version": "0.6.0",
"version": "0.6.1",
"description": "Bindings over PC/SC to access Smart Cards",
"keywords": [
"nfc",
Expand Down
15 changes: 6 additions & 9 deletions src/pcsclite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,12 @@ PCSCLite::PCSCLite(): m_card_context(0),
postServiceCheck:
#endif // _WIN32

LONG result;
// TODO: consider removing this do-while Windows workaround that should not be needed anymore
do {
// TODO: make dwScope (now hard-coded to SCARD_SCOPE_SYSTEM) customisable
result = SCardEstablishContext(SCARD_SCOPE_SYSTEM,
NULL,
NULL,
&m_card_context);
} while(result == SCARD_E_NO_SERVICE || result == SCARD_E_SERVICE_STOPPED);
// TODO: make dwScope (now hard-coded to SCARD_SCOPE_SYSTEM) customisable
LONG result = SCardEstablishContext(SCARD_SCOPE_SYSTEM,
NULL,
NULL,
&m_card_context);

if (result != SCARD_S_SUCCESS) {
Nan::ThrowError(error_msg("SCardEstablishContext", result).c_str());
} else {
Expand Down