From 4d7a522726ff16332a37585c243028b33305d39c Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Tue, 5 Nov 2013 20:40:01 +0000 Subject: [PATCH] [NDK][DDK][RTL] - Correct prototypes and annotations and add missing declarations for Rtl string functions svn path=/trunk/; revision=60868 --- reactos/include/ddk/ntddk.h | 12 +++---- reactos/include/ddk/ntifs.h | 10 ++++++ reactos/include/ndk/rtlfuncs.h | 66 ++++++++++++++++++++++++++++++---- reactos/lib/rtl/unicode.c | 18 +++++----- 4 files changed, 84 insertions(+), 22 deletions(-) diff --git a/reactos/include/ddk/ntddk.h b/reactos/include/ddk/ntddk.h index 961b0ca8066..b8e4e03d995 100644 --- a/reactos/include/ddk/ntddk.h +++ b/reactos/include/ddk/ntddk.h @@ -4993,7 +4993,7 @@ VOID NTAPI RtlUpperString( _Inout_ PSTRING DestinationString, - _In_ const PSTRING SourceString); + _In_ const STRING *SourceString); _IRQL_requires_max_(PASSIVE_LEVEL) _When_(AllocateDestinationString, _Must_inspect_result_) @@ -5029,8 +5029,8 @@ NTSYSAPI LONG NTAPI RtlCompareString( - _In_ const PSTRING String1, - _In_ const PSTRING String2, + _In_ const STRING *String1, + _In_ const STRING *String2, _In_ BOOLEAN CaseInSensitive); NTSYSAPI @@ -5038,7 +5038,7 @@ VOID NTAPI RtlCopyString( _Out_ PSTRING DestinationString, - _In_opt_ const PSTRING SourceString); + _In_opt_ const STRING *SourceString); _IRQL_requires_max_(PASSIVE_LEVEL) _Must_inspect_result_ @@ -5046,8 +5046,8 @@ NTSYSAPI BOOLEAN NTAPI RtlEqualString( - _In_ const PSTRING String1, - _In_ const PSTRING String2, + _In_ const STRING *String1, + _In_ const STRING *String2, _In_ BOOLEAN CaseInSensitive); _IRQL_requires_max_(PASSIVE_LEVEL) diff --git a/reactos/include/ddk/ntifs.h b/reactos/include/ddk/ntifs.h index dffced42585..575465e6c0b 100644 --- a/reactos/include/ddk/ntifs.h +++ b/reactos/include/ddk/ntifs.h @@ -1006,6 +1006,16 @@ RtlCreateUnicodeString( PUNICODE_STRING DestinationString, _In_z_ PCWSTR SourceString); +_IRQL_requires_max_(PASSIVE_LEVEL) +_Must_inspect_result_ +NTSYSAPI +BOOLEAN +NTAPI +RtlPrefixString( + _In_ const STRING *String1, + _In_ const STRING *String2, + _In_ BOOLEAN CaseInsensitive); + _IRQL_requires_max_(APC_LEVEL) NTSYSAPI NTSTATUS diff --git a/reactos/include/ndk/rtlfuncs.h b/reactos/include/ndk/rtlfuncs.h index 0b1332923b9..835d5824fee 100644 --- a/reactos/include/ndk/rtlfuncs.h +++ b/reactos/include/ndk/rtlfuncs.h @@ -2161,22 +2161,74 @@ RtlIsTextUnicode( INT *Flags ); +_IRQL_requires_max_(PASSIVE_LEVEL) +_Must_inspect_result_ NTSYSAPI BOOLEAN NTAPI RtlPrefixString( - PSTRING String1, - PSTRING String2, - BOOLEAN CaseInsensitive + _In_ const STRING *String1, + _In_ const STRING *String2, + _In_ BOOLEAN CaseInsensitive ); +_IRQL_requires_max_(PASSIVE_LEVEL) +_Must_inspect_result_ NTSYSAPI BOOLEAN NTAPI RtlPrefixUnicodeString( - PCUNICODE_STRING String1, - PCUNICODE_STRING String2, - BOOLEAN CaseInsensitive + _In_ PCUNICODE_STRING String1, + _In_ PCUNICODE_STRING String2, + _In_ BOOLEAN CaseInsensitive +); + +_IRQL_requires_max_(PASSIVE_LEVEL) +NTSYSAPI +VOID +NTAPI +RtlUpperString( + _Inout_ PSTRING DestinationString, + _In_ const STRING *SourceString +); + +_IRQL_requires_max_(PASSIVE_LEVEL) +_Must_inspect_result_ +NTSYSAPI +LONG +NTAPI +RtlCompareString( + _In_ const STRING *String1, + _In_ const STRING *String2, + _In_ BOOLEAN CaseInSensitive +); + +NTSYSAPI +VOID +NTAPI +RtlCopyString( + _Out_ PSTRING DestinationString, + _In_opt_ const STRING *SourceString +); + +_IRQL_requires_max_(PASSIVE_LEVEL) +_Must_inspect_result_ +NTSYSAPI +BOOLEAN +NTAPI +RtlEqualString( + _In_ const STRING *String1, + _In_ const STRING *String2, + _In_ BOOLEAN CaseInSensitive +); + +_IRQL_requires_max_(APC_LEVEL) +NTSYSAPI +NTSTATUS +NTAPI +RtlAppendStringToString( + _Inout_ PSTRING Destination, + _In_ const STRING *Source ); _IRQL_requires_max_(PASSIVE_LEVEL) @@ -2190,7 +2242,7 @@ RtlUpcaseUnicodeString( PUNICODE_STRING DestinationString, _In_ PCUNICODE_STRING SourceString, _In_ BOOLEAN AllocateDestinationString - ); +); _IRQL_requires_max_(PASSIVE_LEVEL) NTSYSAPI diff --git a/reactos/lib/rtl/unicode.c b/reactos/lib/rtl/unicode.c index 8913df64079..3d0efaff55c 100644 --- a/reactos/lib/rtl/unicode.c +++ b/reactos/lib/rtl/unicode.c @@ -173,7 +173,7 @@ RtlxAnsiStringToUnicodeSize(IN PCANSI_STRING AnsiString) NTSTATUS NTAPI RtlAppendStringToString(IN PSTRING Destination, - IN PSTRING Source) + IN const STRING *Source) { USHORT SourceLength = Source->Length; @@ -346,8 +346,8 @@ RtlCharToInteger( LONG NTAPI RtlCompareString( - IN PSTRING s1, - IN PSTRING s2, + IN const STRING *s1, + IN const STRING *s2, IN BOOLEAN CaseInsensitive) { unsigned int len; @@ -382,8 +382,8 @@ RtlCompareString( BOOLEAN NTAPI RtlEqualString( - IN PSTRING s1, - IN PSTRING s2, + IN const STRING *s1, + IN const STRING *s2, IN BOOLEAN CaseInsensitive) { if (s1->Length != s2->Length) return FALSE; @@ -835,8 +835,8 @@ RtlInt64ToUnicodeString ( BOOLEAN NTAPI RtlPrefixString( - PSTRING String1, - PSTRING String2, + const STRING *String1, + const STRING *String2, BOOLEAN CaseInsensitive) { PCHAR pc1; @@ -2115,7 +2115,7 @@ VOID NTAPI RtlCopyString( IN OUT PSTRING DestinationString, - IN PSTRING SourceString OPTIONAL) + IN const STRING *SourceString OPTIONAL) { ULONG SourceLength; PCHAR p1, p2; @@ -2362,7 +2362,7 @@ RtlAppendAsciizToString( VOID NTAPI RtlUpperString(PSTRING DestinationString, - PSTRING SourceString) + const STRING *SourceString) { USHORT Length; PCHAR Src, Dest;