private static byte MapFromFlags(AceType type, AceFlags flags) { byte ret = (byte)flags; if (type == AceType.AccessFilter && flags.HasFlagSet(AceFlags.TrustProtected)) { ret |= 0x40; } return(ret); }
private static AceFlags MapToFlags(AceType type, byte flags) { AceFlags ret = (AceFlags)flags; if (type == AceType.AccessFilter && ret.HasFlagSet(AceFlags.SuccessfulAccess)) { ret &= ~AceFlags.SuccessfulAccess; ret |= AceFlags.TrustProtected; } return(ret); }