281 lines
9.5 KiB
C#
281 lines
9.5 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace System.Security.Permissions
|
|
{
|
|
/// <summary>Allows the use of declarative security actions to determine host protection requirements. This class cannot be inherited.</summary>
|
|
// Token: 0x02000549 RID: 1353
|
|
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Delegate, AllowMultiple = true, Inherited = false)]
|
|
[ComVisible(true)]
|
|
[Serializable]
|
|
public sealed class HostProtectionAttribute : CodeAccessSecurityAttribute
|
|
{
|
|
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Permissions.HostProtectionAttribute" /> class with default values.</summary>
|
|
// Token: 0x0600318A RID: 12682 RVA: 0x000AA7A8 File Offset: 0x000A89A8
|
|
public HostProtectionAttribute()
|
|
: base(SecurityAction.LinkDemand)
|
|
{
|
|
}
|
|
|
|
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Permissions.HostProtectionAttribute" /> class with the specified <see cref="T:System.Security.Permissions.SecurityAction" /> value.</summary>
|
|
/// <param name="action">One of the <see cref="T:System.Security.Permissions.SecurityAction" /> values. </param>
|
|
/// <exception cref="T:System.ArgumentException">
|
|
/// <paramref name="action" /> is not <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />. </exception>
|
|
// Token: 0x0600318B RID: 12683 RVA: 0x000AA7B4 File Offset: 0x000A89B4
|
|
public HostProtectionAttribute(SecurityAction action)
|
|
: base(action)
|
|
{
|
|
if (action != SecurityAction.LinkDemand)
|
|
{
|
|
string text = string.Format(Locale.GetText("Only {0} is accepted."), SecurityAction.LinkDemand);
|
|
throw new ArgumentException(text, "action");
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets or sets a value indicating whether external process management is exposed.</summary>
|
|
/// <returns>true if external process management is exposed; otherwise, false. The default is false.</returns>
|
|
// Token: 0x170009AF RID: 2479
|
|
// (get) Token: 0x0600318C RID: 12684 RVA: 0x000AA7F4 File Offset: 0x000A89F4
|
|
// (set) Token: 0x0600318D RID: 12685 RVA: 0x000AA804 File Offset: 0x000A8A04
|
|
public bool ExternalProcessMgmt
|
|
{
|
|
get
|
|
{
|
|
return (this._resources & HostProtectionResource.ExternalProcessMgmt) != HostProtectionResource.None;
|
|
}
|
|
set
|
|
{
|
|
if (value)
|
|
{
|
|
this._resources |= HostProtectionResource.ExternalProcessMgmt;
|
|
}
|
|
else
|
|
{
|
|
this._resources &= ~HostProtectionResource.ExternalProcessMgmt;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets or sets a value indicating whether external threading is exposed.</summary>
|
|
/// <returns>true if external threading is exposed; otherwise, false. The default is false.</returns>
|
|
// Token: 0x170009B0 RID: 2480
|
|
// (get) Token: 0x0600318E RID: 12686 RVA: 0x000AA83C File Offset: 0x000A8A3C
|
|
// (set) Token: 0x0600318F RID: 12687 RVA: 0x000AA850 File Offset: 0x000A8A50
|
|
public bool ExternalThreading
|
|
{
|
|
get
|
|
{
|
|
return (this._resources & HostProtectionResource.ExternalThreading) != HostProtectionResource.None;
|
|
}
|
|
set
|
|
{
|
|
if (value)
|
|
{
|
|
this._resources |= HostProtectionResource.ExternalThreading;
|
|
}
|
|
else
|
|
{
|
|
this._resources &= ~HostProtectionResource.ExternalThreading;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets or sets a value indicating whether resources might leak memory if the operation is terminated.</summary>
|
|
/// <returns>true if resources might leak memory on termination; otherwise, false.</returns>
|
|
// Token: 0x170009B1 RID: 2481
|
|
// (get) Token: 0x06003190 RID: 12688 RVA: 0x000AA87C File Offset: 0x000A8A7C
|
|
// (set) Token: 0x06003191 RID: 12689 RVA: 0x000AA890 File Offset: 0x000A8A90
|
|
public bool MayLeakOnAbort
|
|
{
|
|
get
|
|
{
|
|
return (this._resources & HostProtectionResource.MayLeakOnAbort) != HostProtectionResource.None;
|
|
}
|
|
set
|
|
{
|
|
if (value)
|
|
{
|
|
this._resources |= HostProtectionResource.MayLeakOnAbort;
|
|
}
|
|
else
|
|
{
|
|
this._resources &= ~HostProtectionResource.MayLeakOnAbort;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets or sets a value indicating whether the security infrastructure is exposed.</summary>
|
|
/// <returns>true if the security infrastructure is exposed; otherwise, false. The default is false.</returns>
|
|
// Token: 0x170009B2 RID: 2482
|
|
// (get) Token: 0x06003192 RID: 12690 RVA: 0x000AA8C4 File Offset: 0x000A8AC4
|
|
// (set) Token: 0x06003193 RID: 12691 RVA: 0x000AA8D8 File Offset: 0x000A8AD8
|
|
[ComVisible(true)]
|
|
public bool SecurityInfrastructure
|
|
{
|
|
get
|
|
{
|
|
return (this._resources & HostProtectionResource.SecurityInfrastructure) != HostProtectionResource.None;
|
|
}
|
|
set
|
|
{
|
|
if (value)
|
|
{
|
|
this._resources |= HostProtectionResource.SecurityInfrastructure;
|
|
}
|
|
else
|
|
{
|
|
this._resources &= ~HostProtectionResource.SecurityInfrastructure;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets or sets a value indicating whether self-affecting process management is exposed.</summary>
|
|
/// <returns>true if self-affecting process management is exposed; otherwise, false. The default is false.</returns>
|
|
// Token: 0x170009B3 RID: 2483
|
|
// (get) Token: 0x06003194 RID: 12692 RVA: 0x000AA904 File Offset: 0x000A8B04
|
|
// (set) Token: 0x06003195 RID: 12693 RVA: 0x000AA914 File Offset: 0x000A8B14
|
|
public bool SelfAffectingProcessMgmt
|
|
{
|
|
get
|
|
{
|
|
return (this._resources & HostProtectionResource.SelfAffectingProcessMgmt) != HostProtectionResource.None;
|
|
}
|
|
set
|
|
{
|
|
if (value)
|
|
{
|
|
this._resources |= HostProtectionResource.SelfAffectingProcessMgmt;
|
|
}
|
|
else
|
|
{
|
|
this._resources &= ~HostProtectionResource.SelfAffectingProcessMgmt;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets or sets a value indicating whether self-affecting threading is exposed.</summary>
|
|
/// <returns>true if self-affecting threading is exposed; otherwise, false. The default is false.</returns>
|
|
// Token: 0x170009B4 RID: 2484
|
|
// (get) Token: 0x06003196 RID: 12694 RVA: 0x000AA94C File Offset: 0x000A8B4C
|
|
// (set) Token: 0x06003197 RID: 12695 RVA: 0x000AA960 File Offset: 0x000A8B60
|
|
public bool SelfAffectingThreading
|
|
{
|
|
get
|
|
{
|
|
return (this._resources & HostProtectionResource.SelfAffectingThreading) != HostProtectionResource.None;
|
|
}
|
|
set
|
|
{
|
|
if (value)
|
|
{
|
|
this._resources |= HostProtectionResource.SelfAffectingThreading;
|
|
}
|
|
else
|
|
{
|
|
this._resources &= ~HostProtectionResource.SelfAffectingThreading;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets or sets a value indicating whether shared state is exposed.</summary>
|
|
/// <returns>true if shared state is exposed; otherwise, false. The default is false.</returns>
|
|
// Token: 0x170009B5 RID: 2485
|
|
// (get) Token: 0x06003198 RID: 12696 RVA: 0x000AA98C File Offset: 0x000A8B8C
|
|
// (set) Token: 0x06003199 RID: 12697 RVA: 0x000AA99C File Offset: 0x000A8B9C
|
|
public bool SharedState
|
|
{
|
|
get
|
|
{
|
|
return (this._resources & HostProtectionResource.SharedState) != HostProtectionResource.None;
|
|
}
|
|
set
|
|
{
|
|
if (value)
|
|
{
|
|
this._resources |= HostProtectionResource.SharedState;
|
|
}
|
|
else
|
|
{
|
|
this._resources &= ~HostProtectionResource.SharedState;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets or sets a value indicating whether synchronization is exposed.</summary>
|
|
/// <returns>true if synchronization is exposed; otherwise, false. The default is false.</returns>
|
|
// Token: 0x170009B6 RID: 2486
|
|
// (get) Token: 0x0600319A RID: 12698 RVA: 0x000AA9D4 File Offset: 0x000A8BD4
|
|
// (set) Token: 0x0600319B RID: 12699 RVA: 0x000AA9E4 File Offset: 0x000A8BE4
|
|
public bool Synchronization
|
|
{
|
|
get
|
|
{
|
|
return (this._resources & HostProtectionResource.Synchronization) != HostProtectionResource.None;
|
|
}
|
|
set
|
|
{
|
|
if (value)
|
|
{
|
|
this._resources |= HostProtectionResource.Synchronization;
|
|
}
|
|
else
|
|
{
|
|
this._resources &= ~HostProtectionResource.Synchronization;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets or sets a value indicating whether the user interface is exposed.</summary>
|
|
/// <returns>true if the user interface is exposed; otherwise, false. The default is false.</returns>
|
|
// Token: 0x170009B7 RID: 2487
|
|
// (get) Token: 0x0600319C RID: 12700 RVA: 0x000AAA1C File Offset: 0x000A8C1C
|
|
// (set) Token: 0x0600319D RID: 12701 RVA: 0x000AAA30 File Offset: 0x000A8C30
|
|
public bool UI
|
|
{
|
|
get
|
|
{
|
|
return (this._resources & HostProtectionResource.UI) != HostProtectionResource.None;
|
|
}
|
|
set
|
|
{
|
|
if (value)
|
|
{
|
|
this._resources |= HostProtectionResource.UI;
|
|
}
|
|
else
|
|
{
|
|
this._resources &= ~HostProtectionResource.UI;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets or sets flags specifying categories of functionality that are potentially harmful to the host.</summary>
|
|
/// <returns>A bitwise combination of the <see cref="T:System.Security.Permissions.HostProtectionResource" /> values. The default is <see cref="F:System.Security.Permissions.HostProtectionResource.None" />.</returns>
|
|
// Token: 0x170009B8 RID: 2488
|
|
// (get) Token: 0x0600319E RID: 12702 RVA: 0x000AAA64 File Offset: 0x000A8C64
|
|
// (set) Token: 0x0600319F RID: 12703 RVA: 0x000AAA6C File Offset: 0x000A8C6C
|
|
public HostProtectionResource Resources
|
|
{
|
|
get
|
|
{
|
|
return this._resources;
|
|
}
|
|
set
|
|
{
|
|
this._resources = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>Creates and returns a new host protection permission.</summary>
|
|
/// <returns>An <see cref="T:System.Security.IPermission" /> that corresponds to the current attribute.</returns>
|
|
// Token: 0x060031A0 RID: 12704 RVA: 0x000AAA78 File Offset: 0x000A8C78
|
|
public override IPermission CreatePermission()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
// Token: 0x0400143A RID: 5178
|
|
private HostProtectionResource _resources;
|
|
}
|
|
}
|