diff options
author | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
---|---|---|
committer | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
commit | e611b132f9b8abe35b362e5870b74bce94a1e58e (patch) | |
tree | a5781d2ec0e085eeca33cf350cf878f2efea6fe5 /private/ntos/rtl/mips/nlssup.c | |
download | NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2 NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip |
Diffstat (limited to 'private/ntos/rtl/mips/nlssup.c')
-rw-r--r-- | private/ntos/rtl/mips/nlssup.c | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/private/ntos/rtl/mips/nlssup.c b/private/ntos/rtl/mips/nlssup.c new file mode 100644 index 000000000..4c108a4a7 --- /dev/null +++ b/private/ntos/rtl/mips/nlssup.c @@ -0,0 +1,109 @@ +/*++ + +Copyright (c) 1989 Microsoft Corporation + +Module Name: + + nlssup.c + +Abstract: + + This module defines CPU specific routines for converting NLS strings. + +Author: + + Steve Wood (stevewo) 31-Mar-1989 + +Revision History: + + +--*/ + +#include "ntrtlp.h" + +WCHAR +RtlAnsiCharToUnicodeChar( + IN OUT PCHAR *SourceCharacter + ) + +/*++ + +Routine Description: + + This function translates the specified ansi character to unicode and + returns the unicode value. The purpose for this routine is to allow + for character by character ansi to unicode translation. The + translation is done with respect to the current system locale + information. + + +Arguments: + + SourceCharacter - Supplies a pointer to an ansi character pointer. + Through two levels of indirection, this supplies an ansi + character that is to be translated to unicode. After + translation, the ansi character pointer is modified to point to + the next character to be converted. This is done to allow for + dbcs ansi characters. + +Return Value: + + Returns the unicode equivalent of the specified ansi character. + +--*/ + +{ + WCHAR UnicodeCharacter; + + // + // Note that this needs to reference the translation table ! + // + + UnicodeCharacter = **SourceCharacter; + (*SourceCharacter)++; + return UnicodeCharacter; +} + + +VOID +RtlpAnsiPszToUnicodePsz( + IN PCHAR AnsiString, + IN WCHAR *UnicodeString, + IN USHORT AnsiStringLength + ) + +/*++ + +Routine Description: + + This function translates the specified ansi character to unicode and + returns the unicode value. The purpose for this routine is to allow + for character by character ansi to unicode translation. The + translation is done with respect to the current system locale + information. + + +Arguments: + + AnsiString - Supplies a pointer to the ANSI string to convert to unicode. + UnicodeString - Supplies a pointer to a buffer to hold the unicode string + AnsiStringLength - Supplies the length of the ANSI string. + +Return Value: + + None. + +--*/ + +{ + ULONG Index; + PCHAR AnsiChar; + + AnsiChar = AnsiString; + Index = 0; + while(Index < AnsiStringLength ) { + UnicodeString[Index] = RtlAnsiCharToUnicodeChar(&AnsiChar); + Index++; + } + UnicodeString[Index] = UNICODE_NULL; +} |