mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 21:12:59 +00:00
Implemented RtlCustomCPxx functions
svn path=/trunk/; revision=1148
This commit is contained in:
parent
bb665e58b7
commit
17e86aad5d
7 changed files with 400 additions and 62 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: rtl.h,v 1.33 2000/05/09 21:29:44 ekohl Exp $
|
/* $Id: rtl.h,v 1.34 2000/05/13 01:44:53 ekohl Exp $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -65,6 +65,28 @@ typedef struct {
|
||||||
ULONG Unknown[11];
|
ULONG Unknown[11];
|
||||||
} RTL_HEAP_DEFINITION, *PRTL_HEAP_DEFINITION;
|
} RTL_HEAP_DEFINITION, *PRTL_HEAP_DEFINITION;
|
||||||
|
|
||||||
|
struct _LB_RANGE
|
||||||
|
{
|
||||||
|
ULONG dummy;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct _RTL_NLS_DATA
|
||||||
|
{
|
||||||
|
USHORT CodePage;
|
||||||
|
USHORT MaxCharacterSize;
|
||||||
|
WCHAR DefaultCharacter;
|
||||||
|
WCHAR char1;
|
||||||
|
WCHAR char2;
|
||||||
|
WCHAR char3;
|
||||||
|
USHORT DbcsFlag;
|
||||||
|
struct _LB_RANGE LeadByteRange[6];
|
||||||
|
USHORT reserved;
|
||||||
|
PWCHAR MultiByteToUnicode;
|
||||||
|
PCHAR UnicodeToMultiByte;
|
||||||
|
ULONG unknown;
|
||||||
|
PCHAR DbcsTags;
|
||||||
|
} RTL_NLS_DATA, *PRTL_NLS_DATA;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* PURPOSE: Flags for RtlQueryRegistryValues
|
* PURPOSE: Flags for RtlQueryRegistryValues
|
||||||
|
@ -425,6 +447,17 @@ RtlCreateUnicodeStringFromAsciiz (
|
||||||
IN PCSZ Source
|
IN PCSZ Source
|
||||||
);
|
);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
STDCALL
|
||||||
|
RtlCustomCPToUnicodeN (
|
||||||
|
PRTL_NLS_DATA NlsData,
|
||||||
|
PWCHAR UnicodeString,
|
||||||
|
ULONG UnicodeSize,
|
||||||
|
PULONG ResultSize,
|
||||||
|
PCHAR CustomString,
|
||||||
|
ULONG CustomSize
|
||||||
|
);
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STDCALL
|
STDCALL
|
||||||
RtlDeleteRegistryValue (
|
RtlDeleteRegistryValue (
|
||||||
|
@ -1174,6 +1207,17 @@ RtlUnicodeStringToOemString (
|
||||||
IN BOOLEAN AllocateDestinationString
|
IN BOOLEAN AllocateDestinationString
|
||||||
);
|
);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
STDCALL
|
||||||
|
RtlUnicodeToCustomCPN (
|
||||||
|
PRTL_NLS_DATA NlsData,
|
||||||
|
PCHAR MbString,
|
||||||
|
ULONG MbSize,
|
||||||
|
PULONG ResultSize,
|
||||||
|
PWCHAR UnicodeString,
|
||||||
|
ULONG UnicodeSize
|
||||||
|
);
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STDCALL
|
STDCALL
|
||||||
RtlUnicodeToMultiByteN (
|
RtlUnicodeToMultiByteN (
|
||||||
|
@ -1246,6 +1290,17 @@ RtlUpcaseUnicodeStringToOemString (
|
||||||
IN BOOLEAN AllocateDestinationString
|
IN BOOLEAN AllocateDestinationString
|
||||||
);
|
);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
STDCALL
|
||||||
|
RtlUpcaseUnicodeToCustomCPN (
|
||||||
|
PRTL_NLS_DATA NlsData,
|
||||||
|
PCHAR MbString,
|
||||||
|
ULONG MbSize,
|
||||||
|
PULONG ResultSize,
|
||||||
|
PWCHAR UnicodeString,
|
||||||
|
ULONG UnicodeSize
|
||||||
|
);
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STDCALL
|
STDCALL
|
||||||
RtlUpcaseUnicodeToMultiByteN (
|
RtlUpcaseUnicodeToMultiByteN (
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
; $Id: ntdll.def,v 1.53 2000/04/25 23:22:55 ea Exp $
|
; $Id: ntdll.def,v 1.54 2000/05/13 01:48:01 ekohl Exp $
|
||||||
;
|
;
|
||||||
; ReactOS Operating System
|
; ReactOS Operating System
|
||||||
;
|
;
|
||||||
|
@ -307,7 +307,7 @@ RtlCreateUnicodeStringFromAsciiz@8
|
||||||
RtlCreateUserProcess@40
|
RtlCreateUserProcess@40
|
||||||
;RtlCreateUserSecurityObject
|
;RtlCreateUserSecurityObject
|
||||||
RtlCreateUserThread@40
|
RtlCreateUserThread@40
|
||||||
;RtlCustomCPToUnicodeN
|
RtlCustomCPToUnicodeN@24
|
||||||
;RtlCutoverTimeToSystemTime
|
;RtlCutoverTimeToSystemTime
|
||||||
RtlDeNormalizeProcessParams@4
|
RtlDeNormalizeProcessParams@4
|
||||||
;RtlDecompressBuffer
|
;RtlDecompressBuffer
|
||||||
|
@ -531,7 +531,7 @@ RtlUnicodeStringToCountedOemString@12
|
||||||
RtlUnicodeStringToInteger@12
|
RtlUnicodeStringToInteger@12
|
||||||
RtlUnicodeStringToOemSize@4
|
RtlUnicodeStringToOemSize@4
|
||||||
RtlUnicodeStringToOemString@12
|
RtlUnicodeStringToOemString@12
|
||||||
;RtlUnicodeToCustomCPN
|
RtlUnicodeToCustomCPN@24
|
||||||
RtlUnicodeToMultiByteN@20
|
RtlUnicodeToMultiByteN@20
|
||||||
RtlUnicodeToMultiByteSize@12
|
RtlUnicodeToMultiByteSize@12
|
||||||
RtlUnicodeToOemN@20
|
RtlUnicodeToOemN@20
|
||||||
|
@ -543,7 +543,7 @@ RtlUpcaseUnicodeString@12
|
||||||
RtlUpcaseUnicodeStringToAnsiString@12
|
RtlUpcaseUnicodeStringToAnsiString@12
|
||||||
RtlUpcaseUnicodeStringToCountedOemString@12
|
RtlUpcaseUnicodeStringToCountedOemString@12
|
||||||
RtlUpcaseUnicodeStringToOemString@12
|
RtlUpcaseUnicodeStringToOemString@12
|
||||||
;RtlUpcaseUnicodeToCustomCPN
|
RtlUpcaseUnicodeToCustomCPN@24
|
||||||
RtlUpcaseUnicodeToMultiByteN@20
|
RtlUpcaseUnicodeToMultiByteN@20
|
||||||
RtlUpcaseUnicodeToOemN@20
|
RtlUpcaseUnicodeToOemN@20
|
||||||
RtlUpperChar@4
|
RtlUpperChar@4
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
; $Id: ntdll.edf,v 1.42 2000/04/25 23:22:56 ea Exp $
|
; $Id: ntdll.edf,v 1.43 2000/05/13 01:48:01 ekohl Exp $
|
||||||
;
|
;
|
||||||
; ReactOS Operating System
|
; ReactOS Operating System
|
||||||
;
|
;
|
||||||
|
@ -272,6 +272,7 @@ RtlCreateUnicodeString=RtlCreateUnicodeString@8
|
||||||
RtlCreateUnicodeStringFromAsciiz=RtlCreateUnicodeStringFromAsciiz@8
|
RtlCreateUnicodeStringFromAsciiz=RtlCreateUnicodeStringFromAsciiz@8
|
||||||
RtlCreateUserProcess=RtlCreateUserProcess@40
|
RtlCreateUserProcess=RtlCreateUserProcess@40
|
||||||
RtlCreateUserThread=RtlCreateUserThread@40
|
RtlCreateUserThread=RtlCreateUserThread@40
|
||||||
|
RtlCustomCPToUnicodeN=RtlCustomCPToUnicodeN@24
|
||||||
RtlDeNormalizeProcessParams=RtlDeNormalizeProcessParams@4
|
RtlDeNormalizeProcessParams=RtlDeNormalizeProcessParams@4
|
||||||
RtlDeleteAce=RtlDeleteAce@8
|
RtlDeleteAce=RtlDeleteAce@8
|
||||||
RtlDeleteCriticalSection=RtlDeleteCriticalSection@4
|
RtlDeleteCriticalSection=RtlDeleteCriticalSection@4
|
||||||
|
@ -399,6 +400,7 @@ RtlUnicodeStringToCountedOemString=RtlUnicodeStringToCountedOemString@12
|
||||||
RtlUnicodeStringToInteger=RtlUnicodeStringToInteger@12
|
RtlUnicodeStringToInteger=RtlUnicodeStringToInteger@12
|
||||||
RtlUnicodeStringToOemSize=RtlUnicodeStringToOemSize@4
|
RtlUnicodeStringToOemSize=RtlUnicodeStringToOemSize@4
|
||||||
RtlUnicodeStringToOemString=RtlUnicodeStringToOemString@12
|
RtlUnicodeStringToOemString=RtlUnicodeStringToOemString@12
|
||||||
|
RtlUnicodeToCustomCPN=RtlUnicodeToCustomCPN@24
|
||||||
RtlUnicodeToMultiByteN=RtlUnicodeToMultiByteN@20
|
RtlUnicodeToMultiByteN=RtlUnicodeToMultiByteN@20
|
||||||
RtlUnicodeToMultiByteSize=RtlUnicodeToMultiByteSize@12
|
RtlUnicodeToMultiByteSize=RtlUnicodeToMultiByteSize@12
|
||||||
RtlUnicodeToOemN=RtlUnicodeToOemN@20
|
RtlUnicodeToOemN=RtlUnicodeToOemN@20
|
||||||
|
@ -409,6 +411,7 @@ RtlUpcaseUnicodeString=RtlUpcaseUnicodeString@12
|
||||||
RtlUpcaseUnicodeStringToAnsiString=RtlUpcaseUnicodeStringToAnsiString@12
|
RtlUpcaseUnicodeStringToAnsiString=RtlUpcaseUnicodeStringToAnsiString@12
|
||||||
RtlUpcaseUnicodeStringToCountedOemString=RtlUpcaseUnicodeStringToCountedOemString@12
|
RtlUpcaseUnicodeStringToCountedOemString=RtlUpcaseUnicodeStringToCountedOemString@12
|
||||||
RtlUpcaseUnicodeStringToOemString=RtlUpcaseUnicodeStringToOemString@12
|
RtlUpcaseUnicodeStringToOemString=RtlUpcaseUnicodeStringToOemString@12
|
||||||
|
RtlUpcaseUnicodeToCustomCPN=RtlUpcaseUnicodeToCustomCPN@24
|
||||||
RtlUpcaseUnicodeToMultiByteN=RtlUpcaseUnicodeToMultiByteN@20
|
RtlUpcaseUnicodeToMultiByteN=RtlUpcaseUnicodeToMultiByteN@20
|
||||||
RtlUpcaseUnicodeToOemN=RtlUpcaseUnicodeToOemN@20
|
RtlUpcaseUnicodeToOemN=RtlUpcaseUnicodeToOemN@20
|
||||||
RtlUpperChar=RtlUpperChar@4
|
RtlUpperChar=RtlUpperChar@4
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: nls.c,v 1.2 1999/11/20 21:46:46 ekohl Exp $
|
/* $Id: nls.c,v 1.3 2000/05/13 01:47:33 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -17,7 +17,8 @@
|
||||||
* 1) Implement code to initialize the translation tables.
|
* 1) Implement code to initialize the translation tables.
|
||||||
* 2) Use fixed translation table for translation.
|
* 2) Use fixed translation table for translation.
|
||||||
* 3) Add loading of translation tables (NLS files).
|
* 3) Add loading of translation tables (NLS files).
|
||||||
* 4) Add multi-byte translation code.
|
* 4) Implement unicode upcase and downcase handling.
|
||||||
|
* 5) Add multi-byte translation code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <ddk/ntddk.h>
|
#include <ddk/ntddk.h>
|
||||||
|
@ -42,22 +43,79 @@ NlsAnsiCodePage = 0;
|
||||||
USHORT
|
USHORT
|
||||||
NlsOemCodePage = 0; /* not exported */
|
NlsOemCodePage = 0; /* not exported */
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
WCHAR AnsiToUnicodeTable[256];
|
PWCHAR NlsAnsiToUnicodeTable = NULL;
|
||||||
WCHAR OemToUnicodeTable[256];
|
PWCHAR NlsOemToUnicodeTable = NULL;
|
||||||
|
|
||||||
CHAR UnicodeToAnsiTable [65536];
|
PCHAR NlsUnicodeToAnsiTable = NULL;
|
||||||
CHAR UnicodeToOemTable [65536];
|
PCHAR NlsUnicodeToOemTable = NULL;
|
||||||
|
|
||||||
|
PWCHAR NlsUnicodeUpcaseTable = NULL;
|
||||||
|
PWCHAR NlsUnicodeLowercaseTable = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Missing functions:
|
||||||
|
* RtlInitCodePageTable
|
||||||
|
* RtlInitNlsTables
|
||||||
|
* RtlResetRtlTranslations
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* RtlConsoleMultiByteToUnicodeN@24
|
||||||
|
*/
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
STDCALL
|
||||||
|
RtlCustomCPToUnicodeN (
|
||||||
|
PRTL_NLS_DATA NlsData,
|
||||||
|
PWCHAR UnicodeString,
|
||||||
|
ULONG UnicodeSize,
|
||||||
|
PULONG ResultSize,
|
||||||
|
PCHAR CustomString,
|
||||||
|
ULONG CustomSize)
|
||||||
|
{
|
||||||
|
ULONG Size = 0;
|
||||||
|
ULONG i;
|
||||||
|
|
||||||
|
if (NlsData->DbcsFlag == FALSE)
|
||||||
|
{
|
||||||
|
/* single-byte code page */
|
||||||
|
if (CustomSize > (UnicodeSize / sizeof(WCHAR)))
|
||||||
|
Size = UnicodeSize / sizeof(WCHAR);
|
||||||
|
else
|
||||||
|
Size = CustomSize;
|
||||||
|
|
||||||
|
if (ResultSize != NULL)
|
||||||
|
*ResultSize = Size * sizeof(WCHAR);
|
||||||
|
|
||||||
|
for (i = 0; i < Size; i++)
|
||||||
|
{
|
||||||
|
*UnicodeString = NlsData->MultiByteToUnicode[*CustomString];
|
||||||
|
UnicodeString++;
|
||||||
|
CustomString++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* multi-byte code page */
|
||||||
|
/* FIXME */
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
STDCALL
|
STDCALL
|
||||||
RtlGetDefaultCodePage (PUSHORT AnsiCodePage,
|
RtlGetDefaultCodePage (
|
||||||
PUSHORT OemCodePage)
|
PUSHORT AnsiCodePage,
|
||||||
|
PUSHORT OemCodePage
|
||||||
|
)
|
||||||
{
|
{
|
||||||
*AnsiCodePage = NlsAnsiCodePage;
|
*AnsiCodePage = NlsAnsiCodePage;
|
||||||
*OemCodePage = NlsOemCodePage;
|
*OemCodePage = NlsOemCodePage;
|
||||||
|
@ -66,11 +124,13 @@ RtlGetDefaultCodePage (PUSHORT AnsiCodePage,
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STDCALL
|
STDCALL
|
||||||
RtlMultiByteToUnicodeN(PWCHAR UnicodeString,
|
RtlMultiByteToUnicodeN (
|
||||||
ULONG UnicodeSize,
|
PWCHAR UnicodeString,
|
||||||
PULONG ResultSize,
|
ULONG UnicodeSize,
|
||||||
PCHAR MbString,
|
PULONG ResultSize,
|
||||||
ULONG MbSize)
|
PCHAR MbString,
|
||||||
|
ULONG MbSize
|
||||||
|
)
|
||||||
{
|
{
|
||||||
ULONG Size = 0;
|
ULONG Size = 0;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
|
@ -90,7 +150,7 @@ RtlMultiByteToUnicodeN(PWCHAR UnicodeString,
|
||||||
{
|
{
|
||||||
*UnicodeString = *MbString;
|
*UnicodeString = *MbString;
|
||||||
#if 0
|
#if 0
|
||||||
*UnicodeString = AnsiToUnicodeTable[*MbString];
|
*UnicodeString = NlsAnsiToUnicodeTable[*MbString];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
UnicodeString++;
|
UnicodeString++;
|
||||||
|
@ -110,9 +170,11 @@ RtlMultiByteToUnicodeN(PWCHAR UnicodeString,
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STDCALL
|
STDCALL
|
||||||
RtlMultiByteToUnicodeSize(PULONG UnicodeSize,
|
RtlMultiByteToUnicodeSize (
|
||||||
PCHAR MbString,
|
PULONG UnicodeSize,
|
||||||
ULONG MbSize)
|
PCHAR MbString,
|
||||||
|
ULONG MbSize
|
||||||
|
)
|
||||||
{
|
{
|
||||||
if (NlsMbCodePageTag == FALSE)
|
if (NlsMbCodePageTag == FALSE)
|
||||||
{
|
{
|
||||||
|
@ -132,11 +194,13 @@ RtlMultiByteToUnicodeSize(PULONG UnicodeSize,
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STDCALL
|
STDCALL
|
||||||
RtlOemToUnicodeN(PWCHAR UnicodeString,
|
RtlOemToUnicodeN (
|
||||||
ULONG UnicodeSize,
|
PWCHAR UnicodeString,
|
||||||
PULONG ResultSize,
|
ULONG UnicodeSize,
|
||||||
PCHAR OemString,
|
PULONG ResultSize,
|
||||||
ULONG OemSize)
|
PCHAR OemString,
|
||||||
|
ULONG OemSize
|
||||||
|
)
|
||||||
{
|
{
|
||||||
ULONG Size = 0;
|
ULONG Size = 0;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
|
@ -156,7 +220,7 @@ RtlOemToUnicodeN(PWCHAR UnicodeString,
|
||||||
{
|
{
|
||||||
*UnicodeString = *OemString;
|
*UnicodeString = *OemString;
|
||||||
#if 0
|
#if 0
|
||||||
*UnicodeString = OemToUnicodeTable[*OemString];
|
*UnicodeString = NlsOemToUnicodeTable[*OemString];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
UnicodeString++;
|
UnicodeString++;
|
||||||
|
@ -176,11 +240,56 @@ RtlOemToUnicodeN(PWCHAR UnicodeString,
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STDCALL
|
STDCALL
|
||||||
RtlUnicodeToMultiByteN(PCHAR MbString,
|
RtlUnicodeToCustomCPN (
|
||||||
ULONG MbSize,
|
PRTL_NLS_DATA NlsData,
|
||||||
PULONG ResultSize,
|
PCHAR CustomString,
|
||||||
PWCHAR UnicodeString,
|
ULONG CustomSize,
|
||||||
ULONG UnicodeSize)
|
PULONG ResultSize,
|
||||||
|
PWCHAR UnicodeString,
|
||||||
|
ULONG UnicodeSize
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ULONG Size = 0;
|
||||||
|
ULONG i;
|
||||||
|
|
||||||
|
if (NlsData->DbcsFlag == 0)
|
||||||
|
{
|
||||||
|
/* single-byte code page */
|
||||||
|
if (UnicodeSize > (CustomSize * sizeof(WCHAR)))
|
||||||
|
Size = CustomSize;
|
||||||
|
else
|
||||||
|
Size = UnicodeSize / sizeof(WCHAR);
|
||||||
|
|
||||||
|
if (ResultSize != NULL)
|
||||||
|
*ResultSize = Size;
|
||||||
|
|
||||||
|
for (i = 0; i < Size; i++)
|
||||||
|
{
|
||||||
|
*CustomString = NlsData->UnicodeToMultiByte[*UnicodeString];
|
||||||
|
CustomString++;
|
||||||
|
UnicodeString++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* multi-byte code page */
|
||||||
|
/* FIXME */
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
STDCALL
|
||||||
|
RtlUnicodeToMultiByteN (
|
||||||
|
PCHAR MbString,
|
||||||
|
ULONG MbSize,
|
||||||
|
PULONG ResultSize,
|
||||||
|
PWCHAR UnicodeString,
|
||||||
|
ULONG UnicodeSize
|
||||||
|
)
|
||||||
{
|
{
|
||||||
ULONG Size = 0;
|
ULONG Size = 0;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
|
@ -220,9 +329,11 @@ RtlUnicodeToMultiByteN(PCHAR MbString,
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STDCALL
|
STDCALL
|
||||||
RtlUnicodeToMultiByteSize(PULONG MbSize,
|
RtlUnicodeToMultiByteSize (
|
||||||
PWCHAR UnicodeString,
|
PULONG MbSize,
|
||||||
ULONG UnicodeSize)
|
PWCHAR UnicodeString,
|
||||||
|
ULONG UnicodeSize
|
||||||
|
)
|
||||||
{
|
{
|
||||||
if (NlsMbCodePageTag == FALSE)
|
if (NlsMbCodePageTag == FALSE)
|
||||||
{
|
{
|
||||||
|
@ -242,11 +353,13 @@ RtlUnicodeToMultiByteSize(PULONG MbSize,
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STDCALL
|
STDCALL
|
||||||
RtlUnicodeToOemN(PCHAR OemString,
|
RtlUnicodeToOemN (
|
||||||
ULONG OemSize,
|
PCHAR OemString,
|
||||||
PULONG ResultSize,
|
ULONG OemSize,
|
||||||
PWCHAR UnicodeString,
|
PULONG ResultSize,
|
||||||
ULONG UnicodeSize)
|
PWCHAR UnicodeString,
|
||||||
|
ULONG UnicodeSize
|
||||||
|
)
|
||||||
{
|
{
|
||||||
ULONG Size = 0;
|
ULONG Size = 0;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
|
@ -284,6 +397,54 @@ RtlUnicodeToOemN(PCHAR OemString,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
STDCALL
|
||||||
|
RtlUpcaseUnicodeToCustomCPN (
|
||||||
|
PRTL_NLS_DATA NlsData,
|
||||||
|
PCHAR CustomString,
|
||||||
|
ULONG CustomSize,
|
||||||
|
PULONG ResultSize,
|
||||||
|
PWCHAR UnicodeString,
|
||||||
|
ULONG UnicodeSize
|
||||||
|
)
|
||||||
|
{
|
||||||
|
WCHAR UpcaseChar;
|
||||||
|
ULONG Size = 0;
|
||||||
|
ULONG i;
|
||||||
|
|
||||||
|
if (NlsData->DbcsFlag == 0)
|
||||||
|
{
|
||||||
|
/* single-byte code page */
|
||||||
|
if (UnicodeSize > (CustomSize * sizeof(WCHAR)))
|
||||||
|
Size = CustomSize;
|
||||||
|
else
|
||||||
|
Size = UnicodeSize / sizeof(WCHAR);
|
||||||
|
|
||||||
|
if (ResultSize != NULL)
|
||||||
|
*ResultSize = Size;
|
||||||
|
|
||||||
|
for (i = 0; i < Size; i++)
|
||||||
|
{
|
||||||
|
*CustomString = NlsData->UnicodeToMultiByte[*UnicodeString];
|
||||||
|
#if 0
|
||||||
|
UpcaseChar = NlsUnicodeUpcaseTable[*UnicodeString];
|
||||||
|
*CustomString = NlsData->UnicodeToMultiByte[UpcaseChar];
|
||||||
|
#endif
|
||||||
|
CustomString++;
|
||||||
|
UnicodeString++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* multi-byte code page */
|
||||||
|
/* FIXME */
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STDCALL
|
STDCALL
|
||||||
RtlUpcaseUnicodeToMultiByteN (
|
RtlUpcaseUnicodeToMultiByteN (
|
||||||
|
@ -294,6 +455,7 @@ RtlUpcaseUnicodeToMultiByteN (
|
||||||
ULONG UnicodeSize
|
ULONG UnicodeSize
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
WCHAR UpcaseChar;
|
||||||
ULONG Size = 0;
|
ULONG Size = 0;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
|
|
||||||
|
@ -310,10 +472,10 @@ RtlUpcaseUnicodeToMultiByteN (
|
||||||
|
|
||||||
for (i = 0; i < Size; i++)
|
for (i = 0; i < Size; i++)
|
||||||
{
|
{
|
||||||
/* FIXME: Upcase!! */
|
|
||||||
*MbString = *UnicodeString;
|
*MbString = *UnicodeString;
|
||||||
#if 0
|
#if 0
|
||||||
*MbString = UnicodeToAnsiTable[*UnicodeString];
|
UpcaseChar = NlsUnicodeUpcaseTable[*UnicodeString];
|
||||||
|
*MbString = NlsUnicodeToAnsiTable[UpcaseChar];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
MbString++;
|
MbString++;
|
||||||
|
@ -341,6 +503,7 @@ RtlUpcaseUnicodeToOemN (
|
||||||
ULONG UnicodeSize
|
ULONG UnicodeSize
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
WCHAR UpcaseChar;
|
||||||
ULONG Size = 0;
|
ULONG Size = 0;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
|
|
||||||
|
@ -357,10 +520,10 @@ RtlUpcaseUnicodeToOemN (
|
||||||
|
|
||||||
for (i = 0; i < Size; i++)
|
for (i = 0; i < Size; i++)
|
||||||
{
|
{
|
||||||
/* FIXME: Upcase !! */
|
|
||||||
*OemString = *UnicodeString;
|
*OemString = *UnicodeString;
|
||||||
#if 0
|
#if 0
|
||||||
*OemString = UnicodeToOemTable[*UnicodeString];
|
UpcaseChar = NlsUnicodeUpcaseTable[*UnicodeString];
|
||||||
|
*OemString = UnicodeToOemTable[UpcaseChar];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
OemString++;
|
OemString++;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
; $Id: ntoskrnl.def,v 1.71 2000/05/09 21:31:01 ekohl Exp $
|
; $Id: ntoskrnl.def,v 1.72 2000/05/13 01:46:22 ekohl Exp $
|
||||||
;
|
;
|
||||||
; reactos/ntoskrnl/ntoskrnl.def
|
; reactos/ntoskrnl/ntoskrnl.def
|
||||||
;
|
;
|
||||||
|
@ -481,7 +481,7 @@ RtlCreateAcl@12
|
||||||
;RtlCreateRegistryKey
|
;RtlCreateRegistryKey
|
||||||
RtlCreateSecurityDescriptor@8
|
RtlCreateSecurityDescriptor@8
|
||||||
RtlCreateUnicodeString@8
|
RtlCreateUnicodeString@8
|
||||||
;RtlCustomCPToUnicodeN
|
RtlCustomCPToUnicodeN@24
|
||||||
;RtlDecompressBuffer
|
;RtlDecompressBuffer
|
||||||
;RtlDecompressChunks
|
;RtlDecompressChunks
|
||||||
;RtlDecompressFragment
|
;RtlDecompressFragment
|
||||||
|
@ -604,7 +604,7 @@ RtlUnicodeStringToCountedOemString@12
|
||||||
RtlUnicodeStringToInteger@12
|
RtlUnicodeStringToInteger@12
|
||||||
RtlUnicodeStringToOemSize@4
|
RtlUnicodeStringToOemSize@4
|
||||||
RtlUnicodeStringToOemString@12
|
RtlUnicodeStringToOemString@12
|
||||||
;RtlUnicodeToCustomCPN
|
RtlUnicodeToCustomCPN@24
|
||||||
RtlUnicodeToMultiByteN@20
|
RtlUnicodeToMultiByteN@20
|
||||||
RtlUnicodeToMultiByteSize@12
|
RtlUnicodeToMultiByteSize@12
|
||||||
RtlUnicodeToOemN@20
|
RtlUnicodeToOemN@20
|
||||||
|
@ -614,7 +614,7 @@ RtlUpcaseUnicodeString@12
|
||||||
RtlUpcaseUnicodeStringToAnsiString@12
|
RtlUpcaseUnicodeStringToAnsiString@12
|
||||||
RtlUpcaseUnicodeStringToCountedOemString@12
|
RtlUpcaseUnicodeStringToCountedOemString@12
|
||||||
RtlUpcaseUnicodeStringToOemString@12
|
RtlUpcaseUnicodeStringToOemString@12
|
||||||
;RtlUpcaseUnicodeToCustomCPN
|
RtlUpcaseUnicodeToCustomCPN@24
|
||||||
RtlUpcaseUnicodeToMultiByteN@20
|
RtlUpcaseUnicodeToMultiByteN@20
|
||||||
RtlUpcaseUnicodeToOemN@20
|
RtlUpcaseUnicodeToOemN@20
|
||||||
RtlUpperChar@4
|
RtlUpperChar@4
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
; $Id: ntoskrnl.edf,v 1.58 2000/05/09 21:31:01 ekohl Exp $
|
; $Id: ntoskrnl.edf,v 1.59 2000/05/13 01:46:23 ekohl Exp $
|
||||||
;
|
;
|
||||||
; reactos/ntoskrnl/ntoskrnl.def
|
; reactos/ntoskrnl/ntoskrnl.def
|
||||||
;
|
;
|
||||||
|
@ -469,6 +469,7 @@ RtlCopyUnicodeString=RtlCopyUnicodeString@8
|
||||||
RtlCreateAcl=RtlCreateAcl@12
|
RtlCreateAcl=RtlCreateAcl@12
|
||||||
RtlCreateSecurityDescriptor=RtlCreateSecurityDescriptor@8
|
RtlCreateSecurityDescriptor=RtlCreateSecurityDescriptor@8
|
||||||
RtlCreateUnicodeString=RtlCreateUnicodeString@8
|
RtlCreateUnicodeString=RtlCreateUnicodeString@8
|
||||||
|
RtlCustomCPToUnicodeN=RtlCustomCPToUnicodeN@24
|
||||||
RtlDowncaseUnicodeString=RtlDowncaseUnicodeString@12
|
RtlDowncaseUnicodeString=RtlDowncaseUnicodeString@12
|
||||||
RtlEnlargedIntegerMultiply=RtlEnlargedIntegerMultiply@8
|
RtlEnlargedIntegerMultiply=RtlEnlargedIntegerMultiply@8
|
||||||
RtlEnlargedUnsignedDivide=RtlEnlargedUnsignedDivide@16
|
RtlEnlargedUnsignedDivide=RtlEnlargedUnsignedDivide@16
|
||||||
|
@ -546,6 +547,7 @@ RtlUnicodeStringToCountedOemString=RtlUnicodeStringToCountedOemString@12
|
||||||
RtlUnicodeStringToInteger=RtlUnicodeStringToInteger@12
|
RtlUnicodeStringToInteger=RtlUnicodeStringToInteger@12
|
||||||
RtlUnicodeStringToOemSize=RtlUnicodeStringToOemSize@4
|
RtlUnicodeStringToOemSize=RtlUnicodeStringToOemSize@4
|
||||||
RtlUnicodeStringToOemString=RtlUnicodeStringToOemString@12
|
RtlUnicodeStringToOemString=RtlUnicodeStringToOemString@12
|
||||||
|
RtlUnicodeToCustomCPN=RtlUnicodeToCustomCPN@24
|
||||||
RtlUnicodeToMultiByteN=RtlUnicodeToMultiByteN@20
|
RtlUnicodeToMultiByteN=RtlUnicodeToMultiByteN@20
|
||||||
RtlUnicodeToMultiByteSize=RtlUnicodeToMultiByteSize@12
|
RtlUnicodeToMultiByteSize=RtlUnicodeToMultiByteSize@12
|
||||||
RtlUpcaseUnicodeChar=RtlUpcaseUnicodeChar@4
|
RtlUpcaseUnicodeChar=RtlUpcaseUnicodeChar@4
|
||||||
|
@ -553,6 +555,7 @@ RtlUpcaseUnicodeString=RtlUpcaseUnicodeString@12
|
||||||
RtlUpcaseUnicodeStringToAnsiString=RtlUpcaseUnicodeStringToAnsiString@12
|
RtlUpcaseUnicodeStringToAnsiString=RtlUpcaseUnicodeStringToAnsiString@12
|
||||||
RtlUpcaseUnicodeStringToCountedOemString=RtlUpcaseUnicodeStringToCountedOemString@12
|
RtlUpcaseUnicodeStringToCountedOemString=RtlUpcaseUnicodeStringToCountedOemString@12
|
||||||
RtlUpcaseUnicodeStringToOemString=RtlUpcaseUnicodeStringToOemString@12
|
RtlUpcaseUnicodeStringToOemString=RtlUpcaseUnicodeStringToOemString@12
|
||||||
|
RtlUpcaseUnicodeToCustomCPN=RtlUpcaseUnicodeToCustomCPN@24
|
||||||
RtlUpcaseUnicodeToMultiByteN=RtlUpcaseUnicodeToMultiByteN@20
|
RtlUpcaseUnicodeToMultiByteN=RtlUpcaseUnicodeToMultiByteN@20
|
||||||
RtlUpcaseUnicodeToOemN=RtlUpcaseUnicodeToOemN@20
|
RtlUpcaseUnicodeToOemN=RtlUpcaseUnicodeToOemN@20
|
||||||
RtlUpperChar=RtlUpperChar@4
|
RtlUpperChar=RtlUpperChar@4
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: nls.c,v 1.3 2000/03/03 00:48:50 ekohl Exp $
|
/* $Id: nls.c,v 1.4 2000/05/13 01:45:40 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -54,9 +54,46 @@ CHAR UnicodeToOemTable [65536];
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
/*
|
NTSTATUS
|
||||||
* RtlCustomCPToUnicodeN
|
STDCALL
|
||||||
*/
|
RtlCustomCPToUnicodeN (
|
||||||
|
PRTL_NLS_DATA NlsData,
|
||||||
|
PWCHAR UnicodeString,
|
||||||
|
ULONG UnicodeSize,
|
||||||
|
PULONG ResultSize,
|
||||||
|
PCHAR CustomString,
|
||||||
|
ULONG CustomSize)
|
||||||
|
{
|
||||||
|
ULONG Size = 0;
|
||||||
|
ULONG i;
|
||||||
|
|
||||||
|
if (NlsData->DbcsFlag == FALSE)
|
||||||
|
{
|
||||||
|
/* single-byte code page */
|
||||||
|
if (CustomSize > (UnicodeSize / sizeof(WCHAR)))
|
||||||
|
Size = UnicodeSize / sizeof(WCHAR);
|
||||||
|
else
|
||||||
|
Size = CustomSize;
|
||||||
|
|
||||||
|
if (ResultSize != NULL)
|
||||||
|
*ResultSize = Size * sizeof(WCHAR);
|
||||||
|
|
||||||
|
for (i = 0; i < Size; i++)
|
||||||
|
{
|
||||||
|
*UnicodeString = NlsData->MultiByteToUnicode[(int)*CustomString];
|
||||||
|
UnicodeString++;
|
||||||
|
CustomString++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* multi-byte code page */
|
||||||
|
/* FIXME */
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
@ -186,9 +223,47 @@ RtlOemToUnicodeN (
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
NTSTATUS
|
||||||
* RtlUnicodeToCustomCPN
|
STDCALL
|
||||||
*/
|
RtlUnicodeToCustomCPN (
|
||||||
|
PRTL_NLS_DATA NlsData,
|
||||||
|
PCHAR CustomString,
|
||||||
|
ULONG CustomSize,
|
||||||
|
PULONG ResultSize,
|
||||||
|
PWCHAR UnicodeString,
|
||||||
|
ULONG UnicodeSize
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ULONG Size = 0;
|
||||||
|
ULONG i;
|
||||||
|
|
||||||
|
if (NlsData->DbcsFlag == 0)
|
||||||
|
{
|
||||||
|
/* single-byte code page */
|
||||||
|
if (UnicodeSize > (CustomSize * sizeof(WCHAR)))
|
||||||
|
Size = CustomSize;
|
||||||
|
else
|
||||||
|
Size = UnicodeSize / sizeof(WCHAR);
|
||||||
|
|
||||||
|
if (ResultSize != NULL)
|
||||||
|
*ResultSize = Size;
|
||||||
|
|
||||||
|
for (i = 0; i < Size; i++)
|
||||||
|
{
|
||||||
|
*CustomString = NlsData->UnicodeToMultiByte[*UnicodeString];
|
||||||
|
CustomString++;
|
||||||
|
UnicodeString++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* multi-byte code page */
|
||||||
|
/* FIXME */
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
|
@ -304,9 +379,48 @@ RtlUnicodeToOemN (
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
NTSTATUS
|
||||||
* RtlUpcaseUnicodeToCustomCPN
|
STDCALL
|
||||||
*/
|
RtlUpcaseUnicodeToCustomCPN (
|
||||||
|
PRTL_NLS_DATA NlsData,
|
||||||
|
PCHAR CustomString,
|
||||||
|
ULONG CustomSize,
|
||||||
|
PULONG ResultSize,
|
||||||
|
PWCHAR UnicodeString,
|
||||||
|
ULONG UnicodeSize
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ULONG Size = 0;
|
||||||
|
ULONG i;
|
||||||
|
|
||||||
|
if (NlsData->DbcsFlag == 0)
|
||||||
|
{
|
||||||
|
/* single-byte code page */
|
||||||
|
if (UnicodeSize > (CustomSize * sizeof(WCHAR)))
|
||||||
|
Size = CustomSize;
|
||||||
|
else
|
||||||
|
Size = UnicodeSize / sizeof(WCHAR);
|
||||||
|
|
||||||
|
if (ResultSize != NULL)
|
||||||
|
*ResultSize = Size;
|
||||||
|
|
||||||
|
for (i = 0; i < Size; i++)
|
||||||
|
{
|
||||||
|
/* FIXME: Upcase!! */
|
||||||
|
*CustomString = NlsData->UnicodeToMultiByte[*UnicodeString];
|
||||||
|
CustomString++;
|
||||||
|
UnicodeString++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* multi-byte code page */
|
||||||
|
/* FIXME */
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue