File tree 1 file changed +2
-6
lines changed
library/std/src/sys/windows
1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -25,10 +25,6 @@ pub fn errno() -> i32 {
25
25
26
26
/// Gets a detailed string description for the given error number.
27
27
pub fn error_string ( mut errnum : i32 ) -> String {
28
- // This value is calculated from the macro
29
- // MAKELANGID(LANG_SYSTEM_DEFAULT, SUBLANG_SYS_DEFAULT)
30
- let langId = 0x0800 as c:: DWORD ;
31
-
32
28
let mut buf = [ 0 as c:: WCHAR ; 2048 ] ;
33
29
34
30
unsafe {
@@ -56,13 +52,13 @@ pub fn error_string(mut errnum: i32) -> String {
56
52
flags | c:: FORMAT_MESSAGE_FROM_SYSTEM | c:: FORMAT_MESSAGE_IGNORE_INSERTS ,
57
53
module,
58
54
errnum as c:: DWORD ,
59
- langId ,
55
+ 0 ,
60
56
buf. as_mut_ptr ( ) ,
61
57
buf. len ( ) as c:: DWORD ,
62
58
ptr:: null ( ) ,
63
59
) as usize ;
64
60
if res == 0 {
65
- // Sometimes FormatMessageW can fail e.g., system doesn't like langId,
61
+ // Sometimes FormatMessageW can fail e.g., system doesn't like 0 as langId,
66
62
let fm_err = errno ( ) ;
67
63
return format ! ( "OS Error {errnum} (FormatMessageW() returned error {fm_err})" ) ;
68
64
}
You can’t perform that action at this time.
0 commit comments