diff --git a/reactos/include/ddk/rtl.h b/reactos/include/ddk/rtl.h index edc7c0b061a..e8301c6cda7 100644 --- a/reactos/include/ddk/rtl.h +++ b/reactos/include/ddk/rtl.h @@ -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]; } 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 @@ -425,6 +447,17 @@ RtlCreateUnicodeStringFromAsciiz ( IN PCSZ Source ); +NTSTATUS +STDCALL +RtlCustomCPToUnicodeN ( + PRTL_NLS_DATA NlsData, + PWCHAR UnicodeString, + ULONG UnicodeSize, + PULONG ResultSize, + PCHAR CustomString, + ULONG CustomSize + ); + NTSTATUS STDCALL RtlDeleteRegistryValue ( @@ -1174,6 +1207,17 @@ RtlUnicodeStringToOemString ( IN BOOLEAN AllocateDestinationString ); +NTSTATUS +STDCALL +RtlUnicodeToCustomCPN ( + PRTL_NLS_DATA NlsData, + PCHAR MbString, + ULONG MbSize, + PULONG ResultSize, + PWCHAR UnicodeString, + ULONG UnicodeSize + ); + NTSTATUS STDCALL RtlUnicodeToMultiByteN ( @@ -1246,6 +1290,17 @@ RtlUpcaseUnicodeStringToOemString ( IN BOOLEAN AllocateDestinationString ); +NTSTATUS +STDCALL +RtlUpcaseUnicodeToCustomCPN ( + PRTL_NLS_DATA NlsData, + PCHAR MbString, + ULONG MbSize, + PULONG ResultSize, + PWCHAR UnicodeString, + ULONG UnicodeSize + ); + NTSTATUS STDCALL RtlUpcaseUnicodeToMultiByteN ( diff --git a/reactos/lib/ntdll/def/ntdll.def b/reactos/lib/ntdll/def/ntdll.def index d81758fdfcd..c6723eed56b 100644 --- a/reactos/lib/ntdll/def/ntdll.def +++ b/reactos/lib/ntdll/def/ntdll.def @@ -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 ; @@ -307,7 +307,7 @@ RtlCreateUnicodeStringFromAsciiz@8 RtlCreateUserProcess@40 ;RtlCreateUserSecurityObject RtlCreateUserThread@40 -;RtlCustomCPToUnicodeN +RtlCustomCPToUnicodeN@24 ;RtlCutoverTimeToSystemTime RtlDeNormalizeProcessParams@4 ;RtlDecompressBuffer @@ -531,7 +531,7 @@ RtlUnicodeStringToCountedOemString@12 RtlUnicodeStringToInteger@12 RtlUnicodeStringToOemSize@4 RtlUnicodeStringToOemString@12 -;RtlUnicodeToCustomCPN +RtlUnicodeToCustomCPN@24 RtlUnicodeToMultiByteN@20 RtlUnicodeToMultiByteSize@12 RtlUnicodeToOemN@20 @@ -543,7 +543,7 @@ RtlUpcaseUnicodeString@12 RtlUpcaseUnicodeStringToAnsiString@12 RtlUpcaseUnicodeStringToCountedOemString@12 RtlUpcaseUnicodeStringToOemString@12 -;RtlUpcaseUnicodeToCustomCPN +RtlUpcaseUnicodeToCustomCPN@24 RtlUpcaseUnicodeToMultiByteN@20 RtlUpcaseUnicodeToOemN@20 RtlUpperChar@4 diff --git a/reactos/lib/ntdll/def/ntdll.edf b/reactos/lib/ntdll/def/ntdll.edf index 4d96f5b1086..8be8bf6c927 100644 --- a/reactos/lib/ntdll/def/ntdll.edf +++ b/reactos/lib/ntdll/def/ntdll.edf @@ -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 ; @@ -272,6 +272,7 @@ RtlCreateUnicodeString=RtlCreateUnicodeString@8 RtlCreateUnicodeStringFromAsciiz=RtlCreateUnicodeStringFromAsciiz@8 RtlCreateUserProcess=RtlCreateUserProcess@40 RtlCreateUserThread=RtlCreateUserThread@40 +RtlCustomCPToUnicodeN=RtlCustomCPToUnicodeN@24 RtlDeNormalizeProcessParams=RtlDeNormalizeProcessParams@4 RtlDeleteAce=RtlDeleteAce@8 RtlDeleteCriticalSection=RtlDeleteCriticalSection@4 @@ -399,6 +400,7 @@ RtlUnicodeStringToCountedOemString=RtlUnicodeStringToCountedOemString@12 RtlUnicodeStringToInteger=RtlUnicodeStringToInteger@12 RtlUnicodeStringToOemSize=RtlUnicodeStringToOemSize@4 RtlUnicodeStringToOemString=RtlUnicodeStringToOemString@12 +RtlUnicodeToCustomCPN=RtlUnicodeToCustomCPN@24 RtlUnicodeToMultiByteN=RtlUnicodeToMultiByteN@20 RtlUnicodeToMultiByteSize=RtlUnicodeToMultiByteSize@12 RtlUnicodeToOemN=RtlUnicodeToOemN@20 @@ -409,6 +411,7 @@ RtlUpcaseUnicodeString=RtlUpcaseUnicodeString@12 RtlUpcaseUnicodeStringToAnsiString=RtlUpcaseUnicodeStringToAnsiString@12 RtlUpcaseUnicodeStringToCountedOemString=RtlUpcaseUnicodeStringToCountedOemString@12 RtlUpcaseUnicodeStringToOemString=RtlUpcaseUnicodeStringToOemString@12 +RtlUpcaseUnicodeToCustomCPN=RtlUpcaseUnicodeToCustomCPN@24 RtlUpcaseUnicodeToMultiByteN=RtlUpcaseUnicodeToMultiByteN@20 RtlUpcaseUnicodeToOemN=RtlUpcaseUnicodeToOemN@20 RtlUpperChar=RtlUpperChar@4 diff --git a/reactos/lib/ntdll/rtl/nls.c b/reactos/lib/ntdll/rtl/nls.c index 62af79024da..c7eaed0753d 100644 --- a/reactos/lib/ntdll/rtl/nls.c +++ b/reactos/lib/ntdll/rtl/nls.c @@ -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 * PROJECT: ReactOS kernel @@ -17,7 +17,8 @@ * 1) Implement code to initialize the translation tables. * 2) Use fixed translation table for translation. * 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 @@ -42,22 +43,79 @@ NlsAnsiCodePage = 0; USHORT NlsOemCodePage = 0; /* not exported */ - #if 0 -WCHAR AnsiToUnicodeTable[256]; -WCHAR OemToUnicodeTable[256]; +PWCHAR NlsAnsiToUnicodeTable = NULL; +PWCHAR NlsOemToUnicodeTable = NULL; -CHAR UnicodeToAnsiTable [65536]; -CHAR UnicodeToOemTable [65536]; +PCHAR NlsUnicodeToAnsiTable = NULL; +PCHAR NlsUnicodeToOemTable = NULL; + +PWCHAR NlsUnicodeUpcaseTable = NULL; +PWCHAR NlsUnicodeLowercaseTable = NULL; #endif /* 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 STDCALL -RtlGetDefaultCodePage (PUSHORT AnsiCodePage, - PUSHORT OemCodePage) +RtlGetDefaultCodePage ( + PUSHORT AnsiCodePage, + PUSHORT OemCodePage + ) { *AnsiCodePage = NlsAnsiCodePage; *OemCodePage = NlsOemCodePage; @@ -66,11 +124,13 @@ RtlGetDefaultCodePage (PUSHORT AnsiCodePage, NTSTATUS STDCALL -RtlMultiByteToUnicodeN(PWCHAR UnicodeString, - ULONG UnicodeSize, - PULONG ResultSize, - PCHAR MbString, - ULONG MbSize) +RtlMultiByteToUnicodeN ( + PWCHAR UnicodeString, + ULONG UnicodeSize, + PULONG ResultSize, + PCHAR MbString, + ULONG MbSize + ) { ULONG Size = 0; ULONG i; @@ -90,7 +150,7 @@ RtlMultiByteToUnicodeN(PWCHAR UnicodeString, { *UnicodeString = *MbString; #if 0 - *UnicodeString = AnsiToUnicodeTable[*MbString]; + *UnicodeString = NlsAnsiToUnicodeTable[*MbString]; #endif UnicodeString++; @@ -110,9 +170,11 @@ RtlMultiByteToUnicodeN(PWCHAR UnicodeString, NTSTATUS STDCALL -RtlMultiByteToUnicodeSize(PULONG UnicodeSize, - PCHAR MbString, - ULONG MbSize) +RtlMultiByteToUnicodeSize ( + PULONG UnicodeSize, + PCHAR MbString, + ULONG MbSize + ) { if (NlsMbCodePageTag == FALSE) { @@ -132,11 +194,13 @@ RtlMultiByteToUnicodeSize(PULONG UnicodeSize, NTSTATUS STDCALL -RtlOemToUnicodeN(PWCHAR UnicodeString, - ULONG UnicodeSize, - PULONG ResultSize, - PCHAR OemString, - ULONG OemSize) +RtlOemToUnicodeN ( + PWCHAR UnicodeString, + ULONG UnicodeSize, + PULONG ResultSize, + PCHAR OemString, + ULONG OemSize + ) { ULONG Size = 0; ULONG i; @@ -156,7 +220,7 @@ RtlOemToUnicodeN(PWCHAR UnicodeString, { *UnicodeString = *OemString; #if 0 - *UnicodeString = OemToUnicodeTable[*OemString]; + *UnicodeString = NlsOemToUnicodeTable[*OemString]; #endif UnicodeString++; @@ -176,11 +240,56 @@ RtlOemToUnicodeN(PWCHAR UnicodeString, NTSTATUS STDCALL -RtlUnicodeToMultiByteN(PCHAR MbString, - ULONG MbSize, - PULONG ResultSize, - PWCHAR UnicodeString, - ULONG UnicodeSize) +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 +STDCALL +RtlUnicodeToMultiByteN ( + PCHAR MbString, + ULONG MbSize, + PULONG ResultSize, + PWCHAR UnicodeString, + ULONG UnicodeSize + ) { ULONG Size = 0; ULONG i; @@ -220,9 +329,11 @@ RtlUnicodeToMultiByteN(PCHAR MbString, NTSTATUS STDCALL -RtlUnicodeToMultiByteSize(PULONG MbSize, - PWCHAR UnicodeString, - ULONG UnicodeSize) +RtlUnicodeToMultiByteSize ( + PULONG MbSize, + PWCHAR UnicodeString, + ULONG UnicodeSize + ) { if (NlsMbCodePageTag == FALSE) { @@ -242,11 +353,13 @@ RtlUnicodeToMultiByteSize(PULONG MbSize, NTSTATUS STDCALL -RtlUnicodeToOemN(PCHAR OemString, - ULONG OemSize, - PULONG ResultSize, - PWCHAR UnicodeString, - ULONG UnicodeSize) +RtlUnicodeToOemN ( + PCHAR OemString, + ULONG OemSize, + PULONG ResultSize, + PWCHAR UnicodeString, + ULONG UnicodeSize + ) { ULONG Size = 0; 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 STDCALL RtlUpcaseUnicodeToMultiByteN ( @@ -294,6 +455,7 @@ RtlUpcaseUnicodeToMultiByteN ( ULONG UnicodeSize ) { + WCHAR UpcaseChar; ULONG Size = 0; ULONG i; @@ -310,10 +472,10 @@ RtlUpcaseUnicodeToMultiByteN ( for (i = 0; i < Size; i++) { - /* FIXME: Upcase!! */ *MbString = *UnicodeString; #if 0 - *MbString = UnicodeToAnsiTable[*UnicodeString]; + UpcaseChar = NlsUnicodeUpcaseTable[*UnicodeString]; + *MbString = NlsUnicodeToAnsiTable[UpcaseChar]; #endif MbString++; @@ -341,6 +503,7 @@ RtlUpcaseUnicodeToOemN ( ULONG UnicodeSize ) { + WCHAR UpcaseChar; ULONG Size = 0; ULONG i; @@ -357,10 +520,10 @@ RtlUpcaseUnicodeToOemN ( for (i = 0; i < Size; i++) { - /* FIXME: Upcase !! */ *OemString = *UnicodeString; #if 0 - *OemString = UnicodeToOemTable[*UnicodeString]; + UpcaseChar = NlsUnicodeUpcaseTable[*UnicodeString]; + *OemString = UnicodeToOemTable[UpcaseChar]; #endif OemString++; diff --git a/reactos/ntoskrnl/ntoskrnl.def b/reactos/ntoskrnl/ntoskrnl.def index ad0fd1d8c60..01551fb405d 100644 --- a/reactos/ntoskrnl/ntoskrnl.def +++ b/reactos/ntoskrnl/ntoskrnl.def @@ -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 ; @@ -481,7 +481,7 @@ RtlCreateAcl@12 ;RtlCreateRegistryKey RtlCreateSecurityDescriptor@8 RtlCreateUnicodeString@8 -;RtlCustomCPToUnicodeN +RtlCustomCPToUnicodeN@24 ;RtlDecompressBuffer ;RtlDecompressChunks ;RtlDecompressFragment @@ -604,7 +604,7 @@ RtlUnicodeStringToCountedOemString@12 RtlUnicodeStringToInteger@12 RtlUnicodeStringToOemSize@4 RtlUnicodeStringToOemString@12 -;RtlUnicodeToCustomCPN +RtlUnicodeToCustomCPN@24 RtlUnicodeToMultiByteN@20 RtlUnicodeToMultiByteSize@12 RtlUnicodeToOemN@20 @@ -614,7 +614,7 @@ RtlUpcaseUnicodeString@12 RtlUpcaseUnicodeStringToAnsiString@12 RtlUpcaseUnicodeStringToCountedOemString@12 RtlUpcaseUnicodeStringToOemString@12 -;RtlUpcaseUnicodeToCustomCPN +RtlUpcaseUnicodeToCustomCPN@24 RtlUpcaseUnicodeToMultiByteN@20 RtlUpcaseUnicodeToOemN@20 RtlUpperChar@4 diff --git a/reactos/ntoskrnl/ntoskrnl.edf b/reactos/ntoskrnl/ntoskrnl.edf index 0cb587ae2dd..db84c9de0af 100644 --- a/reactos/ntoskrnl/ntoskrnl.edf +++ b/reactos/ntoskrnl/ntoskrnl.edf @@ -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 ; @@ -469,6 +469,7 @@ RtlCopyUnicodeString=RtlCopyUnicodeString@8 RtlCreateAcl=RtlCreateAcl@12 RtlCreateSecurityDescriptor=RtlCreateSecurityDescriptor@8 RtlCreateUnicodeString=RtlCreateUnicodeString@8 +RtlCustomCPToUnicodeN=RtlCustomCPToUnicodeN@24 RtlDowncaseUnicodeString=RtlDowncaseUnicodeString@12 RtlEnlargedIntegerMultiply=RtlEnlargedIntegerMultiply@8 RtlEnlargedUnsignedDivide=RtlEnlargedUnsignedDivide@16 @@ -546,6 +547,7 @@ RtlUnicodeStringToCountedOemString=RtlUnicodeStringToCountedOemString@12 RtlUnicodeStringToInteger=RtlUnicodeStringToInteger@12 RtlUnicodeStringToOemSize=RtlUnicodeStringToOemSize@4 RtlUnicodeStringToOemString=RtlUnicodeStringToOemString@12 +RtlUnicodeToCustomCPN=RtlUnicodeToCustomCPN@24 RtlUnicodeToMultiByteN=RtlUnicodeToMultiByteN@20 RtlUnicodeToMultiByteSize=RtlUnicodeToMultiByteSize@12 RtlUpcaseUnicodeChar=RtlUpcaseUnicodeChar@4 @@ -553,6 +555,7 @@ RtlUpcaseUnicodeString=RtlUpcaseUnicodeString@12 RtlUpcaseUnicodeStringToAnsiString=RtlUpcaseUnicodeStringToAnsiString@12 RtlUpcaseUnicodeStringToCountedOemString=RtlUpcaseUnicodeStringToCountedOemString@12 RtlUpcaseUnicodeStringToOemString=RtlUpcaseUnicodeStringToOemString@12 +RtlUpcaseUnicodeToCustomCPN=RtlUpcaseUnicodeToCustomCPN@24 RtlUpcaseUnicodeToMultiByteN=RtlUpcaseUnicodeToMultiByteN@20 RtlUpcaseUnicodeToOemN=RtlUpcaseUnicodeToOemN@20 RtlUpperChar=RtlUpperChar@4 diff --git a/reactos/ntoskrnl/rtl/nls.c b/reactos/ntoskrnl/rtl/nls.c index 778ca261ec0..ac427ddec1c 100644 --- a/reactos/ntoskrnl/rtl/nls.c +++ b/reactos/ntoskrnl/rtl/nls.c @@ -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 * PROJECT: ReactOS kernel @@ -54,9 +54,46 @@ CHAR UnicodeToOemTable [65536]; /* FUNCTIONS *****************************************************************/ -/* - * RtlCustomCPToUnicodeN - */ +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[(int)*CustomString]; + UnicodeString++; + CustomString++; + } + } + else + { + /* multi-byte code page */ + /* FIXME */ + + } + + return STATUS_SUCCESS; +} VOID @@ -186,9 +223,47 @@ RtlOemToUnicodeN ( } -/* - * RtlUnicodeToCustomCPN - */ +NTSTATUS +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 @@ -304,9 +379,48 @@ RtlUnicodeToOemN ( } -/* - * RtlUpcaseUnicodeToCustomCPN - */ +NTSTATUS +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