Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: avoid endless loop when SCardEstablishContext is not successful #55

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

esskar
Copy link

@esskar esskar commented Sep 13, 2024

We encountered that on systems that have never connected any smart card readers, the application runs on 100%; the reason is the while loop around the SCardEstablishContext

@martinpaljak
Copy link

Maybe drop the sleep and the whole do-while (as the comments say) and have it fail fast instead?

@esskar
Copy link
Author

esskar commented Sep 15, 2024

@martinpaljak You are probably right; i thought about that as the while loop might be there to ensure if enabling the service takes a bit time (the win32 code before). But I do think it is the better solution to let the caller handle that case instead

@esskar
Copy link
Author

esskar commented Sep 25, 2024

Just for information: we published and tested this code internally and got rid of all the hangs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants