Skip to content

SetThreadErrorMode not found in WindowsXP #80

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

Closed
DominicD opened this issue Oct 26, 2020 · 3 comments
Closed

SetThreadErrorMode not found in WindowsXP #80

DominicD opened this issue Oct 26, 2020 · 3 comments

Comments

@DominicD
Copy link

I tried to run my rust binary on WindowsXP however when I use libloading I get an Error which says "SetThreadErrorMode" not found in "Kernel32.dll". In the docs I read the following:

Thread-safety
The implementation strives to be as MT-safe as sanely possible, however due to certain error-handling related resources not always being safe, this library is not MT-safe either.
On Windows Vista and earlier error handling falls back to SetErrorMode, which is not MT-safe. MT-scenarios involving this function may cause a traditional data race;

So I was hoping that SetErrorMode is used which is available on WindowsXP as far as I know.
Is there something I can do to make it work?

If you need more info just tell me
Thanks!

@nagisa
Copy link
Owner

nagisa commented Oct 26, 2020

I don't have access to either Windows version so you will need to submit a PR to fix how libloading uses SetThreadErrorMode. It currently checks whether Windows reports the call being unimplemented and then falls back. In retrospective this is linking to the symbol statically, so there needs to be something else (weak linking?) as well.

@DominicD
Copy link
Author

Thank you for the fast answer.
To be honest I don't have enough knowledge to be able to do something about this myself.
E.g. I don't know what weak linking is.

@nagisa
Copy link
Owner

nagisa commented Feb 6, 2021

Following the drop of support for Windows XP by the rust project we will be doing the same.

I'm happy to accept a PR that adds the support back in a non-broken state, however. But given that libstd itself is no longer supporting XP, that will probably end up being quite infeasible!

@nagisa nagisa closed this as completed Feb 6, 2021
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

2 participants