Skip to content

docs: Analyze NLS format differences between Wine locale.c and ReactOS XP/2003 infrastructure#6

Draft
Copilot wants to merge 1 commit into
masterfrom
copilot/check-nls-sections-format
Draft

docs: Analyze NLS format differences between Wine locale.c and ReactOS XP/2003 infrastructure#6
Copilot wants to merge 1 commit into
masterfrom
copilot/check-nls-sections-format

Conversation

Copy link
Copy Markdown

Copilot AI commented Jun 7, 2026

dll/win32/kernelbase/wine/locale.c targets the Windows Vista+ (NT 6.0) NLS architecture. ReactOS currently implements the XP/2003 (NT 5.x) NLS architecture. The two are incompatible at the file format, section type numbering, and API level — making init_locale() non-functional on ReactOS today.

Analysis written to media/doc/nls_format_analysis.md

NtGetNlsSectionPtr type numbering conflict

The type numbers used by Wine bear no relation to ReactOS's basesrv/nls.c mapping:

Type ReactOS Vista+ / Wine
1–8 Legacy files (unicode.nls, locale.nls, …) STATUS_INVALID_PARAMETER_1these types don't exist in Vista+
9 STATUS_NOT_IMPLEMENTED sortdefault.nls — called unconditionally at startup
10 STATUS_NOT_IMPLEMENTED casemap table (l_intl.nls format)
11 codepage files codepage files ✅ match
12 geo.nls normalization NLS files — direct conflict

Missing/stub APIs in ntdll

  • RtlGetLocaleFileMappingAddressnot exported at all; load_locale_nls() calls it unconditionally
  • NtGetNlsSectionPtr — marked -stub -version=0x600+
  • RtlNormalizeString — marked -stub -version=0x600+
  • NtInitializeNlsFiles — marked -stub -version=0x600+

NLS file format mismatches

  • locale.nls: ReactOS has the old 2003 binary format (no 'NSDS' magic). Wine expects NLS_LOCALE_HEADER + NLS_LOCALE_DATA[] (Vista+ format), which also embeds geo data. Geo data must move out of the separate geo.nls.
  • sortdefault.nls: Does not exist in ReactOS. The old sortkey.nls + sorttbls.nls pair is superseded by a single unified file containing sort weights, casemap, ctypes, sort GUIDs, expansions, compressions, and jamo tables.
  • Normalization NLS files: Absent entirely. NtGetNlsSectionPtr(12, NormalizationC/D/KC/KD, …) finds no files, and type 12 is already occupied by geo.nls.

Codepage NLS files (c_*.nls) — mostly resolved

txt2nls already generates the correct header format with proper TransDefaultChar/TransUniDefaultChar. The old create_nls.c always wrote '?' for those fields and is now obsolete. Two static files (c_856.nls, c_878.nls) still lack .txt sources.

NDK type gap

NLS_LOCALE_HEADER and NLS_LOCALE_DATA are only defined in Wine's sdk/include/wine/winternl.h. They need to be added to the ReactOS NDK headers before RtlGetLocaleFileMappingAddress can be implemented natively.

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

Successfully merging this pull request may close these issues.

2 participants