diff --git a/reactos/lib/rtl/nls.c b/reactos/lib/rtl/nls.c index 131587ddbc3..697835dd697 100644 --- a/reactos/lib/rtl/nls.c +++ b/reactos/lib/rtl/nls.c @@ -226,9 +226,9 @@ RtlInitNlsTables(IN PUSHORT AnsiTableBase, */ NTSTATUS NTAPI RtlMultiByteToUnicodeN( - IN PWCHAR UnicodeString, + OUT PWCHAR UnicodeString, IN ULONG UnicodeSize, - IN PULONG ResultSize, + OUT PULONG ResultSize, IN PCSTR MbString, IN ULONG MbSize) { @@ -286,7 +286,7 @@ RtlMultiByteToUnicodeN( *ResultSize = i * sizeof(WCHAR); } - return(STATUS_SUCCESS); + return STATUS_SUCCESS; } diff --git a/reactos/lib/rtl/unicode.c b/reactos/lib/rtl/unicode.c index e0b8a4f9741..619bba633a8 100644 --- a/reactos/lib/rtl/unicode.c +++ b/reactos/lib/rtl/unicode.c @@ -33,13 +33,23 @@ extern USHORT NlsUnicodeDefaultChar; */ WCHAR NTAPI -RtlAnsiCharToUnicodeChar(IN PUCHAR *AnsiChar) +RtlAnsiCharToUnicodeChar(IN OUT PUCHAR *AnsiChar) { ULONG Size; NTSTATUS Status; WCHAR UnicodeChar = L' '; - Size = (NlsLeadByteInfo[**AnsiChar] == 0) ? 1 : 2; + PAGED_CODE_RTL(); + + if (NlsLeadByteInfo) + { + Size = (NlsLeadByteInfo[**AnsiChar] == 0) ? 1 : 2; + } + else + { + DPRINT1("HACK::Shouldn't have happened! Consider fixing Usetup and registry entries it creates on install\n"); + Size = 1; + } Status = RtlMultiByteToUnicodeN(&UnicodeChar, sizeof(WCHAR),