Author: ion Date: Thu Oct 4 06:28:58 2012 New Revision: 57476
URL: http://svn.reactos.org/svn/reactos?rev=57476&view=rev Log: [RTL]: CORE-6713 #resolve #time 10m #comment Use explicit checks when checking for present and default flags, just like Windows. Fixes winetest regressions.
Modified: trunk/reactos/lib/rtl/sd.c
Modified: trunk/reactos/lib/rtl/sd.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/sd.c?rev=57476&... ============================================================================== --- trunk/reactos/lib/rtl/sd.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/sd.c [iso-8859-1] Thu Oct 4 06:28:58 2012 @@ -208,12 +208,12 @@ if (Sd->Revision != SECURITY_DESCRIPTOR_REVISION) return STATUS_UNKNOWN_REVISION;
/* Is there a DACL? */ - *DaclPresent = Sd->Control & SE_DACL_PRESENT; + *DaclPresent = (Sd->Control & SE_DACL_PRESENT) == SE_DACL_PRESENT; if (*DaclPresent) { /* Yes, return it, and check if defaulted */ *Dacl = SepGetDaclFromDescriptor(Sd); - *DaclDefaulted = Sd->Control & SE_DACL_DEFAULTED; + *DaclDefaulted = (Sd->Control & SE_DACL_DEFAULTED) == SE_DACL_DEFAULTED; }
/* All good */ @@ -237,12 +237,12 @@ if (Sd->Revision != SECURITY_DESCRIPTOR_REVISION) return STATUS_UNKNOWN_REVISION;
/* Is there a SACL? */ - *SaclPresent = Sd->Control & SE_SACL_PRESENT; + *SaclPresent = (Sd->Control & SE_SACL_PRESENT) == SE_SACL_PRESENT; if (*SaclPresent) { /* Yes, return it, and check if defaulted */ *Sacl = SepGetSaclFromDescriptor(Sd); - *SaclDefaulted = Sd->Control & SE_SACL_DEFAULTED; + *SaclDefaulted = (Sd->Control & SE_SACL_DEFAULTED) == SE_SACL_DEFAULTED; }
/* All good */ @@ -266,7 +266,7 @@
/* Get the owner and if defaulted */ *Owner = SepGetOwnerFromDescriptor(Sd); - *OwnerDefaulted = Sd->Control & SE_OWNER_DEFAULTED; + *OwnerDefaulted = (Sd->Control & SE_OWNER_DEFAULTED) == SE_OWNER_DEFAULTED;
/* All good */ return STATUS_SUCCESS; @@ -289,7 +289,7 @@
/* Get the group and if defaulted */ *Group = SepGetGroupFromDescriptor(Sd); - *GroupDefaulted = Sd->Control & SE_GROUP_DEFAULTED; + *GroupDefaulted = (Sd->Control & SE_GROUP_DEFAULTED) == SE_GROUP_DEFAULTED;
/* All good */ return STATUS_SUCCESS; @@ -1164,7 +1164,7 @@ }
/* Is there a DACL? */ - if (Sd->Control & SE_DACL_PRESENT) + if ((Sd->Control & SE_DACL_PRESENT) == SE_DACL_PRESENT) { /* Try to access it */ if (!RtlpValidateSDOffsetAndSize(Sd->Dacl, @@ -1182,7 +1182,7 @@ }
/* Is there a SACL? */ - if (Sd->Control & SE_SACL_PRESENT) + if ((Sd->Control & SE_SACL_PRESENT) == SE_SACL_PRESENT) { /* Try to access it */ if (!RtlpValidateSDOffsetAndSize(Sd->Sacl,