summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/System/Runtime/InteropServices/RuntimeEnvironment.cs
diff options
context:
space:
mode:
authorJiyoung Yun <jy910.yun@samsung.com>2017-02-10 20:35:12 +0900
committerJiyoung Yun <jy910.yun@samsung.com>2017-02-10 20:35:12 +0900
commit4b11dc566a5bbfa1378d6266525c281b028abcc8 (patch)
treeb48831a898906734f8884d08b6e18f1144ee2b82 /src/mscorlib/src/System/Runtime/InteropServices/RuntimeEnvironment.cs
parentdb20f3f1bb8595633a7e16c8900fd401a453a6b5 (diff)
downloadcoreclr-4b11dc566a5bbfa1378d6266525c281b028abcc8.tar.gz
coreclr-4b11dc566a5bbfa1378d6266525c281b028abcc8.tar.bz2
coreclr-4b11dc566a5bbfa1378d6266525c281b028abcc8.zip
Imported Upstream version 1.0.0.9910upstream/1.0.0.9910
Diffstat (limited to 'src/mscorlib/src/System/Runtime/InteropServices/RuntimeEnvironment.cs')
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/RuntimeEnvironment.cs81
1 files changed, 1 insertions, 80 deletions
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/RuntimeEnvironment.cs b/src/mscorlib/src/System/Runtime/InteropServices/RuntimeEnvironment.cs
index a5c058da43..28abe0cb3b 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/RuntimeEnvironment.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/RuntimeEnvironment.cs
@@ -17,7 +17,6 @@ using System.IO;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
-using System.Security.Permissions;
using System.Reflection;
using Microsoft.Win32;
using System.Runtime.Versioning;
@@ -25,96 +24,18 @@ using StackCrawlMark = System.Threading.StackCrawlMark;
namespace System.Runtime.InteropServices
{
- [System.Runtime.InteropServices.ComVisible(true)]
- static public class RuntimeEnvironment {
+ static internal class RuntimeEnvironment {
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal static extern String GetModuleFileName();
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern String GetDeveloperPath();
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern String GetHostBindingFile();
-
- public static bool FromGlobalAccessCache(Assembly a)
- {
- return a.GlobalAssemblyCache;
- }
-
[MethodImpl (MethodImplOptions.NoInlining)]
public static String GetSystemVersion()
{
return Assembly.GetExecutingAssembly().ImageRuntimeVersion;
}
- public static String GetRuntimeDirectory()
- {
- String dir = GetRuntimeDirectoryImpl();
- new FileIOPermission(FileIOPermissionAccess.PathDiscovery, dir).Demand();
- return dir;
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern String GetRuntimeDirectoryImpl();
-
- // Returns the system ConfigurationFile
- public static String SystemConfigurationFile {
- get {
- StringBuilder sb = new StringBuilder(Path.MaxPath);
- sb.Append(GetRuntimeDirectory());
- sb.Append(AppDomainSetup.RuntimeConfigurationFile);
- String path = sb.ToString();
-
- // Do security check
- new FileIOPermission(FileIOPermissionAccess.PathDiscovery, path).Demand();
-
- return path;
- }
- }
-
#if FEATURE_COMINTEROP
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- private static extern IntPtr GetRuntimeInterfaceImpl(
- [In, MarshalAs(UnmanagedType.LPStruct)] Guid clsid,
- [In, MarshalAs(UnmanagedType.LPStruct)] Guid riid);
-
- //
- // This function does the equivalent of calling GetInterface(clsid, riid) on the
- // ICLRRuntimeInfo representing this runtime. See MetaHost.idl for a list of
- // CLSIDs and IIDs supported by this method.
- //
- // Returns unmanaged pointer to requested interface on success. Throws
- // COMException with failed HR if there is a QI failure.
- //
- [ComVisible(false)]
- public static IntPtr GetRuntimeInterfaceAsIntPtr(Guid clsid, Guid riid)
- {
- return GetRuntimeInterfaceImpl(clsid, riid);
- }
-
- //
- // This function does the equivalent of calling GetInterface(clsid, riid) on the
- // ICLRRuntimeInfo representing this runtime. See MetaHost.idl for a list of
- // CLSIDs and IIDs supported by this method.
- //
- // Returns an RCW to requested interface on success. Throws
- // COMException with failed HR if there is a QI failure.
- //
- [ComVisible(false)]
- public static object GetRuntimeInterfaceAsObject(Guid clsid, Guid riid)
- {
- IntPtr p = IntPtr.Zero;
- try {
- p = GetRuntimeInterfaceImpl(clsid, riid);
- return Marshal.GetObjectForIUnknown(p);
- } finally {
- if(p != IntPtr.Zero) {
- Marshal.Release(p);
- }
- }
- }
#endif // FEATURE_COMINTEROP
}
}