Author: weiden
Date: Sat Jan 27 17:06:01 2007
New Revision: 25648
URL:
http://svn.reactos.org/svn/reactos?rev=25648&view=rev
Log:
Make RtlEqualPrefixSid portable
Modified:
trunk/reactos/lib/rtl/sid.c
Modified: trunk/reactos/lib/rtl/sid.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/sid.c?rev=25648&am…
==============================================================================
--- trunk/reactos/lib/rtl/sid.c (original)
+++ trunk/reactos/lib/rtl/sid.c Sat Jan 27 17:06:01 2007
@@ -303,14 +303,22 @@
RtlEqualPrefixSid(IN PSID Sid1_,
IN PSID Sid2_)
{
- PISID Sid1 = Sid1_;
- PISID Sid2 = Sid2_;
-
- PAGED_CODE_RTL();
-
- return(Sid1->SubAuthorityCount == Sid2->SubAuthorityCount &&
- !RtlCompareMemory(Sid1, Sid2,
- (Sid1->SubAuthorityCount - 1) * sizeof(DWORD) + 8));
+ PISID Sid1 = Sid1_;
+ PISID Sid2 = Sid2_;
+ SIZE_T SidLen;
+
+ PAGED_CODE_RTL();
+
+ if (Sid1->SubAuthorityCount == Sid2->SubAuthorityCount)
+ {
+ SidLen = FIELD_OFFSET(SID,
+ SubAuthority[Sid1->SubAuthorityCount]);
+ return RtlCompareMemory(Sid1,
+ Sid2,
+ SidLen) == SidLen;
+ }
+
+ return FALSE;
}