Export (0) Print
Expand All

RtlUnicodeStringValidate function

The RtlUnicodeStringValidate function validates the contents of a UNICODE_STRING structure.

Syntax


NTSTATUS RtlUnicodeStringValidate(
  _In_  PCUNICODE_STRING SourceString
);

Parameters

SourceString [in]

A pointer to a UNICODE_STRING structure to be validated.

Return value

RtlUnicodeStringValidate returns one of the following NTSTATUS values.

Return codeDescription
STATUS_SUCCESS

This success status means that the function completed successfully.

STATUS_INVALID_PARAMETER

This error status means that the function received an invalid input parameter. For more information, see the following list.

 

RtlUnicodeStringValidate returns the STATUS_INVALID_PARAMETER value when one of the following occurs:

  • SourceString->Length % sizeof(WCHAR) does not equal zero.
  • SourceString->MaximumLength % sizeof(WCHAR) does not equal zero.
  • SourceString->Length is greater than SourceString->MaximumLength.
  • SourceString->MaximumLength is greater than NTSTRSAFE_UNICODE_STRING_MAX_CCH * sizeof(WCHAR).
  • SourceString->Buffer equals NULL but SourceString->Length or SourceString->MaximumLength does not equal zero.

For information about how to test NTSTATUS values, see Using NTSTATUS Values.

Remarks

The SourceString pointer cannot be NULL. If you need to specify a NULL pointer value, use the RtlUnicodeStringValidateEx function.

For more information about the safe string functions, see Using Safe String Functions.

Requirements

Target platform

Desktop

Version

Available in Windows XP with Service Pack 1 (SP1) and later versions of Windows.

Header

Ntstrsafe.h (include Ntstrsafe.h)

Library

Ntstrsafe.lib

IRQL

PASSIVE_LEVEL

See also

RtlUnicodeStringValidateEx
UNICODE_STRING

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft