mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 12:26:09 +00:00
[RTL][NTDLL] Implement and export RtlCompareUnicodeStrings
This commit is contained in:
parent
c332b917dc
commit
d00d883a21
2 changed files with 48 additions and 1 deletions
|
@ -682,7 +682,7 @@
|
|||
@ stdcall RtlCompareMemoryUlong(ptr long long)
|
||||
@ stdcall RtlCompareString(ptr ptr long)
|
||||
@ stdcall RtlCompareUnicodeString (ptr ptr long)
|
||||
@ stub -version=0x600+ RtlCompareUnicodeStrings
|
||||
@ stdcall -version=0x600+ RtlCompareUnicodeStrings(wstr long wstr long long)
|
||||
@ stub -version=0x600+ -arch=x86_64 RtlCompleteProcessCloning
|
||||
@ stdcall RtlCompressBuffer(long ptr long ptr long long ptr ptr)
|
||||
@ stdcall RtlComputeCrc32(long ptr long)
|
||||
|
|
|
@ -2222,6 +2222,53 @@ RtlCompareUnicodeString(
|
|||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
_IRQL_requires_max_(PASSIVE_LEVEL)
|
||||
_Must_inspect_result_
|
||||
NTSYSAPI
|
||||
LONG
|
||||
NTAPI
|
||||
RtlCompareUnicodeStrings(
|
||||
_In_reads_(String1Length) PCWCH String1,
|
||||
_In_ SIZE_T String1Length,
|
||||
_In_reads_(String2Length) PCWCH String2,
|
||||
_In_ SIZE_T String2Length,
|
||||
_In_ BOOLEAN CaseInSensitive)
|
||||
{
|
||||
LONG Result = 0;
|
||||
SIZE_T MinStringLength = min(String1Length, String2Length);
|
||||
SIZE_T Index;
|
||||
|
||||
if (CaseInSensitive)
|
||||
{
|
||||
for (Index = 0; Index < MinStringLength; Index++)
|
||||
{
|
||||
WCHAR Char1 = RtlpUpcaseUnicodeChar(String1[Index]);
|
||||
WCHAR Char2 = RtlpUpcaseUnicodeChar(String2[Index]);
|
||||
Result = Char1 - Char2;
|
||||
if (Result != 0)
|
||||
{
|
||||
return Result;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (Index = 0; Index < MinStringLength; Index++)
|
||||
{
|
||||
Result = String1[Index] - String2[Index];
|
||||
if (Result != 0)
|
||||
{
|
||||
return Result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return String1Length - String2Length;
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue