mirror of
https://github.com/reactos/reactos.git
synced 2025-07-03 01:51:20 +00:00
Implemented basic ANSI/OEM <--> Unicode translation tables.
svn path=/trunk/; revision=2340
This commit is contained in:
parent
286d73f7e6
commit
b639c5def9
4 changed files with 542 additions and 533 deletions
|
@ -53,6 +53,8 @@ VOID CmShutdownRegistry(VOID);
|
||||||
VOID CmImportHive(PCHAR ChunkBase, ULONG ChunkSize);
|
VOID CmImportHive(PCHAR ChunkBase, ULONG ChunkSize);
|
||||||
VOID KdInitSystem(ULONG Reserved, PLOADER_PARAMETER_BLOCK LoaderBlock);
|
VOID KdInitSystem(ULONG Reserved, PLOADER_PARAMETER_BLOCK LoaderBlock);
|
||||||
|
|
||||||
|
VOID RtlpInitNlsTables(VOID);
|
||||||
|
|
||||||
NTSTATUS RtlpInitNlsSections(ULONG Mod1Start,
|
NTSTATUS RtlpInitNlsSections(ULONG Mod1Start,
|
||||||
ULONG Mod1End,
|
ULONG Mod1End,
|
||||||
ULONG Mod2Start,
|
ULONG Mod2Start,
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: main.c,v 1.107 2001/09/24 00:51:16 chorns Exp $
|
/* $Id: main.c,v 1.108 2001/11/02 09:09:50 ekohl Exp $
|
||||||
*
|
*
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* FILE: ntoskrnl/ke/main.c
|
* FILE: ntoskrnl/ke/main.c
|
||||||
|
@ -944,6 +944,9 @@ ExpInitializeExecutive(VOID)
|
||||||
(PADDRESS_RANGE)&KeMemoryMap,
|
(PADDRESS_RANGE)&KeMemoryMap,
|
||||||
KeMemoryMapRangeCount);
|
KeMemoryMapRangeCount);
|
||||||
|
|
||||||
|
/* create default nls tables */
|
||||||
|
RtlpInitNlsTables();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize the kernel debugger
|
* Initialize the kernel debugger
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: nls.c,v 1.5 2001/06/29 20:42:47 ekohl Exp $
|
/* $Id: nls.c,v 1.6 2001/11/02 09:10:49 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -38,18 +38,111 @@ USHORT NlsOemLeadByteInfo = 0;
|
||||||
USHORT NlsAnsiCodePage = 0;
|
USHORT NlsAnsiCodePage = 0;
|
||||||
USHORT NlsOemCodePage = 0; /* not exported */
|
USHORT NlsOemCodePage = 0; /* not exported */
|
||||||
|
|
||||||
|
PWCHAR AnsiToUnicodeTable = NULL; /* size: 256*sizeof(WCHAR) */
|
||||||
|
PWCHAR OemToUnicodeTable = NULL; /* size: 256*sizeof(WCHAR) */
|
||||||
|
|
||||||
#if 0
|
PCHAR UnicodeToAnsiTable = NULL; /* size: 65536*sizeof(CHAR) */
|
||||||
WCHAR AnsiToUnicodeTable[256];
|
PCHAR UnicodeToOemTable =NULL; /* size: 65536*sizeof(CHAR) */
|
||||||
WCHAR OemToUnicodeTable[256];
|
|
||||||
|
|
||||||
CHAR UnicodeToAnsiTable [65536];
|
PWCHAR UnicodeUpcaseTable = NULL; /* size: 65536*sizeof(WCHAR) */
|
||||||
CHAR UnicodeToOemTable [65536];
|
PWCHAR UnicodeLowercaseTable = NULL; /* size: 65536*sizeof(WCHAR) */
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
|
VOID
|
||||||
|
RtlpInitNlsTables(VOID)
|
||||||
|
{
|
||||||
|
INT i;
|
||||||
|
PCHAR pc;
|
||||||
|
PWCHAR pwc;
|
||||||
|
|
||||||
|
/* allocate and initialize ansi->unicode table */
|
||||||
|
AnsiToUnicodeTable = ExAllocatePool(NonPagedPool, 256 * sizeof(WCHAR));
|
||||||
|
if (AnsiToUnicodeTable == NULL)
|
||||||
|
{
|
||||||
|
DbgPrint("Allocation of 'AnsiToUnicodeTable' failed\n");
|
||||||
|
KeBugCheck(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
pwc = AnsiToUnicodeTable;
|
||||||
|
for (i = 0; i < 256; i++, pwc++)
|
||||||
|
*pwc = (WCHAR)i;
|
||||||
|
|
||||||
|
/* allocate and initialize oem->unicode table */
|
||||||
|
OemToUnicodeTable = ExAllocatePool(NonPagedPool, 256 * sizeof(WCHAR));
|
||||||
|
if (OemToUnicodeTable == NULL)
|
||||||
|
{
|
||||||
|
DbgPrint("Allocation of 'OemToUnicodeTable' failed\n");
|
||||||
|
KeBugCheck(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
pwc = OemToUnicodeTable;
|
||||||
|
for (i = 0; i < 256; i++, pwc++)
|
||||||
|
*pwc = (WCHAR)i;
|
||||||
|
|
||||||
|
/* allocate and initialize unicode->ansi table */
|
||||||
|
UnicodeToAnsiTable = ExAllocatePool(NonPagedPool, 65536 * sizeof(CHAR));
|
||||||
|
if (UnicodeToAnsiTable == NULL)
|
||||||
|
{
|
||||||
|
DbgPrint("Allocation of 'UnicodeToAnsiTable' failed\n");
|
||||||
|
KeBugCheck(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
pc = UnicodeToAnsiTable;
|
||||||
|
for (i = 0; i < 256; i++, pc++)
|
||||||
|
*pc = (CHAR)i;
|
||||||
|
for (; i < 65536; i++, pc++)
|
||||||
|
*pc = 0;
|
||||||
|
|
||||||
|
/* allocate and initialize unicode->oem table */
|
||||||
|
UnicodeToOemTable = ExAllocatePool(NonPagedPool, 65536 * sizeof(CHAR));
|
||||||
|
if (UnicodeToOemTable == NULL)
|
||||||
|
{
|
||||||
|
DbgPrint("Allocation of 'UnicodeToOemTable' failed\n");
|
||||||
|
KeBugCheck(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
pc = UnicodeToOemTable;
|
||||||
|
for (i = 0; i < 256; i++, pc++)
|
||||||
|
*pc = (CHAR)i;
|
||||||
|
for (; i < 65536; i++, pc++)
|
||||||
|
*pc = 0;
|
||||||
|
|
||||||
|
/* allocate and initialize unicode upcase table */
|
||||||
|
UnicodeUpcaseTable = ExAllocatePool(NonPagedPool, 65536 * sizeof(WCHAR));
|
||||||
|
if (UnicodeUpcaseTable == NULL)
|
||||||
|
{
|
||||||
|
DbgPrint("Allocation of 'UnicodeUpcaseTable' failed\n");
|
||||||
|
KeBugCheck(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
pwc = UnicodeUpcaseTable;
|
||||||
|
for (i = 0; i < 65536; i++, pwc++)
|
||||||
|
*pwc = (WCHAR)i;
|
||||||
|
for (i = 'a'; i < ('z'+ 1); i++)
|
||||||
|
UnicodeUpcaseTable[i] = (WCHAR)i + (L'A' - L'a');
|
||||||
|
|
||||||
|
|
||||||
|
/* allocate and initialize unicode lowercase table */
|
||||||
|
UnicodeLowercaseTable = ExAllocatePool(NonPagedPool, 65536 * sizeof(WCHAR));
|
||||||
|
if (UnicodeLowercaseTable == NULL)
|
||||||
|
{
|
||||||
|
DbgPrint("Allocation of 'UnicodeLowercaseTable' failed\n");
|
||||||
|
KeBugCheck(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
pwc = UnicodeLowercaseTable;
|
||||||
|
for (i = 0; i < 65536; i++, pwc++)
|
||||||
|
*pwc = (WCHAR)i;
|
||||||
|
for (i = 'A'; i < ('Z'+ 1); i++)
|
||||||
|
UnicodeLowercaseTable[i] = (WCHAR)i - (L'A' - L'a');
|
||||||
|
|
||||||
|
/* FIXME: initialize codepage info */
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
RtlpInitNlsSections(ULONG Mod1Start,
|
RtlpInitNlsSections(ULONG Mod1Start,
|
||||||
ULONG Mod1End,
|
ULONG Mod1End,
|
||||||
|
@ -145,7 +238,7 @@ RtlCustomCPToUnicodeN(PRTL_NLS_DATA NlsData,
|
||||||
|
|
||||||
for (i = 0; i < Size; i++)
|
for (i = 0; i < Size; i++)
|
||||||
{
|
{
|
||||||
*UnicodeString = NlsData->MultiByteToUnicode[(int)*CustomString];
|
*UnicodeString = NlsData->MultiByteToUnicode[(unsigned int)*CustomString];
|
||||||
UnicodeString++;
|
UnicodeString++;
|
||||||
CustomString++;
|
CustomString++;
|
||||||
}
|
}
|
||||||
|
@ -154,10 +247,9 @@ RtlCustomCPToUnicodeN(PRTL_NLS_DATA NlsData,
|
||||||
{
|
{
|
||||||
/* multi-byte code page */
|
/* multi-byte code page */
|
||||||
/* FIXME */
|
/* FIXME */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -193,11 +285,7 @@ RtlMultiByteToUnicodeN(PWCHAR UnicodeString,
|
||||||
|
|
||||||
for (i = 0; i < Size; i++)
|
for (i = 0; i < Size; i++)
|
||||||
{
|
{
|
||||||
*UnicodeString = *MbString;
|
*UnicodeString = AnsiToUnicodeTable[(unsigned int)*MbString];
|
||||||
#if 0
|
|
||||||
*UnicodeString = AnsiToUnicodeTable[*MbString];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
UnicodeString++;
|
UnicodeString++;
|
||||||
MbString++;
|
MbString++;
|
||||||
}
|
}
|
||||||
|
@ -206,10 +294,9 @@ RtlMultiByteToUnicodeN(PWCHAR UnicodeString,
|
||||||
{
|
{
|
||||||
/* multi-byte code page */
|
/* multi-byte code page */
|
||||||
/* FIXME */
|
/* FIXME */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -227,17 +314,14 @@ RtlMultiByteToUnicodeSize(PULONG UnicodeSize,
|
||||||
{
|
{
|
||||||
/* multi-byte code page */
|
/* multi-byte code page */
|
||||||
/* FIXME */
|
/* FIXME */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS STDCALL
|
||||||
STDCALL
|
RtlOemToUnicodeN(PWCHAR UnicodeString,
|
||||||
RtlOemToUnicodeN (
|
|
||||||
PWCHAR UnicodeString,
|
|
||||||
ULONG UnicodeSize,
|
ULONG UnicodeSize,
|
||||||
PULONG ResultSize,
|
PULONG ResultSize,
|
||||||
PCHAR OemString,
|
PCHAR OemString,
|
||||||
|
@ -259,11 +343,7 @@ RtlOemToUnicodeN (
|
||||||
|
|
||||||
for (i = 0; i < Size; i++)
|
for (i = 0; i < Size; i++)
|
||||||
{
|
{
|
||||||
*UnicodeString = *OemString;
|
*UnicodeString = OemToUnicodeTable[(unsigned int)*OemString];
|
||||||
#if 0
|
|
||||||
*UnicodeString = OemToUnicodeTable[*OemString];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
UnicodeString++;
|
UnicodeString++;
|
||||||
OemString++;
|
OemString++;
|
||||||
}
|
}
|
||||||
|
@ -272,23 +352,19 @@ RtlOemToUnicodeN (
|
||||||
{
|
{
|
||||||
/* multi-byte code page */
|
/* multi-byte code page */
|
||||||
/* FIXME */
|
/* FIXME */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS STDCALL
|
||||||
STDCALL
|
RtlUnicodeToCustomCPN(PRTL_NLS_DATA NlsData,
|
||||||
RtlUnicodeToCustomCPN (
|
|
||||||
PRTL_NLS_DATA NlsData,
|
|
||||||
PCHAR CustomString,
|
PCHAR CustomString,
|
||||||
ULONG CustomSize,
|
ULONG CustomSize,
|
||||||
PULONG ResultSize,
|
PULONG ResultSize,
|
||||||
PWCHAR UnicodeString,
|
PWCHAR UnicodeString,
|
||||||
ULONG UnicodeSize
|
ULONG UnicodeSize)
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ULONG Size = 0;
|
ULONG Size = 0;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
|
@ -306,7 +382,7 @@ RtlUnicodeToCustomCPN (
|
||||||
|
|
||||||
for (i = 0; i < Size; i++)
|
for (i = 0; i < Size; i++)
|
||||||
{
|
{
|
||||||
*CustomString = NlsData->UnicodeToMultiByte[*UnicodeString];
|
*CustomString = NlsData->UnicodeToMultiByte[(unsigned int)*UnicodeString];
|
||||||
CustomString++;
|
CustomString++;
|
||||||
UnicodeString++;
|
UnicodeString++;
|
||||||
}
|
}
|
||||||
|
@ -315,17 +391,15 @@ RtlUnicodeToCustomCPN (
|
||||||
{
|
{
|
||||||
/* multi-byte code page */
|
/* multi-byte code page */
|
||||||
/* FIXME */
|
/* FIXME */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STDCALL
|
STDCALL
|
||||||
RtlUnicodeToMultiByteN (
|
RtlUnicodeToMultiByteN(PCHAR MbString,
|
||||||
PCHAR MbString,
|
|
||||||
ULONG MbSize,
|
ULONG MbSize,
|
||||||
PULONG ResultSize,
|
PULONG ResultSize,
|
||||||
PWCHAR UnicodeString,
|
PWCHAR UnicodeString,
|
||||||
|
@ -347,11 +421,7 @@ RtlUnicodeToMultiByteN (
|
||||||
|
|
||||||
for (i = 0; i < Size; i++)
|
for (i = 0; i < Size; i++)
|
||||||
{
|
{
|
||||||
*MbString = *UnicodeString;
|
*MbString = UnicodeToAnsiTable[(unsigned int)*UnicodeString];
|
||||||
#if 0
|
|
||||||
*MbString = UnicodeToAnsiTable[*UnicodeString];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
MbString++;
|
MbString++;
|
||||||
UnicodeString++;
|
UnicodeString++;
|
||||||
}
|
}
|
||||||
|
@ -360,10 +430,9 @@ RtlUnicodeToMultiByteN (
|
||||||
{
|
{
|
||||||
/* multi-byte code page */
|
/* multi-byte code page */
|
||||||
/* FIXME */
|
/* FIXME */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -381,16 +450,14 @@ RtlUnicodeToMultiByteSize(PULONG MbSize,
|
||||||
{
|
{
|
||||||
/* multi-byte code page */
|
/* multi-byte code page */
|
||||||
/* FIXME */
|
/* FIXME */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
RtlUnicodeToOemN (
|
RtlUnicodeToOemN(PCHAR OemString,
|
||||||
PCHAR OemString,
|
|
||||||
ULONG OemSize,
|
ULONG OemSize,
|
||||||
PULONG ResultSize,
|
PULONG ResultSize,
|
||||||
PWCHAR UnicodeString,
|
PWCHAR UnicodeString,
|
||||||
|
@ -412,11 +479,7 @@ RtlUnicodeToOemN (
|
||||||
|
|
||||||
for (i = 0; i < Size; i++)
|
for (i = 0; i < Size; i++)
|
||||||
{
|
{
|
||||||
*OemString = *UnicodeString;
|
*OemString = UnicodeToOemTable[(unsigned int)*UnicodeString];
|
||||||
#if 0
|
|
||||||
*OemString = UnicodeToOemTable[*UnicodeString];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
OemString++;
|
OemString++;
|
||||||
UnicodeString++;
|
UnicodeString++;
|
||||||
}
|
}
|
||||||
|
@ -425,25 +488,23 @@ RtlUnicodeToOemN (
|
||||||
{
|
{
|
||||||
/* multi-byte code page */
|
/* multi-byte code page */
|
||||||
/* FIXME */
|
/* FIXME */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
RtlUpcaseUnicodeToCustomCPN (
|
RtlUpcaseUnicodeToCustomCPN(PRTL_NLS_DATA NlsData,
|
||||||
PRTL_NLS_DATA NlsData,
|
|
||||||
PCHAR CustomString,
|
PCHAR CustomString,
|
||||||
ULONG CustomSize,
|
ULONG CustomSize,
|
||||||
PULONG ResultSize,
|
PULONG ResultSize,
|
||||||
PWCHAR UnicodeString,
|
PWCHAR UnicodeString,
|
||||||
ULONG UnicodeSize
|
ULONG UnicodeSize)
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ULONG Size = 0;
|
ULONG Size = 0;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
|
WCHAR wc;
|
||||||
|
|
||||||
if (NlsData->DbcsFlag == 0)
|
if (NlsData->DbcsFlag == 0)
|
||||||
{
|
{
|
||||||
|
@ -458,8 +519,8 @@ RtlUpcaseUnicodeToCustomCPN (
|
||||||
|
|
||||||
for (i = 0; i < Size; i++)
|
for (i = 0; i < Size; i++)
|
||||||
{
|
{
|
||||||
/* FIXME: Upcase!! */
|
wc = UnicodeUpcaseTable[(unsigned int)*UnicodeString];
|
||||||
*CustomString = NlsData->UnicodeToMultiByte[*UnicodeString];
|
*CustomString = NlsData->UnicodeToMultiByte[(unsigned int)wc];
|
||||||
CustomString++;
|
CustomString++;
|
||||||
UnicodeString++;
|
UnicodeString++;
|
||||||
}
|
}
|
||||||
|
@ -468,10 +529,9 @@ RtlUpcaseUnicodeToCustomCPN (
|
||||||
{
|
{
|
||||||
/* multi-byte code page */
|
/* multi-byte code page */
|
||||||
/* FIXME */
|
/* FIXME */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -484,6 +544,7 @@ RtlUpcaseUnicodeToMultiByteN(PCHAR MbString,
|
||||||
{
|
{
|
||||||
ULONG Size = 0;
|
ULONG Size = 0;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
|
WCHAR wc;
|
||||||
|
|
||||||
if (NlsMbCodePageTag == FALSE)
|
if (NlsMbCodePageTag == FALSE)
|
||||||
{
|
{
|
||||||
|
@ -498,12 +559,8 @@ RtlUpcaseUnicodeToMultiByteN(PCHAR MbString,
|
||||||
|
|
||||||
for (i = 0; i < Size; i++)
|
for (i = 0; i < Size; i++)
|
||||||
{
|
{
|
||||||
/* FIXME: Upcase !! */
|
wc = UnicodeUpcaseTable[(unsigned int)*UnicodeString];
|
||||||
*MbString = *UnicodeString;
|
*MbString = UnicodeToAnsiTable[(unsigned int)wc];
|
||||||
#if 0
|
|
||||||
*MbString = UnicodeToAnsiTable[*UnicodeString];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
MbString++;
|
MbString++;
|
||||||
UnicodeString++;
|
UnicodeString++;
|
||||||
}
|
}
|
||||||
|
@ -512,10 +569,9 @@ RtlUpcaseUnicodeToMultiByteN(PCHAR MbString,
|
||||||
{
|
{
|
||||||
/* multi-byte code page */
|
/* multi-byte code page */
|
||||||
/* FIXME */
|
/* FIXME */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -528,6 +584,7 @@ RtlUpcaseUnicodeToOemN(PCHAR OemString,
|
||||||
{
|
{
|
||||||
ULONG Size = 0;
|
ULONG Size = 0;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
|
UCHAR wc;
|
||||||
|
|
||||||
if (NlsMbOemCodePageTag == FALSE)
|
if (NlsMbOemCodePageTag == FALSE)
|
||||||
{
|
{
|
||||||
|
@ -542,12 +599,8 @@ RtlUpcaseUnicodeToOemN(PCHAR OemString,
|
||||||
|
|
||||||
for (i = 0; i < Size; i++)
|
for (i = 0; i < Size; i++)
|
||||||
{
|
{
|
||||||
/* FIXME: Upcase !! */
|
wc = UnicodeUpcaseTable[(unsigned int)*UnicodeString];
|
||||||
*OemString = *UnicodeString;
|
*OemString = UnicodeToOemTable[(unsigned int)wc];
|
||||||
#if 0
|
|
||||||
*OemString = UnicodeToOemTable[*UnicodeString];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
OemString++;
|
OemString++;
|
||||||
UnicodeString++;
|
UnicodeString++;
|
||||||
}
|
}
|
||||||
|
@ -556,10 +609,9 @@ RtlUpcaseUnicodeToOemN(PCHAR OemString,
|
||||||
{
|
{
|
||||||
/* multi-byte code page */
|
/* multi-byte code page */
|
||||||
/* FIXME */
|
/* FIXME */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: unicode.c,v 1.18 2001/03/13 16:25:55 dwelch Exp $
|
/* $Id: unicode.c,v 1.19 2001/11/02 09:10:49 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -704,8 +704,7 @@ RtlInitAnsiString (
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VOID
|
VOID STDCALL
|
||||||
STDCALL
|
|
||||||
RtlInitString (
|
RtlInitString (
|
||||||
IN OUT PSTRING DestinationString,
|
IN OUT PSTRING DestinationString,
|
||||||
IN PCSZ SourceString
|
IN PCSZ SourceString
|
||||||
|
@ -728,8 +727,7 @@ RtlInitString (
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VOID
|
VOID STDCALL
|
||||||
STDCALL
|
|
||||||
RtlInitUnicodeString (
|
RtlInitUnicodeString (
|
||||||
IN OUT PUNICODE_STRING DestinationString,
|
IN OUT PUNICODE_STRING DestinationString,
|
||||||
IN PCWSTR SourceString
|
IN PCWSTR SourceString
|
||||||
|
@ -756,8 +754,7 @@ RtlInitUnicodeString (
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS STDCALL
|
||||||
STDCALL
|
|
||||||
RtlIntegerToChar (
|
RtlIntegerToChar (
|
||||||
IN ULONG Value,
|
IN ULONG Value,
|
||||||
IN ULONG Base,
|
IN ULONG Base,
|
||||||
|
@ -804,13 +801,10 @@ RtlIntegerToChar (
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS STDCALL
|
||||||
STDCALL
|
RtlIntegerToUnicodeString(IN ULONG Value,
|
||||||
RtlIntegerToUnicodeString (
|
|
||||||
IN ULONG Value,
|
|
||||||
IN ULONG Base, /* optional */
|
IN ULONG Base, /* optional */
|
||||||
IN OUT PUNICODE_STRING String
|
IN OUT PUNICODE_STRING String)
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ANSI_STRING AnsiString;
|
ANSI_STRING AnsiString;
|
||||||
CHAR Buffer[33];
|
CHAR Buffer[33];
|
||||||
|
@ -890,11 +884,8 @@ RtlOemStringToCountedUnicodeString (IN OUT PUNICODE_STRING DestinationString,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ULONG
|
ULONG STDCALL
|
||||||
STDCALL
|
RtlOemStringToUnicodeSize(IN POEM_STRING OemString)
|
||||||
RtlOemStringToUnicodeSize (
|
|
||||||
IN POEM_STRING OemString
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ULONG Size;
|
ULONG Size;
|
||||||
|
|
||||||
|
@ -902,7 +893,7 @@ RtlOemStringToUnicodeSize (
|
||||||
OemString->Buffer,
|
OemString->Buffer,
|
||||||
OemString->Length);
|
OemString->Length);
|
||||||
|
|
||||||
return Size;
|
return(Size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -960,13 +951,10 @@ RtlOemStringToUnicodeString (IN OUT PUNICODE_STRING DestinationString,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BOOLEAN
|
BOOLEAN STDCALL
|
||||||
STDCALL
|
RtlPrefixString(IN PANSI_STRING String1,
|
||||||
RtlPrefixString (
|
IN PANSI_STRING String2,
|
||||||
PANSI_STRING String1,
|
IN BOOLEAN CaseInsensitive)
|
||||||
PANSI_STRING String2,
|
|
||||||
BOOLEAN CaseInsensitive
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
PCHAR pc1;
|
PCHAR pc1;
|
||||||
PCHAR pc2;
|
PCHAR pc2;
|
||||||
|
@ -1003,13 +991,10 @@ RtlPrefixString (
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BOOLEAN
|
BOOLEAN STDCALL
|
||||||
STDCALL
|
RtlPrefixUnicodeString(IN PUNICODE_STRING String1,
|
||||||
RtlPrefixUnicodeString (
|
IN PUNICODE_STRING String2,
|
||||||
PUNICODE_STRING String1,
|
IN BOOLEAN CaseInsensitive)
|
||||||
PUNICODE_STRING String2,
|
|
||||||
BOOLEAN CaseInsensitive
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
PWCHAR pc1;
|
PWCHAR pc1;
|
||||||
PWCHAR pc2;
|
PWCHAR pc2;
|
||||||
|
@ -1047,8 +1032,7 @@ RtlPrefixUnicodeString (
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ULONG
|
ULONG STDCALL
|
||||||
STDCALL
|
|
||||||
RtlUnicodeStringToAnsiSize(IN PUNICODE_STRING UnicodeString)
|
RtlUnicodeStringToAnsiSize(IN PUNICODE_STRING UnicodeString)
|
||||||
{
|
{
|
||||||
ULONG Size;
|
ULONG Size;
|
||||||
|
@ -1057,12 +1041,11 @@ RtlUnicodeStringToAnsiSize(IN PUNICODE_STRING UnicodeString)
|
||||||
UnicodeString->Buffer,
|
UnicodeString->Buffer,
|
||||||
UnicodeString->Length);
|
UnicodeString->Length);
|
||||||
|
|
||||||
return Size;
|
return(Size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS STDCALL
|
||||||
STDCALL
|
|
||||||
RtlUnicodeStringToAnsiString(IN OUT PANSI_STRING DestinationString,
|
RtlUnicodeStringToAnsiString(IN OUT PANSI_STRING DestinationString,
|
||||||
IN PUNICODE_STRING SourceString,
|
IN PUNICODE_STRING SourceString,
|
||||||
IN BOOLEAN AllocateDestinationString)
|
IN BOOLEAN AllocateDestinationString)
|
||||||
|
@ -1113,8 +1096,7 @@ RtlUnicodeStringToAnsiString (IN OUT PANSI_STRING DestinationString,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS STDCALL
|
||||||
STDCALL
|
|
||||||
RtlUnicodeStringToCountedOemString(IN OUT POEM_STRING DestinationString,
|
RtlUnicodeStringToCountedOemString(IN OUT POEM_STRING DestinationString,
|
||||||
IN PUNICODE_STRING SourceString,
|
IN PUNICODE_STRING SourceString,
|
||||||
IN BOOLEAN AllocateDestinationString)
|
IN BOOLEAN AllocateDestinationString)
|
||||||
|
@ -1176,13 +1158,10 @@ RtlUnicodeStringToCountedOemString (IN OUT POEM_STRING DestinationString,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS STDCALL
|
||||||
STDCALL
|
RtlUnicodeStringToInteger(IN PUNICODE_STRING String,
|
||||||
RtlUnicodeStringToInteger (
|
|
||||||
IN PUNICODE_STRING String,
|
|
||||||
IN ULONG Base,
|
IN ULONG Base,
|
||||||
OUT PULONG Value
|
OUT PULONG Value)
|
||||||
)
|
|
||||||
{
|
{
|
||||||
PWCHAR Str;
|
PWCHAR Str;
|
||||||
ULONG lenmin = 0;
|
ULONG lenmin = 0;
|
||||||
|
@ -1266,19 +1245,15 @@ RtlUnicodeStringToInteger (
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ULONG
|
ULONG STDCALL
|
||||||
STDCALL
|
RtlUnicodeStringToOemSize(IN PUNICODE_STRING UnicodeString)
|
||||||
RtlUnicodeStringToOemSize (
|
|
||||||
IN PUNICODE_STRING UnicodeString
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ULONG Size;
|
ULONG Size;
|
||||||
|
|
||||||
RtlUnicodeToMultiByteSize(&Size,
|
RtlUnicodeToMultiByteSize(&Size,
|
||||||
UnicodeString->Buffer,
|
UnicodeString->Buffer,
|
||||||
UnicodeString->Length);
|
UnicodeString->Length);
|
||||||
|
return(Size);
|
||||||
return Size;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1333,21 +1308,18 @@ RtlUnicodeStringToOemString (IN OUT POEM_STRING DestinationString,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
WCHAR
|
WCHAR STDCALL
|
||||||
STDCALL
|
RtlUpcaseUnicodeChar(IN WCHAR Source)
|
||||||
RtlUpcaseUnicodeChar (
|
|
||||||
WCHAR Source
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if (Source < L'a')
|
if (Source < L'a')
|
||||||
return Source;
|
return(Source);
|
||||||
|
|
||||||
if (Source <= L'z')
|
if (Source <= L'z')
|
||||||
return(Source - (L'a' - L'A'));
|
return(Source - (L'a' - L'A'));
|
||||||
|
|
||||||
/* FIXME: characters above 'z' */
|
/* FIXME: characters above 'z' */
|
||||||
|
|
||||||
return Source;
|
return(Source);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1367,12 +1339,12 @@ RtlUpcaseUnicodeString (IN OUT PUNICODE_STRING DestinationString,
|
||||||
SourceString->Length + sizeof(WCHAR),
|
SourceString->Length + sizeof(WCHAR),
|
||||||
TAG_USTR);
|
TAG_USTR);
|
||||||
if (DestinationString->Buffer == NULL)
|
if (DestinationString->Buffer == NULL)
|
||||||
return STATUS_NO_MEMORY;
|
return(STATUS_NO_MEMORY);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (SourceString->Length >= DestinationString->MaximumLength)
|
if (SourceString->Length >= DestinationString->MaximumLength)
|
||||||
return STATUS_BUFFER_TOO_SMALL;
|
return(STATUS_BUFFER_TOO_SMALL);
|
||||||
}
|
}
|
||||||
DestinationString->Length = SourceString->Length;
|
DestinationString->Length = SourceString->Length;
|
||||||
|
|
||||||
|
@ -1386,17 +1358,14 @@ RtlUpcaseUnicodeString (IN OUT PUNICODE_STRING DestinationString,
|
||||||
}
|
}
|
||||||
*Dest = 0;
|
*Dest = 0;
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS STDCALL
|
||||||
STDCALL
|
RtlUpcaseUnicodeStringToAnsiString(IN OUT PANSI_STRING DestinationString,
|
||||||
RtlUpcaseUnicodeStringToAnsiString (
|
|
||||||
IN OUT PANSI_STRING DestinationString,
|
|
||||||
IN PUNICODE_STRING SourceString,
|
IN PUNICODE_STRING SourceString,
|
||||||
IN BOOLEAN AllocateDestinationString
|
IN BOOLEAN AllocateDestinationString)
|
||||||
)
|
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
ULONG Length;
|
ULONG Length;
|
||||||
|
@ -1414,12 +1383,12 @@ RtlUpcaseUnicodeStringToAnsiString (
|
||||||
DestinationString->MaximumLength,
|
DestinationString->MaximumLength,
|
||||||
TAG_ASTR);
|
TAG_ASTR);
|
||||||
if (DestinationString->Buffer == NULL)
|
if (DestinationString->Buffer == NULL)
|
||||||
return STATUS_NO_MEMORY;
|
return(STATUS_NO_MEMORY);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (Length >= DestinationString->MaximumLength)
|
if (Length >= DestinationString->MaximumLength)
|
||||||
return STATUS_BUFFER_TOO_SMALL;
|
return(STATUS_BUFFER_TOO_SMALL);
|
||||||
}
|
}
|
||||||
DestinationString->Length = Length;
|
DestinationString->Length = Length;
|
||||||
|
|
||||||
|
@ -1435,12 +1404,12 @@ RtlUpcaseUnicodeStringToAnsiString (
|
||||||
{
|
{
|
||||||
if (AllocateDestinationString)
|
if (AllocateDestinationString)
|
||||||
ExFreePool(DestinationString->Buffer);
|
ExFreePool(DestinationString->Buffer);
|
||||||
return Status;
|
return(Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
DestinationString->Buffer[Length] = 0;
|
DestinationString->Buffer[Length] = 0;
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1506,13 +1475,10 @@ RtlUpcaseUnicodeStringToCountedOemString (IN OUT POEM_STRING DestinationString,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS STDCALL
|
||||||
STDCALL
|
RtlUpcaseUnicodeStringToOemString(IN OUT POEM_STRING DestinationString,
|
||||||
RtlUpcaseUnicodeStringToOemString (
|
|
||||||
IN OUT POEM_STRING DestinationString,
|
|
||||||
IN PUNICODE_STRING SourceString,
|
IN PUNICODE_STRING SourceString,
|
||||||
IN BOOLEAN AllocateDestinationString
|
IN BOOLEAN AllocateDestinationString)
|
||||||
)
|
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
ULONG Length;
|
ULONG Length;
|
||||||
|
@ -1558,11 +1524,8 @@ RtlUpcaseUnicodeStringToOemString (
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CHAR
|
CHAR STDCALL
|
||||||
STDCALL
|
RtlUpperChar(IN CHAR Source)
|
||||||
RtlUpperChar (
|
|
||||||
IN CHAR Source
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
WCHAR Unicode;
|
WCHAR Unicode;
|
||||||
CHAR Destination;
|
CHAR Destination;
|
||||||
|
@ -1592,20 +1555,21 @@ RtlUpperChar (
|
||||||
Destination = Source;
|
Destination = Source;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Destination;
|
return(Destination);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VOID
|
VOID STDCALL
|
||||||
STDCALL
|
RtlUpperString(PSTRING DestinationString,
|
||||||
RtlUpperString(PSTRING DestinationString, PSTRING SourceString)
|
PSTRING SourceString)
|
||||||
{
|
{
|
||||||
ULONG Length;
|
ULONG Length;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
PCHAR Src;
|
PCHAR Src;
|
||||||
PCHAR Dest;
|
PCHAR Dest;
|
||||||
|
|
||||||
Length = min(SourceString->Length, DestinationString->MaximumLength - 1);
|
Length = min(SourceString->Length,
|
||||||
|
DestinationString->MaximumLength - 1);
|
||||||
|
|
||||||
Src = SourceString->Buffer;
|
Src = SourceString->Buffer;
|
||||||
Dest = DestinationString->Buffer;
|
Dest = DestinationString->Buffer;
|
||||||
|
@ -1621,43 +1585,31 @@ RtlUpperString(PSTRING DestinationString, PSTRING SourceString)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ULONG
|
ULONG STDCALL
|
||||||
STDCALL
|
RtlxAnsiStringToUnicodeSize(IN PANSI_STRING AnsiString)
|
||||||
RtlxAnsiStringToUnicodeSize (
|
|
||||||
IN PANSI_STRING AnsiString
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
return RtlAnsiStringToUnicodeSize (AnsiString);
|
return(RtlAnsiStringToUnicodeSize(AnsiString));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ULONG
|
ULONG STDCALL
|
||||||
STDCALL
|
RtlxOemStringToUnicodeSize(IN POEM_STRING OemString)
|
||||||
RtlxOemStringToUnicodeSize (
|
|
||||||
IN POEM_STRING OemString
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
return RtlAnsiStringToUnicodeSize ((PANSI_STRING)OemString);
|
return(RtlAnsiStringToUnicodeSize((PANSI_STRING)OemString));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ULONG
|
ULONG STDCALL
|
||||||
STDCALL
|
RtlxUnicodeStringToAnsiSize(IN PUNICODE_STRING UnicodeString)
|
||||||
RtlxUnicodeStringToAnsiSize (
|
|
||||||
IN PUNICODE_STRING UnicodeString
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
return RtlUnicodeStringToAnsiSize (UnicodeString);
|
return(RtlUnicodeStringToAnsiSize(UnicodeString));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ULONG
|
ULONG STDCALL
|
||||||
STDCALL
|
RtlxUnicodeStringToOemSize(IN PUNICODE_STRING UnicodeString)
|
||||||
RtlxUnicodeStringToOemSize (
|
|
||||||
IN PUNICODE_STRING UnicodeString
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
return RtlUnicodeStringToAnsiSize (UnicodeString);
|
return(RtlUnicodeStringToAnsiSize(UnicodeString));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue