mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 09:13:01 +00:00
Initialize pointers to lead byte info tables.
svn path=/trunk/; revision=4917
This commit is contained in:
parent
b905ce98aa
commit
21ef04df28
1 changed files with 27 additions and 10 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: nls.c,v 1.15 2003/05/21 16:09:30 ekohl Exp $
|
/* $Id: nls.c,v 1.16 2003/06/17 10:44:16 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -22,22 +22,20 @@
|
||||||
|
|
||||||
/* GLOBALS *******************************************************************/
|
/* GLOBALS *******************************************************************/
|
||||||
|
|
||||||
|
|
||||||
UCHAR NlsLeadByteInfo = 0; /* exported */
|
|
||||||
|
|
||||||
USHORT NlsOemLeadByteInfo = 0; /* exported */
|
|
||||||
|
|
||||||
|
|
||||||
USHORT NlsAnsiCodePage = 0; /* exported */
|
USHORT NlsAnsiCodePage = 0; /* exported */
|
||||||
BOOLEAN NlsMbCodePageTag = FALSE; /* exported */
|
BOOLEAN NlsMbCodePageTag = FALSE; /* exported */
|
||||||
PWCHAR NlsAnsiToUnicodeTable = NULL;
|
PWCHAR NlsAnsiToUnicodeTable = NULL;
|
||||||
PCHAR NlsUnicodeToAnsiTable = NULL;
|
PCHAR NlsUnicodeToAnsiTable = NULL;
|
||||||
|
PWCHAR NlsDbcsUnicodeToAnsiTable = NULL;
|
||||||
|
PUSHORT NlsLeadByteInfo = NULL; /* exported */
|
||||||
|
|
||||||
|
|
||||||
USHORT NlsOemCodePage = 0;
|
USHORT NlsOemCodePage = 0;
|
||||||
BOOLEAN NlsMbOemCodePageTag = FALSE; /* exported */
|
BOOLEAN NlsMbOemCodePageTag = FALSE; /* exported */
|
||||||
PWCHAR NlsOemToUnicodeTable = NULL;
|
PWCHAR NlsOemToUnicodeTable = NULL;
|
||||||
PCHAR NlsUnicodeToOemTable =NULL;
|
PCHAR NlsUnicodeToOemTable =NULL;
|
||||||
|
PWCHAR NlsDbcsUnicodeToOemTable = NULL;
|
||||||
|
PUSHORT NlsOemLeadByteInfo = NULL; /* exported */
|
||||||
|
|
||||||
|
|
||||||
PUSHORT NlsUnicodeUpcaseTable = NULL;
|
PUSHORT NlsUnicodeUpcaseTable = NULL;
|
||||||
|
@ -448,14 +446,18 @@ RtlResetRtlTranslations(IN PNLSTABLEINFO NlsTable)
|
||||||
/* Set ANSI data */
|
/* Set ANSI data */
|
||||||
NlsAnsiToUnicodeTable = NlsTable->AnsiTableInfo.MultiByteTable;
|
NlsAnsiToUnicodeTable = NlsTable->AnsiTableInfo.MultiByteTable;
|
||||||
NlsUnicodeToAnsiTable = NlsTable->AnsiTableInfo.WideCharTable;
|
NlsUnicodeToAnsiTable = NlsTable->AnsiTableInfo.WideCharTable;
|
||||||
|
NlsDbcsUnicodeToAnsiTable = (PWCHAR)NlsTable->AnsiTableInfo.WideCharTable;
|
||||||
NlsMbCodePageTag = (NlsTable->AnsiTableInfo.DBCSCodePage != 0);
|
NlsMbCodePageTag = (NlsTable->AnsiTableInfo.DBCSCodePage != 0);
|
||||||
|
NlsLeadByteInfo = NlsTable->AnsiTableInfo.DBCSOffsets;
|
||||||
NlsAnsiCodePage = NlsTable->AnsiTableInfo.CodePage;
|
NlsAnsiCodePage = NlsTable->AnsiTableInfo.CodePage;
|
||||||
DPRINT("Ansi codepage %hu\n", NlsAnsiCodePage);
|
DPRINT("Ansi codepage %hu\n", NlsAnsiCodePage);
|
||||||
|
|
||||||
/* Set OEM data */
|
/* Set OEM data */
|
||||||
NlsOemToUnicodeTable = NlsTable->OemTableInfo.MultiByteTable;
|
NlsOemToUnicodeTable = NlsTable->OemTableInfo.MultiByteTable;
|
||||||
NlsUnicodeToOemTable = NlsTable->OemTableInfo.WideCharTable;
|
NlsUnicodeToOemTable = NlsTable->OemTableInfo.WideCharTable;
|
||||||
|
NlsDbcsUnicodeToOemTable = (PWCHAR)NlsTable->OemTableInfo.WideCharTable;
|
||||||
NlsMbOemCodePageTag = (NlsTable->OemTableInfo.DBCSCodePage != 0);
|
NlsMbOemCodePageTag = (NlsTable->OemTableInfo.DBCSCodePage != 0);
|
||||||
|
NlsOemLeadByteInfo = NlsTable->OemTableInfo.DBCSOffsets;
|
||||||
NlsOemCodePage = NlsTable->OemTableInfo.CodePage;
|
NlsOemCodePage = NlsTable->OemTableInfo.CodePage;
|
||||||
DPRINT("Oem codepage %hu\n", NlsOemCodePage);
|
DPRINT("Oem codepage %hu\n", NlsOemCodePage);
|
||||||
|
|
||||||
|
@ -548,6 +550,9 @@ RtlUnicodeToMultiByteSize(PULONG MbSize,
|
||||||
PWCHAR UnicodeString,
|
PWCHAR UnicodeString,
|
||||||
ULONG UnicodeSize)
|
ULONG UnicodeSize)
|
||||||
{
|
{
|
||||||
|
ULONG UnicodeLength;
|
||||||
|
ULONG MbLength;
|
||||||
|
|
||||||
if (NlsMbCodePageTag == FALSE)
|
if (NlsMbCodePageTag == FALSE)
|
||||||
{
|
{
|
||||||
/* single-byte code page */
|
/* single-byte code page */
|
||||||
|
@ -556,7 +561,19 @@ RtlUnicodeToMultiByteSize(PULONG MbSize,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* multi-byte code page */
|
/* multi-byte code page */
|
||||||
/* FIXME */
|
UnicodeLength = UnicodeSize / sizeof(WCHAR);
|
||||||
|
MbLength = 0;
|
||||||
|
while (UnicodeLength > 0)
|
||||||
|
{
|
||||||
|
if (NlsLeadByteInfo[*UnicodeString] & 0xff00)
|
||||||
|
MbLength++;
|
||||||
|
|
||||||
|
MbLength++;
|
||||||
|
UnicodeLength--;
|
||||||
|
UnicodeString++;
|
||||||
|
}
|
||||||
|
|
||||||
|
*MbSize = MbLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
|
@ -767,8 +784,8 @@ RtlUpperChar (IN CHAR Source)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* single-byte code page */
|
/* multi-byte code page */
|
||||||
/* FIXME: implement the multi-byte stuff!! */
|
/* FIXME */
|
||||||
Destination = Source;
|
Destination = Source;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue