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

Make the use of "kernel32" more robust #2

Closed
Delgan opened this issue Sep 3, 2020 · 0 comments
Closed

Make the use of "kernel32" more robust #2

Delgan opened this issue Sep 3, 2020 · 0 comments

Comments

@Delgan
Copy link
Owner

Delgan commented Sep 3, 2020

In response to a comment left on StackOverflow:

The project on GitHub should be updated to use kernel32 = ctypes.WinDLL('kernel32', use_last_error=True) and raise exceptions via raise ctypes.WinError(ctypes.get_last_error()). This (1) isolates it from other packages that use the global library loader ctypes.windll, which caches loaded libraries, which cache function pointers, and (2) reliably captures the thread's last error value in C immediately after the FFI call.

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

No branches or pull requests

1 participant