RtlHashUnicodeString function (wdm.h)

The RtlHashUnicodeString routine creates a hash value from a given Unicode string and hash algorithm.

Syntax

NTSYSAPI NTSTATUS RtlHashUnicodeString(
  [in]  PCUNICODE_STRING String,
  [in]  BOOLEAN          CaseInSensitive,
  [in]  ULONG            HashAlgorithm,
  [out] PULONG           HashValue
);

Parameters

[in] String

A pointer to a UNICODE_STRING structure that contains the Unicode string to be converted to a hash value.

[in] CaseInSensitive

Specifies whether to treat the Unicode string as case sensitive when computing the hash value. If CaseInSensitive is TRUE, a lowercase and uppercase string hash to the same value.

[in] HashAlgorithm

The hash algorithm to use. If HashAlgorithm is HASH_STRING_ALGORITHM_X65599, RtlHashUnicodeString uses the x65599 hashing algorithm. If HashAlgorithm is HASH_STRING_ALGORITHM_DEFAULT, RtlHashUnicodeString uses the default algorithm. Currently, the default algorithm is the x65599 hashing algorithm.

[out] HashValue

A pointer to a ULONG variable that receives the hash value.

Return value

RtlHashUnicodeString returns STATUS_SUCCESS on success, or the appropriate NTSTATUS value on failure. The routine returns a STATUS_INVALID_PARAMETER value if the Unicode string is NULL, HashValue is NULL, or the caller specifies an undefined value for HashAlgorithm.

Requirements

Requirement Value
Minimum supported client Available in Windows XP and later versions of Windows.
Target Platform Universal
Header wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL <= APC_LEVEL

See also

UNICODE_STRING