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/stringsp.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/stringsp.c')
-rw-r--r-- | private/ntos/rtl/mips/stringsp.c | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/private/ntos/rtl/mips/stringsp.c b/private/ntos/rtl/mips/stringsp.c new file mode 100644 index 000000000..3cf3f2d5f --- /dev/null +++ b/private/ntos/rtl/mips/stringsp.c @@ -0,0 +1,122 @@ +/*++ + +Copyright (c) 1989 Microsoft Corporation + +Module Name: + + stingsup.c + +Abstract: + + This module defines CPU specific routines for manipulating NT strings. + +Author: + + Steve Wood (stevewo) 31-Mar-1989 + +Revision History: + + +--*/ + +#include "nt.h" +#include "ntrtl.h" + + +VOID +RtlInitAnsiString( + OUT PANSI_STRING DestinationString, + IN PSZ SourceString OPTIONAL + ) + +/*++ + +Routine Description: + + The RtlInitAnsiString function initializes an NT counted string. + The DestinationString is initialized to point to the SourceString + and the Length and MaximumLength fields of DestinationString are + initialized to the length of the SourceString, which is zero if + SourceString is not specified. + +Arguments: + + DestinationString - Pointer to the counted string to initialize + + SourceString - Optional pointer to a null terminated string that + the counted string is to point to. + + +Return Value: + + None. + +--*/ + +{ + USHORT Length; + Length = 0; + DestinationString->Length = 0; + DestinationString->Buffer = SourceString; + if (ARGUMENT_PRESENT( SourceString )) { + while (*SourceString++) { + Length++; + } + + DestinationString->Length = Length; + + DestinationString->MaximumLength = (SHORT)(Length+1); + } + else { + DestinationString->MaximumLength = 0; + } +} + + +VOID +RtlInitUnicodeString( + OUT PUNICODE_STRING DestinationString, + IN PWSTR SourceString OPTIONAL + ) + +/*++ + +Routine Description: + + The RtlInitUnicodeString function initializes an NT counted + unicode string. The DestinationString is initialized to point to + the SourceString and the Length and MaximumLength fields of + DestinationString are initialized to the length of the SourceString, + which is zero if SourceString is not specified. + +Arguments: + + DestinationString - Pointer to the counted string to initialize + + SourceString - Optional pointer to a null terminated unicode string that + the counted string is to point to. + + +Return Value: + + None. + +--*/ + +{ + USHORT Length = 0; + DestinationString->Length = 0; + DestinationString->Buffer = SourceString; + if (ARGUMENT_PRESENT( SourceString )) { + while (*SourceString++) { + Length += sizeof(*SourceString); + } + + DestinationString->Length = Length; + + DestinationString->MaximumLength = Length+(USHORT)sizeof(UNICODE_NULL); + } + else { + DestinationString->MaximumLength = 0; + } +} |