From 4f79c12e531fc062e6bd466278b57f83c65ce7ce Mon Sep 17 00:00:00 2001 From: Rafal Kupiec Date: Tue, 28 Jul 2026 18:46:03 +0200 Subject: [PATCH] String comparison routines can return -1 and thus their return type cant be unsigned --- sdk/xtdk/rtlfuncs.h | 8 ++++---- xtoskrnl/includes/rtl/string.hh | 12 ++++++------ xtoskrnl/includes/rtl/widestr.hh | 12 ++++++------ xtoskrnl/rtl/exports.cc | 8 ++++---- xtoskrnl/rtl/string.cc | 4 ++-- xtoskrnl/rtl/widestr.cc | 4 ++-- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/sdk/xtdk/rtlfuncs.h b/sdk/xtdk/rtlfuncs.h index e68aa72..33d50f2 100644 --- a/sdk/xtdk/rtlfuncs.h +++ b/sdk/xtdk/rtlfuncs.h @@ -59,28 +59,28 @@ RtlCompareMemory(IN PCVOID LeftBuffer, XTCLINK XTAPI -SIZE_T +LONG RtlCompareString(IN PCSTR String1, IN PCSTR String2, IN SIZE_T Length); XTCLINK XTAPI -SIZE_T +LONG RtlCompareStringInsensitive(IN PCSTR String1, IN PCSTR String2, IN SIZE_T Length); XTCLINK XTAPI -SIZE_T +LONG RtlCompareWideString(IN PCWSTR String1, IN PCWSTR String2, IN SIZE_T Length); XTCLINK XTAPI -SIZE_T +LONG RtlCompareWideStringInsensitive(IN PCWSTR String1, IN PCWSTR String2, IN SIZE_T Length); diff --git a/xtoskrnl/includes/rtl/string.hh b/xtoskrnl/includes/rtl/string.hh index f6feec4..d06ca07 100644 --- a/xtoskrnl/includes/rtl/string.hh +++ b/xtoskrnl/includes/rtl/string.hh @@ -18,12 +18,12 @@ namespace RTL class String { public: - STATIC XTAPI SIZE_T CompareString(IN PCSTR String1, - IN PCSTR String2, - IN SIZE_T Length); - STATIC XTAPI SIZE_T CompareStringInsensitive(IN PCSTR String1, - IN PCSTR String2, - IN SIZE_T Length); + STATIC XTAPI LONG CompareString(IN PCSTR String1, + IN PCSTR String2, + IN SIZE_T Length); + STATIC XTAPI LONG CompareStringInsensitive(IN PCSTR String1, + IN PCSTR String2, + IN SIZE_T Length); STATIC XTAPI PCHAR ConcatenateString(OUT PCHAR Destination, IN PCHAR Source, IN SIZE_T Count); diff --git a/xtoskrnl/includes/rtl/widestr.hh b/xtoskrnl/includes/rtl/widestr.hh index 8b4b459..a091280 100644 --- a/xtoskrnl/includes/rtl/widestr.hh +++ b/xtoskrnl/includes/rtl/widestr.hh @@ -18,12 +18,12 @@ namespace RTL class WideString { public: - STATIC XTAPI SIZE_T CompareWideString(IN PCWSTR String1, - IN PCWSTR String2, - IN SIZE_T Length); - STATIC XTAPI SIZE_T CompareWideStringInsensitive(IN PCWSTR String1, - IN PCWSTR String2, - IN SIZE_T Length); + STATIC XTAPI LONG CompareWideString(IN PCWSTR String1, + IN PCWSTR String2, + IN SIZE_T Length); + STATIC XTAPI LONG CompareWideStringInsensitive(IN PCWSTR String1, + IN PCWSTR String2, + IN SIZE_T Length); STATIC XTAPI PWCHAR ConcatenateWideString(OUT PWCHAR Destination, IN PWCHAR Source, IN SIZE_T Count); diff --git a/xtoskrnl/rtl/exports.cc b/xtoskrnl/rtl/exports.cc index c2e5f74..b2f8bee 100644 --- a/xtoskrnl/rtl/exports.cc +++ b/xtoskrnl/rtl/exports.cc @@ -166,7 +166,7 @@ RtlCompareMemory(IN PCVOID LeftBuffer, */ XTCLINK XTAPI -SIZE_T +LONG RtlCompareString(IN PCSTR String1, IN PCSTR String2, IN SIZE_T Length) @@ -192,7 +192,7 @@ RtlCompareString(IN PCSTR String1, */ XTCLINK XTAPI -SIZE_T +LONG RtlCompareStringInsensitive(IN PCSTR String1, IN PCSTR String2, IN SIZE_T Length) @@ -218,7 +218,7 @@ RtlCompareStringInsensitive(IN PCSTR String1, */ XTCLINK XTAPI -SIZE_T +LONG RtlCompareWideString(IN PCWSTR String1, IN PCWSTR String2, IN SIZE_T Length) @@ -244,7 +244,7 @@ RtlCompareWideString(IN PCWSTR String1, */ XTCLINK XTAPI -SIZE_T +LONG RtlCompareWideStringInsensitive(IN PCWSTR String1, IN PCWSTR String2, IN SIZE_T Length) diff --git a/xtoskrnl/rtl/string.cc b/xtoskrnl/rtl/string.cc index 12b5182..05f2dfc 100644 --- a/xtoskrnl/rtl/string.cc +++ b/xtoskrnl/rtl/string.cc @@ -26,7 +26,7 @@ * @since XT 1.0 */ XTAPI -SIZE_T +LONG RTL::String::CompareString(IN PCSTR String1, IN PCSTR String2, IN SIZE_T Length) @@ -78,7 +78,7 @@ RTL::String::CompareString(IN PCSTR String1, * @since XT 1.0 */ XTAPI -SIZE_T +LONG RTL::String::CompareStringInsensitive(IN PCSTR String1, IN PCSTR String2, IN SIZE_T Length) diff --git a/xtoskrnl/rtl/widestr.cc b/xtoskrnl/rtl/widestr.cc index bd93528..63a64f1 100644 --- a/xtoskrnl/rtl/widestr.cc +++ b/xtoskrnl/rtl/widestr.cc @@ -26,7 +26,7 @@ * @since XT 1.0 */ XTAPI -SIZE_T +LONG RTL::WideString::CompareWideString(IN PCWSTR String1, IN PCWSTR String2, IN SIZE_T Length) @@ -78,7 +78,7 @@ RTL::WideString::CompareWideString(IN PCWSTR String1, * @since XT 1.0 */ XTAPI -SIZE_T +LONG RTL::WideString::CompareWideStringInsensitive(IN PCWSTR String1, IN PCWSTR String2, IN SIZE_T Length)