mirror of
https://github.com/reactos/reactos.git
synced 2024-10-15 21:56:40 +00:00
implemented RtlValidateUnicodeString, thanks to "mephistopheles" for providing some pseudeo code
svn path=/trunk/; revision=14378
This commit is contained in:
parent
dea5b1d43f
commit
7c238e511f
|
@ -671,6 +671,7 @@ RtlValidSecurityDescriptor@4
|
|||
RtlValidSid@4
|
||||
RtlValidateHeap@12
|
||||
RtlValidateProcessHeaps@0
|
||||
RtlValidateUnicodeString@8
|
||||
;RtlWalkHeap
|
||||
RtlWriteRegistryValue@24
|
||||
;RtlZeroHeap
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue