mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 23:03:00 +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
2 changed files with 30 additions and 0 deletions
|
@ -671,6 +671,7 @@ RtlValidSecurityDescriptor@4
|
||||||
RtlValidSid@4
|
RtlValidSid@4
|
||||||
RtlValidateHeap@12
|
RtlValidateHeap@12
|
||||||
RtlValidateProcessHeaps@0
|
RtlValidateProcessHeaps@0
|
||||||
|
RtlValidateUnicodeString@8
|
||||||
;RtlWalkHeap
|
;RtlWalkHeap
|
||||||
RtlWriteRegistryValue@24
|
RtlWriteRegistryValue@24
|
||||||
;RtlZeroHeap
|
;RtlZeroHeap
|
||||||
|
|
|
@ -2671,4 +2671,33 @@ RtlpDuplicateUnicodeString(
|
||||||
return STATUS_SUCCESS;
|
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 */
|
/* EOF */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue