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

Usage zero as language id for FormatMessageW() #114983

Merged
merged 1 commit into from
Aug 20, 2023

Conversation

crlf0710
Copy link
Member

This switches the language selection from using system language (note that this might be different than application language, typically stored as thread ui language) to use FormatMessageW default search strategy, which is neutral first, then thread ui lang, then user language, then system language, then English. (See https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-formatmessagew)

This allows the Rust program to take more control of std::io::Error's message field, by setting up thread ui language themselves before hand (which many programs already do).

@rustbot
Copy link
Collaborator

rustbot commented Aug 19, 2023

r? @ChrisDenton

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Aug 19, 2023
@ChrisDenton
Copy link
Contributor

Thanks!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Aug 19, 2023

📌 Commit 4504cc5 has been approved by ChrisDenton

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 19, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 19, 2023
Usage zero as language id for `FormatMessageW()`

This switches the language selection from using system language (note that this might be different than application language, typically stored as thread ui language) to use `FormatMessageW` default search strategy, which is `neutral` first, then `thread ui lang`, then `user language`, then `system language`, then `English`. (See https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-formatmessagew)

This allows the Rust program to take more control of `std::io::Error`'s message field, by setting up thread ui language themselves before hand (which many programs already do).
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 19, 2023
Usage zero as language id for `FormatMessageW()`

This switches the language selection from using system language (note that this might be different than application language, typically stored as thread ui language) to use `FormatMessageW` default search strategy, which is `neutral` first, then `thread ui lang`, then `user language`, then `system language`, then `English`. (See https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-formatmessagew)

This allows the Rust program to take more control of `std::io::Error`'s message field, by setting up thread ui language themselves before hand (which many programs already do).
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 19, 2023
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#114605 (Increase clarity about Hash - Eq consistency in HashMap and HashSet docs)
 - rust-lang#114934 (instantiate response: no unnecessary new universe)
 - rust-lang#114950 (Inline strlen_rt in CStr::from_ptr)
 - rust-lang#114973 (Expose core::error::request_value in std)
 - rust-lang#114983 (Usage zero as language id for `FormatMessageW()`)
 - rust-lang#114991 (remove redundant var rebindings)
 - rust-lang#114992 (const-eval: ensure we never const-execute a function marked rustc_do_not_const_check)
 - rust-lang#115001 (clippy::perf stuff)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit d761a5f into rust-lang:master Aug 20, 2023
11 checks passed
@rustbot rustbot added this to the 1.73.0 milestone Aug 20, 2023
@crlf0710 crlf0710 deleted the formatmsg branch August 20, 2023 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants