Author: pschweitzer Date: Sun Feb 20 19:28:34 2011 New Revision: 50836
URL: http://svn.reactos.org/svn/reactos?rev=50836&view=rev Log: [RTL] - Fixed RtlMultiByteToUnicodeN & RtlAnsiCharToUnicodeChar prototype - Added missing paged code marker to RtlAnsiCharToUnicodeChar - Added a small hack to RtlAnsiCharToUnicodeChar. Indeed, when it's called during second stage, it's failing due to missing NLS table. Probably usetup that doesn't define a registry entry. And then, FreeLdr just passes null pointer.
Modified: trunk/reactos/lib/rtl/nls.c trunk/reactos/lib/rtl/unicode.c
Modified: trunk/reactos/lib/rtl/nls.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/nls.c?rev=50836&... ============================================================================== --- trunk/reactos/lib/rtl/nls.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/nls.c [iso-8859-1] Sun Feb 20 19:28:34 2011 @@ -226,9 +226,9 @@ */ 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 @@ *ResultSize = i * sizeof(WCHAR); }
- return(STATUS_SUCCESS); + return STATUS_SUCCESS; }
Modified: trunk/reactos/lib/rtl/unicode.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/unicode.c?rev=50836... ============================================================================== --- trunk/reactos/lib/rtl/unicode.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/unicode.c [iso-8859-1] Sun Feb 20 19:28:34 2011 @@ -33,13 +33,23 @@ */ 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),