implemented RtlValidateUnicodeString, thanks to "mephistopheles" for providing some pseudeo code Modified: trunk/reactos/lib/ntdll/def/ntdll.def Modified: trunk/reactos/lib/rtl/unicode.c _____
Modified: trunk/reactos/lib/ntdll/def/ntdll.def --- trunk/reactos/lib/ntdll/def/ntdll.def 2005-03-28 19:29:59 UTC (rev 14377) +++ trunk/reactos/lib/ntdll/def/ntdll.def 2005-03-29 02:09:42 UTC (rev 14378) @@ -671,6 +671,7 @@
RtlValidSid@4 RtlValidateHeap@12 RtlValidateProcessHeaps@0 +RtlValidateUnicodeString@8 ;RtlWalkHeap RtlWriteRegistryValue@24 ;RtlZeroHeap _____
Modified: trunk/reactos/lib/rtl/unicode.c --- trunk/reactos/lib/rtl/unicode.c 2005-03-28 19:29:59 UTC (rev 14377) +++ trunk/reactos/lib/rtl/unicode.c 2005-03-29 02:09:42 UTC (rev 14378) @@ -2671,4 +2671,33 @@
return STATUS_SUCCESS; }
+ +/* + * @implemented + */ +NTSTATUS STDCALL +RtlValidateUnicodeString(IN ULONG Flags, + IN PUNICODE_STRING UnicodeString) +{ + /* currently no flags are supported! */ + ASSERT(Flags == 0); + + if ((Flags == 0) && + ((UnicodeString == NULL) || + ((UnicodeString->Length != 0) && + (UnicodeString->Buffer != NULL) && + ((UnicodeString->Length % sizeof(WCHAR)) == 0) && + ((UnicodeString->MaximumLength % sizeof(WCHAR)) == 0) && + (UnicodeString->MaximumLength >= UnicodeString->Length)))) + { + /* a NULL pointer as a unicode string is considered to be a valid unicode + string! */ + return STATUS_SUCCESS; + } + else + { + return STATUS_INVALID_PARAMETER; + } +} + /* EOF */