RuntimeEnvironment.GetRuntimeInterfaceAsIntPtr Method (Guid, Guid)

.NET Framework (current version)
 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Returns the specified interface on the specified class.

Namespace:   System.Runtime.InteropServices
Assembly:  mscorlib (in mscorlib.dll)

[SecurityCriticalAttribute]
[ComVisibleAttribute(false)]
public static IntPtr GetRuntimeInterfaceAsIntPtr(
	Guid clsid,
	Guid riid
)

Parameters

clsid
Type: System.Guid

The identifier for the desired class.

riid
Type: System.Guid

The identifier for the desired interface.

Return Value

Type: System.IntPtr

An unmanaged pointer to the requested interface.

This method is similar to calling the method on the interface that represents this runtime.

The following table shows the supported combinations for clsid and riid.

clsid

riid

CLSID_CorMetaDataDispenser

IID_IMetaDataDispenser, IID_IMetaDataDispenserEx

CLSID_CorMetaDataDispenserRuntime

IID_IMetaDataDispenser, IID_IMetaDataDispenserEx

CLSID_CorRuntimeHost

IID_CorRuntimeHost

CLSID_CLRRuntimeHost

IID_CLRRuntimeHost (not valid for the common language runtime that is provided by the .NET Framework 4), IID_CLRRuntimeHost3

CLSID_TypeNameFactory

IID_TypeNameFactory

CLSID_CLRStrongName

IID_CLRStrongName

GetRuntimeInterfaceAsIntPtr is similar to the GetRuntimeInterfaceAsObject method.

SecurityCriticalAttribute

requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.

.NET Framework
Available since 4.0
Return to top
Show: