[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); }
[System.Security.SecurityCritical] // auto-generated private static bool FrameDescHelper(FrameSecurityDescriptor secDesc, IPermission demandIn, PermissionToken permToken, RuntimeMethodHandleInternal rmh) { return secDesc.CheckDemand((CodeAccessPermission) demandIn, permToken, rmh); }
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; }
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; }
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; }
[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 }
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; }
#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); }
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; }
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; }
[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 }
internal extern static bool HasMethodInstantiation(RuntimeMethodHandleInternal method);
internal static extern MethodAttributes GetAttributes(RuntimeMethodHandleInternal method);
internal static extern bool MatchesNameHash(RuntimeMethodHandleInternal method, uint hash);
internal int GetInterfaceMethodImplementationSlot(RuntimeTypeHandle interfaceHandle, RuntimeMethodHandleInternal interfaceMethodHandle) { return(GetInterfaceMethodImplementationSlot(this.GetNativeHandle(), interfaceHandle.GetNativeHandle(), interfaceMethodHandle)); }
internal static extern Object CreateInstance(RuntimeType type, bool publicOnly, bool noCheck, ref bool canBeCached, ref RuntimeMethodHandleInternal ctor, ref bool bNeedSecurityCheck);
[System.Security.SecuritySafeCritical] // auto-generated internal int GetInterfaceMethodImplementationSlot(RuntimeTypeHandle interfaceHandle, RuntimeMethodHandleInternal interfaceMethodHandle) { return GetInterfaceMethodImplementationSlot(GetNativeHandle(), interfaceHandle.GetNativeHandle(), interfaceMethodHandle); }
internal static extern bool IsDynamicMethod(RuntimeMethodHandleInternal method);
internal static extern void Destroy(RuntimeMethodHandleInternal method);
internal static extern RuntimeMethodHandleInternal GetMethodFromCanonical(RuntimeMethodHandleInternal method, RuntimeType declaringType);
internal static extern bool IsGenericMethodDefinition(RuntimeMethodHandleInternal method);
internal static extern RuntimeMethodHandleInternal GetStubIfNeeded(RuntimeMethodHandleInternal method, RuntimeType declaringType, RuntimeType[] methodInstantiation);
internal static extern bool HasMethodInstantiation(RuntimeMethodHandleInternal method);
internal static RuntimeType[] GetMethodInstantiationInternal(RuntimeMethodHandleInternal method) { RuntimeType[] o = null; GetMethodInstantiation(method, JitHelpers.GetObjectHandleOnStack <RuntimeType[]>(ref o), true); return(o); }
private static extern void GetMethodInstantiation(RuntimeMethodHandleInternal method, ObjectHandleOnStack types, bool fAsRuntimeTypeArray);
internal static extern Resolver GetResolver(RuntimeMethodHandleInternal method);
internal extern static LoaderAllocator GetLoaderAllocator(RuntimeMethodHandleInternal method);
internal static extern bool IsConstructor(RuntimeMethodHandleInternal method);
private static extern void GetNextIntroducedMethod(ref RuntimeMethodHandleInternal method);
internal static extern object GetLoaderAllocator(RuntimeMethodHandleInternal method);
public RuntimeMethodInfoStub(IntPtr methodHandleValue, object keepalive) { m_keepalive = keepalive; m_value = new RuntimeMethodHandleInternal(methodHandleValue); }
internal static extern void PerformSecurityCheck(object obj, RuntimeMethodHandleInternal method, RuntimeType parent, uint invocationFlags);
private static extern int GetInterfaceMethodImplementationSlot(RuntimeTypeHandle handle, RuntimeTypeHandle interfaceHandle, RuntimeMethodHandleInternal interfaceMethodHandle);
private static extern unsafe void *_GetUtf8Name(RuntimeMethodHandleInternal method);
internal IntroducedMethodEnumerator(RuntimeType type) { this._handle = RuntimeTypeHandle.GetFirstIntroducedMethod(type); this._firstCall = true; }
internal extern static RuntimeMethodHandleInternal GetMethodFromCanonical(RuntimeMethodHandleInternal method, RuntimeType declaringType);
internal static extern RuntimeType GetDeclaringType(RuntimeMethodHandleInternal method);
internal extern static bool IsDynamicMethod(RuntimeMethodHandleInternal method);
[System.Security.SecuritySafeCritical] // auto-generated internal static RuntimeType[] GetMethodInstantiationInternal(RuntimeMethodHandleInternal method) { RuntimeType[] types = null; GetMethodInstantiation(method, JitHelpers.GetObjectHandleOnStack(ref types), true); return types; }
internal extern static Resolver GetResolver(RuntimeMethodHandleInternal method);
internal extern static RuntimeMethodHandleInternal GetStubIfNeeded(RuntimeMethodHandleInternal method, RuntimeType declaringType, RuntimeType[] methodInstantiation);
internal static extern bool IsILStub(RuntimeMethodHandleInternal method);
internal extern static bool IsGenericMethodDefinition(RuntimeMethodHandleInternal method);
internal static extern string GetName(RuntimeMethodHandleInternal method);
internal extern static void Destroy(RuntimeMethodHandleInternal method);
public RuntimeMethodInfoStub(RuntimeMethodHandleInternal methodHandleValue, object keepalive) { this.m_keepalive = keepalive; this.m_value = methodHandleValue; }
internal extern static bool IsConstructor(RuntimeMethodHandleInternal method);
public RuntimeMethodInfoStub(IntPtr methodHandleValue, object keepalive) { this.m_keepalive = keepalive; this.m_value = new RuntimeMethodHandleInternal(methodHandleValue); }
[System.Security.SecuritySafeCritical] // auto-generated public Signature ( IRuntimeMethodInfo method, RuntimeType[] arguments, RuntimeType returnType, CallingConventions callingConvention) { m_pMethod = method.Value; m_arguments = arguments; m_returnTypeORfieldType = returnType; m_managedCallingConventionAndArgIteratorFlags = (byte)callingConvention; GetSignature(null, 0, new RuntimeFieldHandleInternal(), method, null); }
internal static extern IntPtr GetFunctionPointer(RuntimeMethodHandleInternal handle);
[System.Security.SecuritySafeCritical] // auto-generated internal IntroducedMethodEnumerator(RuntimeType type) { _handle = RuntimeTypeHandle.GetFirstIntroducedMethod(type); _firstCall = true; }
internal static extern int GetSlot(RuntimeMethodHandleInternal method);
private extern static int GetInterfaceMethodImplementationSlot(RuntimeTypeHandle handle, RuntimeTypeHandle interfaceHandle, RuntimeMethodHandleInternal interfaceMethodHandle);
internal static extern object CreateInstance(RuntimeType type, bool publicOnly, bool noCheck, ref bool canBeCached, ref RuntimeMethodHandleInternal ctor, ref bool bNeedSecurityCheck);
public RuntimeMethodInfoStub(RuntimeMethodHandleInternal methodHandleValue, object keepalive) { m_keepalive = keepalive; m_value = methodHandleValue; }
[System.Security.SecuritySafeCritical] // auto-generated protected virtual object DynamicInvokeImpl(object[] args) { RuntimeMethodHandleInternal method = new RuntimeMethodHandleInternal(GetInvokeMethod()); RuntimeMethodInfo invoke = (RuntimeMethodInfo)RuntimeType.GetMethodBase((RuntimeType)this.GetType(), method); return invoke.UnsafeInvoke(this, BindingFlags.Default, null, args, null); }
internal static Utf8String GetUtf8Name(RuntimeMethodHandleInternal method) { return(new Utf8String(_GetUtf8Name(method))); }