te
This commit is contained in:
parent
01151e679b
commit
57b2f0400e
265 changed files with 22828 additions and 6 deletions
53
Unused/Decal.Adapter/RuntimePolicyHelper.cs
Normal file
53
Unused/Decal.Adapter/RuntimePolicyHelper.cs
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Decal.Adapter;
|
||||
|
||||
internal static class RuntimePolicyHelper
|
||||
{
|
||||
[ComImport]
|
||||
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
[Guid("BD39D1D2-BA2F-486A-89B0-B4B0CB466891")]
|
||||
private interface ICLRRuntimeInfo
|
||||
{
|
||||
void xGetVersionString();
|
||||
|
||||
void xGetRuntimeDirectory();
|
||||
|
||||
void xIsLoaded();
|
||||
|
||||
void xIsLoadable();
|
||||
|
||||
void xLoadErrorString();
|
||||
|
||||
void xLoadLibrary();
|
||||
|
||||
void xGetProcAddress();
|
||||
|
||||
void xGetInterface();
|
||||
|
||||
void xSetDefaultStartupFlags();
|
||||
|
||||
void xGetDefaultStartupFlags();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
void BindAsLegacyV2Runtime();
|
||||
}
|
||||
|
||||
public static bool LegacyV2RuntimeEnabledSuccessfully { get; private set; }
|
||||
|
||||
static RuntimePolicyHelper()
|
||||
{
|
||||
ICLRRuntimeInfo iCLRRuntimeInfo = (ICLRRuntimeInfo)RuntimeEnvironment.GetRuntimeInterfaceAsObject(Guid.Empty, typeof(ICLRRuntimeInfo).GUID);
|
||||
try
|
||||
{
|
||||
iCLRRuntimeInfo.BindAsLegacyV2Runtime();
|
||||
LegacyV2RuntimeEnabledSuccessfully = true;
|
||||
}
|
||||
catch (COMException)
|
||||
{
|
||||
LegacyV2RuntimeEnabledSuccessfully = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue