implemented RtlValidateUnicodeString, thanks to "mephistopheles" for providing some pseudeo code

svn path=/trunk/; revision=14378
This commit is contained in:
Thomas Bluemel 2005-03-29 02:09:42 +00:00
parent dea5b1d43f
commit 7c238e511f
2 changed files with 30 additions and 0 deletions

View file

@ -671,6 +671,7 @@ RtlValidSecurityDescriptor@4
RtlValidSid@4
RtlValidateHeap@12
RtlValidateProcessHeaps@0
RtlValidateUnicodeString@8
;RtlWalkHeap
RtlWriteRegistryValue@24
;RtlZeroHeap

View file

@ -2671,4 +2671,33 @@ RtlpDuplicateUnicodeString(
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 */