mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 22:56:00 +00:00
implemented RtlHashUnicodeString and export it in ntdll
svn path=/trunk/; revision=16226
This commit is contained in:
parent
9900f1ee91
commit
204ad68d21
3 changed files with 50 additions and 8 deletions
|
@ -184,6 +184,11 @@
|
||||||
#define VER_CONDITION_MASK 7
|
#define VER_CONDITION_MASK 7
|
||||||
#define VER_NUM_BITS_PER_CONDITION_MASK 3
|
#define VER_NUM_BITS_PER_CONDITION_MASK 3
|
||||||
|
|
||||||
|
/* RTL String Hash Algorithms */
|
||||||
|
#define HASH_STRING_ALGORITHM_DEFAULT 0
|
||||||
|
#define HASH_STRING_ALGORITHM_X65599 1
|
||||||
|
#define HASH_STRING_ALGORITHM_INVALID 0xffffffff
|
||||||
|
|
||||||
/* List Macros */
|
/* List Macros */
|
||||||
static __inline
|
static __inline
|
||||||
VOID
|
VOID
|
||||||
|
|
|
@ -475,6 +475,7 @@ RtlGetSaclSecurityDescriptor@16
|
||||||
RtlGetSecurityDescriptorRMControl@8
|
RtlGetSecurityDescriptorRMControl@8
|
||||||
;RtlGetUserInfoHeap
|
;RtlGetUserInfoHeap
|
||||||
RtlGetVersion@4
|
RtlGetVersion@4
|
||||||
|
RtlHashUnicodeString@16
|
||||||
RtlIdentifierAuthoritySid@4
|
RtlIdentifierAuthoritySid@4
|
||||||
RtlImageDirectoryEntryToData@16
|
RtlImageDirectoryEntryToData@16
|
||||||
RtlImageNtHeader@4
|
RtlImageNtHeader@4
|
||||||
|
|
|
@ -1603,19 +1603,55 @@ RtlEraseUnicodeString(
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STDCALL
|
STDCALL
|
||||||
RtlHashUnicodeString(
|
RtlHashUnicodeString(
|
||||||
IN const UNICODE_STRING *String,
|
IN CONST UNICODE_STRING *String,
|
||||||
IN BOOLEAN CaseInSensitive,
|
IN BOOLEAN CaseInSensitive,
|
||||||
IN ULONG HashAlgorithm,
|
IN ULONG HashAlgorithm,
|
||||||
OUT PULONG HashValue
|
OUT PULONG HashValue)
|
||||||
)
|
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
if (String != NULL && HashValue != NULL)
|
||||||
return STATUS_NOT_IMPLEMENTED;
|
{
|
||||||
|
switch (HashAlgorithm)
|
||||||
|
{
|
||||||
|
case HASH_STRING_ALGORITHM_DEFAULT:
|
||||||
|
case HASH_STRING_ALGORITHM_X65599:
|
||||||
|
{
|
||||||
|
WCHAR *c, *end;
|
||||||
|
|
||||||
|
*HashValue = 0;
|
||||||
|
end = String->Buffer + (String->Length / sizeof(WCHAR));
|
||||||
|
|
||||||
|
if (CaseInSensitive)
|
||||||
|
{
|
||||||
|
for (c = String->Buffer;
|
||||||
|
c != end;
|
||||||
|
c++)
|
||||||
|
{
|
||||||
|
/* only uppercase characters if they are 'a' ... 'z'! */
|
||||||
|
*HashValue = ((65599 * (*HashValue)) +
|
||||||
|
(ULONG)(((*c) >= L'a' && (*c) <= L'z') ?
|
||||||
|
(*c) - L'a' + L'A' : (*c)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (c = String->Buffer;
|
||||||
|
c != end;
|
||||||
|
c++)
|
||||||
|
{
|
||||||
|
*HashValue = ((65599 * (*HashValue)) + (ULONG)(*c));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return STATUS_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue