-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Windows 11 Bug in RtlUnicodeStringToOemString #15038
Description
Windows Terminal version
No response
Windows build number
10.0.22000.1696
Other Software
No response
Steps to reproduce
- In my example, I'm using a German Windows 11 System which has default OEM Codepage CP850
- Enable Legacy console mode:
All Applications that are using RtlUnicodeStringToOemString API are also affected, i.e. File Save support on NTVDMx64
The bug is due to the incorrect codepage being used in RtlOemToUnicodeN API. The codepage gets properly initialized in RtlpInitCodePageTables, but doesn't get used lateron.
Here is a detailled description of the bug, fixing it should be trivial by using the correct codepage:
Analysis
It also contains a test program.
The bug wasn't there on Windows 10 but seems to have been introduced in Win 11 which also introduced other bugs in the Console Host by removal of the NLS Tables in the PEB which I'm also mentioning for the sake of completeness:
( Sidenote:
The removal of the OemCodePageData pointer from PEB in Windows 11 leads to a crash in ConHost V1 when using OEM codepage there, because GlyphCP doesn't get initialized due to the lack of PEB->OemCodePageData.
This in turn leads to crashes in conhost functions:
ConvertOutputToUnicode
FalseUnicodeToRealUnicode
SB_CharToWcharGlyph
The practical result is that conhost crashes when i.e. not using raster font in console, but TTF like "Lucidia Console" and console application runs with OEM codepage.
)
Here is a complied version of the program that is mentioned in the problem analysis description in order to test:
nlstest.zip
Expected Behavior
Entering Umlauts on the keyboard should display the correct Umlauts:
Actual Behavior
See above.



