- 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.

svn path=/trunk/; revision=50836
This commit is contained in:
Pierre Schweitzer 2011-02-20 19:28:34 +00:00
parent 43a5ab1712
commit 35587944a0
2 changed files with 15 additions and 5 deletions

View file

@ -226,9 +226,9 @@ RtlInitNlsTables(IN PUSHORT AnsiTableBase,
*/ */
NTSTATUS NTAPI NTSTATUS NTAPI
RtlMultiByteToUnicodeN( RtlMultiByteToUnicodeN(
IN PWCHAR UnicodeString, OUT PWCHAR UnicodeString,
IN ULONG UnicodeSize, IN ULONG UnicodeSize,
IN PULONG ResultSize, OUT PULONG ResultSize,
IN PCSTR MbString, IN PCSTR MbString,
IN ULONG MbSize) IN ULONG MbSize)
{ {
@ -286,7 +286,7 @@ RtlMultiByteToUnicodeN(
*ResultSize = i * sizeof(WCHAR); *ResultSize = i * sizeof(WCHAR);
} }
return(STATUS_SUCCESS); return STATUS_SUCCESS;
} }

View file

@ -33,13 +33,23 @@ extern USHORT NlsUnicodeDefaultChar;
*/ */
WCHAR WCHAR
NTAPI NTAPI
RtlAnsiCharToUnicodeChar(IN PUCHAR *AnsiChar) RtlAnsiCharToUnicodeChar(IN OUT PUCHAR *AnsiChar)
{ {
ULONG Size; ULONG Size;
NTSTATUS Status; NTSTATUS Status;
WCHAR UnicodeChar = L' '; 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, Status = RtlMultiByteToUnicodeN(&UnicodeChar,
sizeof(WCHAR), sizeof(WCHAR),