Esempio n. 1
0
        private static string ConvertDotNetFrameworkArchitectureToProcessorArchitecture(Microsoft.Build.Utilities.DotNetFrameworkArchitecture architecture)
        {
            switch (architecture)
            {
            case Microsoft.Build.Utilities.DotNetFrameworkArchitecture.Current:
                return(ProcessorArchitecture.CurrentProcessArchitecture);

            case Microsoft.Build.Utilities.DotNetFrameworkArchitecture.Bitness32:
                return("x86");

            case Microsoft.Build.Utilities.DotNetFrameworkArchitecture.Bitness64:
            {
                NativeMethodsShared.SYSTEM_INFO lpSystemInfo = new NativeMethodsShared.SYSTEM_INFO();
                NativeMethodsShared.GetNativeSystemInfo(ref lpSystemInfo);
                ushort wProcessorArchitecture = lpSystemInfo.wProcessorArchitecture;
                switch (wProcessorArchitecture)
                {
                case 0:
                    return(null);

                case 6:
                    return("IA64");
                }
                if (wProcessorArchitecture != 9)
                {
                    return(null);
                }
                return("AMD64");
            }
            }
            ErrorUtilities.ThrowInternalErrorUnreachable();
            return(null);
        }