本文整理汇总了C#中AceFlags类的典型用法代码示例。如果您正苦于以下问题:C# AceFlags类的具体用法?C# AceFlags怎么用?C# AceFlags使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AceFlags类属于命名空间,在下文中一共展示了AceFlags类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CommonAce
// Constructor.
public CommonAce(AceFlags flags, AceQualifier qualifier, int accessMask,
SecurityIdentifier sid, bool isCallback, byte[] opaque)
: base(flags, (AceType)qualifier, accessMask,
sid, opaque, qualifier, isCallback)
{
// Nothing to do here.
}
示例2: KnownAce
public KnownAce(AceType type, AceFlags flags, int mask, Sid sid)
{
if (
type != AceType.AccessAllowed &&
type != AceType.AccessDenied &&
type != AceType.SystemAlarm &&
type != AceType.SystemAudit
)
throw new ArgumentException("Invalid ACE type.");
this.MemoryRegion = new MemoryAlloc(
Marshal.SizeOf(typeof(KnownAceStruct)) -
sizeof(int) +
sid.Length
);
KnownAceStruct knownAce = new KnownAceStruct();
knownAce.Header.AceType = type;
knownAce.Header.AceFlags = flags;
knownAce.Header.AceSize = (ushort)this.MemoryRegion.Size;
knownAce.Mask = mask;
this.MemoryRegion.WriteStruct<KnownAceStruct>(knownAce);
this.MemoryRegion.WriteMemory(Win32.KnownAceSidStartOffset.ToInt32(), sid, 0, sid.Length);
this.Read();
}
示例3: KnownAce
public KnownAce(AceType type, AceFlags flags, int mask, Sid sid)
{
if (
type != AceType.AccessAllowed &&
type != AceType.AccessDenied &&
type != AceType.SystemAlarm &&
type != AceType.SystemAudit
)
throw new ArgumentException("Invalid ACE type.");
this.MemoryRegion = new MemoryAlloc(
Marshal.SizeOf(typeof(KnownAceStruct)) - // known ace struct size
sizeof(int) + // minus SidStart field
sid.Length // plus SID length
);
KnownAceStruct knownAce = new KnownAceStruct();
// Initialize the ACE (minus the SID).
knownAce.Header.AceType = type;
knownAce.Header.AceFlags = flags;
knownAce.Header.AceSize = (ushort)this.MemoryRegion.Size;
knownAce.Mask = mask;
// Write the ACE to memory.
this.MemoryRegion.WriteStruct<KnownAceStruct>(knownAce);
// Write the SID.
this.MemoryRegion.WriteMemory(Win32.KnownAceSidStartOffset.ToInt32(), sid, 0, sid.Length);
// Update the cached info.
this.Read();
}
示例4: KnownAce
// Constructor.
internal KnownAce(AceFlags aceFlags, AceType aceType,
int accessMask, SecurityIdentifier securityIdentifier)
: base(aceFlags, aceType)
{
this.accessMask = accessMask;
this.securityIdentifier = securityIdentifier;
}
示例5: CommonAce
internal CommonAce (AceType type, AceFlags flags, int accessMask,
SecurityIdentifier sid, byte[] opaque)
: base(type, flags, opaque)
{
AccessMask = accessMask;
SecurityIdentifier = sid;
}
示例6: CompoundAce
public CompoundAce (AceFlags flags, int accessMask, CompoundAceType compoundAceType, SecurityIdentifier sid)
: base (AceType.AccessAllowedCompound, flags)
{
this.compound_ace_type = compoundAceType;
this.AccessMask = accessMask;
this.SecurityIdentifier = sid;
}
示例7: CustomAce
public CustomAce(AceType type, AceFlags flags, byte[] opaque) : base(type, flags)
{
if (type <= AceType.SystemAlarmCallbackObject)
{
throw new ArgumentOutOfRangeException("type", Environment.GetResourceString("ArgumentOutOfRange_InvalidUserDefinedAceType"));
}
this.SetOpaque(opaque);
}
示例8: CompoundAce
public CompoundAce (AceFlags flags, int accessMask, CompoundAceType compoundAceType, SecurityIdentifier sid)
: base (InheritanceFlags.None, PropagationFlags.None)
{
this.compound_ace_type = compoundAceType;
this.AceFlags = flags;
this.AccessMask = accessMask;
this.SecurityIdentifier = sid;
}
示例9: CommonAce
public CommonAce (AceFlags flags, AceQualifier qualifier,
int accessMask, SecurityIdentifier sid,
bool isCallback, byte[] opaque)
: base (InheritanceFlags.None, PropagationFlags.None, qualifier, isCallback, opaque)
{
AccessMask = accessMask;
SecurityIdentifier = sid;
}
示例10: CustomAce
public CustomAce (AceType type, AceFlags flags, byte[] opaque)
: base(type, flags)
{
/* FIXME: check length of opaque >
* MaxOpaqueLength or !multiple of 4
*/
SetOpaque (opaque);
}
示例11: KnownAce
internal KnownAce(AceType type, AceFlags flags, int accessMask, System.Security.Principal.SecurityIdentifier securityIdentifier) : base(type, flags)
{
if (securityIdentifier == null)
{
throw new ArgumentNullException("securityIdentifier");
}
this.AccessMask = accessMask;
this.SecurityIdentifier = securityIdentifier;
}
示例12: GenericAce
internal GenericAce (AceType type, AceFlags flags)
{
if (type > AceType.MaxDefinedAceType) {
throw new ArgumentOutOfRangeException ("type");
}
this.ace_type = type;
this.ace_flags = flags;
}
示例13: QualifiedAce
// Constructor.
internal QualifiedAce(AceFlags aceFlags, AceType aceType, int accessMask,
SecurityIdentifier securityIdentifier,
byte[] opaque, AceQualifier aceQualifier,
bool isCallback)
: base(aceFlags, aceType, accessMask, securityIdentifier)
{
this.opaque = opaque;
this.aceQualifier = aceQualifier;
this.isCallback = isCallback;
}
示例14: ObjectAce
internal ObjectAce (AceType type, AceFlags flags, int accessMask,
SecurityIdentifier sid, ObjectAceFlags objFlags,
Guid objType, Guid inheritedType, byte[] opaque)
: base(type, flags, opaque)
{
AccessMask = accessMask;
SecurityIdentifier = sid;
ObjectAceFlags = objFlags;
ObjectAceType = objType;
InheritedObjectAceType = inheritedType;
}
示例15: VerifyObjectAce
protected static void VerifyObjectAce(ObjectAce ace, AceFlags aceFlags, AceQualifier qualifier, int accessMask, SecurityIdentifier sid, ObjectAceFlags flags, Guid type, Guid inheritedType, bool isCallback, byte[] opaque)
{
Assert.Equal(aceFlags, ace.AceFlags);
Assert.Equal(accessMask, ace.AccessMask);
Assert.Equal(sid, ace.SecurityIdentifier);
Assert.Equal(opaque, ace.GetOpaque());
Assert.Equal(qualifier, ace.AceQualifier);
Assert.Equal(isCallback, ace.IsCallback);
Assert.Equal(flags, ace.ObjectAceFlags);
Assert.Equal(type, ace.ObjectAceType);
Assert.Equal(inheritedType, ace.InheritedObjectAceType);
}