nInit() private method

private nInit ( Assembly &assembly, bool forIntrospection, bool raiseResolveEvent ) : int
assembly Assembly
forIntrospection bool
raiseResolveEvent bool
return int
Example #1
0
        // Creates AssemblyName. Fills assembly if AssemblyResolve event has been raised.
        internal static AssemblyName CreateAssemblyName(
            String assemblyString,
            bool forIntrospection,
            out RuntimeAssembly assemblyFromResolveEvent)
        {
            if (assemblyString == null)
            {
                throw new ArgumentNullException(nameof(assemblyString));
            }
            Contract.EndContractBlock();

            if ((assemblyString.Length == 0) ||
                (assemblyString[0] == '\0'))
            {
                throw new ArgumentException(SR.Format_StringZeroLength);
            }

            if (forIntrospection)
            {
                AppDomain.CheckReflectionOnlyLoadSupported();
            }

            AssemblyName an = new AssemblyName();

            an.Name = assemblyString;
            an.nInit(out assemblyFromResolveEvent, forIntrospection, true);

            return(an);
        }
Example #2
0
        internal static RuntimeAssembly InternalLoad(string assemblyString, System.Security.Policy.Evidence assemblySecurity, ref StackCrawlMark stackMark, bool forIntrospection)
        {
            if (assemblyString == null)
            {
                throw new ArgumentNullException("assemblyString");
            }
            if ((assemblyString.Length == 0) || (assemblyString[0] == '\0'))
            {
                throw new ArgumentException(Environment.GetResourceString("Format_StringZeroLength"));
            }
            AssemblyName    assemblyRef = new AssemblyName();
            RuntimeAssembly assembly    = null;

            assemblyRef.Name = assemblyString;
            if (assemblyRef.nInit(out assembly, forIntrospection, true) == -2146234297)
            {
                return(assembly);
            }
            return(InternalLoadAssemblyName(assemblyRef, assemblySecurity, ref stackMark, forIntrospection, false));
        }
Example #3
0
        // Creates AssemblyName. Fills assembly if AssemblyResolve event has been raised.
        internal static AssemblyName CreateAssemblyName(
            string assemblyString,
            out RuntimeAssembly assemblyFromResolveEvent)
        {
            if (assemblyString == null)
            {
                throw new ArgumentNullException(nameof(assemblyString));
            }

            if ((assemblyString.Length == 0) ||
                (assemblyString[0] == '\0'))
            {
                throw new ArgumentException(SR.Format_StringZeroLength);
            }

            AssemblyName an = new AssemblyName();

            an.Name = assemblyString;
            an.nInit(out assemblyFromResolveEvent, true);

            return(an);
        }
Example #4
0
        [System.Security.SecurityCritical]  // auto-generated
        internal static AssemblyName CreateAssemblyName(
            String assemblyString, 
            bool forIntrospection, 
            out RuntimeAssembly assemblyFromResolveEvent)
        {
            if (assemblyString == null)
                throw new ArgumentNullException("assemblyString");
            Contract.EndContractBlock();

            if ((assemblyString.Length == 0) ||
                (assemblyString[0] == '\0'))
                throw new ArgumentException(Environment.GetResourceString("Format_StringZeroLength"));

            if (forIntrospection)
                AppDomain.CheckReflectionOnlyLoadSupported();

            AssemblyName an = new AssemblyName();

            an.Name = assemblyString;
            an.nInit(out assemblyFromResolveEvent, forIntrospection, true);
            
            return an;
        }
 internal static RuntimeAssembly InternalLoad(string assemblyString, System.Security.Policy.Evidence assemblySecurity, ref StackCrawlMark stackMark, bool forIntrospection)
 {
     if (assemblyString == null)
     {
         throw new ArgumentNullException("assemblyString");
     }
     if ((assemblyString.Length == 0) || (assemblyString[0] == '\0'))
     {
         throw new ArgumentException(Environment.GetResourceString("Format_StringZeroLength"));
     }
     AssemblyName assemblyRef = new AssemblyName();
     RuntimeAssembly assembly = null;
     assemblyRef.Name = assemblyString;
     if (assemblyRef.nInit(out assembly, forIntrospection, true) == -2146234297)
     {
         return assembly;
     }
     return InternalLoadAssemblyName(assemblyRef, assemblySecurity, ref stackMark, forIntrospection, false);
 }
        internal static Assembly InternalLoad(String assemblyString,
                                              Evidence assemblySecurity,
                                              ref StackCrawlMark stackMark,
                                              bool forIntrospection)
        {
            if (assemblyString == null)
                throw new ArgumentNullException("assemblyString");
            if ((assemblyString.Length == 0) ||
                (assemblyString[0] == '\0'))
                throw new ArgumentException(Environment.GetResourceString("Format_StringZeroLength"));

            AssemblyName an = new AssemblyName();
            Assembly assembly = null;

            an.Name = assemblyString;
            int hr = an.nInit(out assembly, forIntrospection, true);
            
            if (hr == System.__HResults.FUSION_E_INVALID_NAME) {
                return assembly;
            }
            else
                return InternalLoad(an, assemblySecurity, ref stackMark, forIntrospection);
        }