本文整理汇总了C#中System.RuntimeMethodHandleInternal类的典型用法代码示例。如果您正苦于以下问题:C# RuntimeMethodHandleInternal类的具体用法?C# RuntimeMethodHandleInternal怎么用?C# RuntimeMethodHandleInternal使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RuntimeMethodHandleInternal类属于System命名空间,在下文中一共展示了RuntimeMethodHandleInternal类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FrameDescSetHelper
[System.Security.SecurityCritical] // auto-generated
private static bool FrameDescSetHelper(FrameSecurityDescriptor secDesc,
PermissionSet demandSet,
out PermissionSet alteredDemandSet,
RuntimeMethodHandleInternal rmh)
{
return secDesc.CheckSetDemand(demandSet, out alteredDemandSet, rmh);
}
示例2: FrameDescHelper
[System.Security.SecurityCritical] // auto-generated
private static bool FrameDescHelper(FrameSecurityDescriptor secDesc,
IPermission demandIn,
PermissionToken permToken,
RuntimeMethodHandleInternal rmh)
{
return secDesc.CheckDemand((CodeAccessPermission) demandIn, permToken, rmh);
}
示例3: RuntimeConstructorInfo
internal RuntimeConstructorInfo(RuntimeMethodHandleInternal handle, RuntimeType declaringType, RuntimeType.RuntimeTypeCache reflectedTypeCache, MethodAttributes methodAttributes, System.Reflection.BindingFlags bindingFlags)
{
this.m_bindingFlags = bindingFlags;
this.m_reflectedTypeCache = reflectedTypeCache;
this.m_declaringType = declaringType;
this.m_handle = handle.Value;
this.m_methodAttributes = methodAttributes;
}
示例4: CheckDemand
internal bool CheckDemand(CodeAccessPermission demand, PermissionToken permToken, RuntimeMethodHandleInternal rmh)
{
if (!CheckAssert(this.AssertSet, demand, permToken))
{
return false;
}
CodeAccessSecurityEngine.CheckHelper(this.GrantSet, this.RefusedSet, demand, permToken, rmh, null, SecurityAction.Demand, true);
return true;
}
示例5: CheckDemand
internal bool CheckDemand(CodeAccessPermission demand, PermissionToken permToken, RuntimeMethodHandleInternal rmh)
{
bool flag = this.CheckDemand2(demand, permToken, rmh, false);
if (flag)
{
flag = this.CheckDemand2(demand, permToken, rmh, true);
}
return flag;
}
示例6: MakeSecurityException
[System.Security.SecurityCritical] // auto-generated
#pragma warning disable 618
internal static Exception MakeSecurityException(AssemblyName asmName, Evidence asmEvidence, PermissionSet granted, PermissionSet refused, RuntimeMethodHandleInternal rmh, SecurityAction action, Object demand, IPermission permThatFailed)
#pragma warning restore 618
{
#if FEATURE_CAS_POLICY
// See if we need to throw a HostProtectionException instead
HostProtectionPermission hostProtectionPerm = permThatFailed as HostProtectionPermission;
if(hostProtectionPerm != null)
return new HostProtectionException(GetResString("HostProtection_HostProtection"), HostProtectionPermission.protectedResources, hostProtectionPerm.Resources);
// Produce relevant strings
String message = "";
MethodInfo method = null;
try
{
if(granted == null && refused == null && demand == null)
{
message = GetResString("Security_NoAPTCA");
}
else
{
if(demand != null && demand is IPermission)
message = String.Format(CultureInfo.InvariantCulture, GetResString("Security_Generic"), demand.GetType().AssemblyQualifiedName );
else if (permThatFailed != null)
message = String.Format(CultureInfo.InvariantCulture, GetResString("Security_Generic"), permThatFailed.GetType().AssemblyQualifiedName);
else
message = GetResString("Security_GenericNoType");
}
method = SecurityRuntime.GetMethodInfo(rmh);
}
catch(Exception e)
{
// Environment.GetResourceString will throw if we are ReadyForAbort (thread abort). (We shouldn't do a Contract.Assert in this case or it will lock up the thread.)
if(e is System.Threading.ThreadAbortException)
throw;
}
/* catch(System.Threading.ThreadAbortException)
{
// Environment.GetResourceString will throw if we are ReadyForAbort (thread abort). (We shouldn't do a BCLDebug.Assert in this case or it will lock up the thread.)
throw;
}
catch
{
}
*/
// make the exception object
return new SecurityException(message, asmName, granted, refused, method, action, demand, permThatFailed, asmEvidence);
#else
return new SecurityException(GetResString("Arg_SecurityException"));
#endif
}
示例7: ThrowSecurityException
#pragma warning disable 618
private static void ThrowSecurityException(RuntimeAssembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandleInternal rmh, SecurityAction action, Object demand, IPermission permThatFailed)
#pragma warning restore 618
{
AssemblyName asmName = null;
Evidence asmEvidence = null;
if (asm != null)
{
// Assert here because reflection will check grants and if we fail the check,
// there will be an infinite recursion that overflows the stack.
PermissionSet.s_fullTrust.Assert();
asmName = asm.GetName();
}
throw SecurityException.MakeSecurityException(asmName, asmEvidence, granted, refused, rmh, action, demand, permThatFailed);
}
示例8: SignatureStruct
public unsafe SignatureStruct(RuntimeMethodHandleInternal method, RuntimeType[] arguments, RuntimeType returnType, CallingConventions callingConvention)
{
this.m_pMethod = method;
this.m_arguments = arguments;
this.m_returnTypeORfieldType = returnType;
this.m_managedCallingConvention = callingConvention;
this.m_sig = null;
this.m_pCallTarget = null;
this.m_csig = 0;
this.m_numVirtualFixedArgs = 0;
this.m_64bitpad = 0;
this.m_declaringType = null;
this.m_keepalive = null;
}
示例9: CheckDemand
internal bool CheckDemand(CodeAccessPermission demand, PermissionToken permToken, RuntimeMethodHandleInternal rmh)
{
bool flag = true;
if (this.m_permSetTriples != null)
{
for (int i = 0; (i < this.m_permSetTriples.Count) && flag; i++)
{
flag = ((PermissionSetTriple) this.m_permSetTriples[i]).CheckDemand(demand, permToken, rmh);
}
}
else if (this.m_firstPermSetTriple != null)
{
flag = this.m_firstPermSetTriple.CheckDemand(demand, permToken, rmh);
}
return false;
}
示例10: CheckDynamicMethodSetHelper
private static bool CheckDynamicMethodSetHelper(System.Reflection.Emit.DynamicResolver dynamicResolver,
PermissionSet demandSet,
out PermissionSet alteredDemandSet,
RuntimeMethodHandleInternal rmh)
{
System.Threading.CompressedStack creationStack = dynamicResolver.GetSecurityContext();
bool result;
try
{
result = creationStack.CheckSetDemandWithModificationNoHalt(demandSet, out alteredDemandSet, rmh);
}
catch (SecurityException ex)
{
throw new SecurityException(Environment.GetResourceString("Security_AnonymouslyHostedDynamicMethodCheckFailed"), ex);
}
return result;
}
示例11: GetMethodInfo
[System.Security.SecurityCritical] // auto-generated
internal static MethodInfo GetMethodInfo(RuntimeMethodHandleInternal rmh)
{
if (rmh.IsNullHandle())
return null;
#if _DEBUG
try
{
#endif
// Assert here because reflection will check grants and if we fail the check,
// there will be an infinite recursion that overflows the stack.
PermissionSet.s_fullTrust.Assert();
return (System.RuntimeType.GetMethodBase(RuntimeMethodHandle.GetDeclaringType(rmh), rmh) as MethodInfo);
#if _DEBUG
}
catch(Exception)
{
return null;
}
#endif
}
示例12: IsConstructor
internal extern static bool IsConstructor(RuntimeMethodHandleInternal method);
示例13: GetResolver
internal extern static Resolver GetResolver(RuntimeMethodHandleInternal method);
示例14: Destroy
internal extern static void Destroy(RuntimeMethodHandleInternal method);
示例15: IsDynamicMethod
internal extern static bool IsDynamicMethod(RuntimeMethodHandleInternal method);