Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

System.Runtime.InteropServices

System Library

Author Microsoft
Version 10.0.1
Tags

Public Types

System

The exception that is thrown when a unit of data is read from or written to an address that is not a multiple of the data size. This class cannot be inherited.
The exception that is thrown when a DLL specified in a DLL import cannot be found.

System.​IO

Provides random access to unmanaged blocks of memory from managed code.

System.​Runtime.​CompilerServices

Indicates that the default value for the attributed field or parameter is an instance of <see cref="T:System.Runtime.InteropServices.DispatchWrapper" /> , where the <see cref="P:System.Runtime.InteropServices.DispatchWrapper.WrappedObject" /> is <see langword="null" /> .
Indicates that the default value for the attributed field or parameter is an instance of <see cref="T:System.Runtime.InteropServices.UnknownWrapper" /> , where the <see cref="P:System.Runtime.InteropServices.UnknownWrapper.WrappedObject" /> is <see langword="null" /> . This class cannot be inherited.

System.​Runtime.​InteropServices

Allows an unmanaged method to call a managed method.
Encapsulates an array and an offset within the specified array.
Specifies whether the type should be marshaled using the Automation marshaler or a custom proxy and stub.
Controls whether Unicode characters are converted to the closest matching ANSI characters.
Marshals data of type <see langword="VT_BSTR" /> from managed to unmanaged code. This class cannot be inherited.
Specifies the calling convention required to call methods implemented in unmanaged code.
Indicates the type of class interface to be generated for a class exposed to COM, if an interface is generated at all.
Identifies the type of class interface that is generated for a class.
struct CLong
<see cref="T:System.Runtime.InteropServices.CLong" /> is an immutable value type that represents the <c>long</c> type in C and C++. It is meant to be used as an exchange type at the managed/unmanaged boundary to accurately represent in managed code unmanaged APIs that use the <c>long</c> type. This type has 32-bits of storage on all Windows platforms and 32-bit Unix-based platforms. It has 64-bits of storage on 64-bit Unix platforms.
Specifies the class identifier of a coclass imported from a type library.
An unsafe class that provides a set of methods to access the underlying data representations of collections.
Indicates the COM alias for a parameter or field type.
Permits late-bound registration of an event handler.
Indicates to a COM client that all classes in the current version of an assembly are compatible with classes in an earlier version of the assembly.
Indicates that information was lost about a class or interface when it was imported from a type library to an assembly.
Specifies a default interface to expose to COM. This class cannot be inherited.
Identifies the source interface and the class that implements the methods of the event interface that is generated when a coclass is imported from a COM type library.
Provides methods that enable .NET delegates that handle events to be added and removed from COM objects.
The exception that is thrown when an unrecognized HRESULT is returned from a COM method call.
Indicates that the attributed type was previously defined in COM.
Identifies how to expose an interface to COM.
Describes the type of a COM member.
Specifies the method to call when you register an assembly for use from COM; this enables the execution of user-written code during the registration process.
Identifies a list of interfaces that are exposed as COM event sources for the attributed class.
Specifies the method to call when you unregister an assembly for use from COM; this allows for the execution of user-written code during the unregistration process.
Class for managing wrappers of COM IUnknown types.
Specifies flags for the <see cref="M:System.Runtime.InteropServices.ComWrappers.GetOrCreateComInterfaceForObject(System.Object,System.Runtime.InteropServices.CreateComInterfaceFlags)" /> method.
Specifies flags for <see cref="M:System.Runtime.InteropServices.ComWrappers.CreateObject(System.IntPtr,System.Runtime.InteropServices.CreateObjectFlags,System.Object,System.Runtime.InteropServices.CreatedWrapperFlags@)" /> .
Specifies flags for the <see cref="M:System.Runtime.InteropServices.ComWrappers.GetOrCreateObjectForComInstance(System.IntPtr,System.Runtime.InteropServices.CreateObjectFlags)" /> method.
struct CULong
<see cref="T:System.Runtime.InteropServices.CULong" /> is an immutable value type that represents the <c>unsigned long</c> type in C and C++. It is meant to be used as an exchange type at the managed/unmanaged boundary to accurately represent in managed code unmanaged APIs that use the <c>unsigned long</c> type. This type has 32-bits of storage on all Windows platforms and 32-bit Unix-based platforms. It has 64-bits of storage on 64-bit Unix platforms.
Wraps objects the marshaler should marshal as a <see langword="VT_CY" /> .
Indicates whether the <see cref="M:System.Runtime.InteropServices.Marshal.GetComInterfaceForObject(System.Object,System.Type,System.Runtime.InteropServices.CustomQueryInterfaceMode)" /> method's IUnknown::QueryInterface calls can use the <see cref="T:System.Runtime.InteropServices.ICustomQueryInterface" /> interface.
Provides return values for the <see cref="M:System.Runtime.InteropServices.ICustomQueryInterface.GetInterface(System.Guid@,System.IntPtr@)" /> method.
Specifies the value of the <see cref="T:System.Runtime.InteropServices.CharSet" /> enumeration. This class cannot be inherited.
Specifies the paths that are used to search for DLLs that provide functions for platform invokes.
Sets the default value of a parameter when called from a language that supports default parameters. This class cannot be inherited.
Wraps objects the marshaler should marshal as a <see langword="VT_DISPATCH" /> .
Specifies the COM dispatch identifier (DISPID) of a method, field, or property.
Indicates that the attributed method is exposed by an unmanaged dynamic-link library (DLL) as a static entry point.
Provides a delegate used to resolve native libraries via callback.
Specifies the paths that are used to search for DLLs that provide functions for platform invokes.
Attribute required by any type that is returned by <see cref="M:System.Runtime.InteropServices.IDynamicInterfaceCastable.GetInterfaceImplementation(System.RuntimeTypeHandle)" /> .
Wraps objects the marshaler should marshal as a <see langword="VT_ERROR" /> .
Supplies an explicit <see cref="T:System.Guid" /> when an automatic GUID is undesirable.
Tracks outstanding handles and forces a garbage collection when the specified threshold is reached.
Wraps a managed object holding a handle to a resource that is passed to unmanaged code using platform invoke.
Provides a way for clients to access the actual object, rather than the adapter object handed out by a custom marshaler.
Enables users to write activation code for managed objects that extend <see cref="T:System.MarshalByRefObject" /> .
Provides custom wrappers for handling method calls.
Enables developers to provide a custom, managed implementation of the IUnknown::QueryInterface(REFIID riid, void **ppvObject) method.
Interface used to participate in a type cast failure.
Indicates that the types defined within an assembly were originally defined in a type library.
Indicates whether a managed interface is dual, dispatch-only, or <see langword="IUnknown" /> -only when exposed to COM.
The exception thrown when an invalid COM object is used.
The exception thrown by the marshaler when it encounters an argument of a variant type that can not be marshaled to managed code.
Indicates that a method's unmanaged signature expects a locale identifier (LCID) parameter.
Indicates that a source generator should create a function for marshalling arguments instead of relying on the runtime to generate an equivalent marshalling function at run time.
Provides support for user customization of interop stubs in managed-to-COM interop scenarios.
class Marshal
Provides a collection of methods for allocating unmanaged memory, copying unmanaged memory blocks, and converting managed to unmanaged types, as well as other miscellaneous methods used when interacting with unmanaged code.
Indicates how to marshal the data between managed and unmanaged code.
The exception that is thrown by the marshaler when it encounters a <see cref="T:System.Runtime.InteropServices.MarshalAsAttribute" /> it does not support.
Provides APIs for managing native libraries.
This class contains methods that are mainly used to manage native memory.
struct NFloat
<see cref="T:System.Runtime.InteropServices.NFloat" /> is an immutable value type that represents a floating type that has the same size as the native integer size. It is meant to be used as an exchange type at the managed/unmanaged boundary to accurately represent in managed code unmanaged APIs that use a type alias for C or C++'s <c>float</c> on 32-bit platforms or <c>double</c> on 64-bit platforms, such as the CGFloat type in libraries provided by Apple.
Indicates that a parameter is optional.
Specifies a POSIX signal number.
Provides data for a <see cref="T:System.Runtime.InteropServices.PosixSignalRegistration" /> event.
Handles a <see cref="T:System.Runtime.InteropServices.PosixSignal" /> .
Indicates that the HRESULT signature transformation that takes place during COM interop calls should be suppressed.
Indicates that the attributed assembly is a primary interop assembly.
Allows the user to specify the ProgID of a class.
Provides a collection of <see langword="static" /> methods that return information about the common language runtime environment.
The exception thrown when the rank of an incoming <see langword="SAFEARRAY" /> does not match the rank specified in the managed signature.
The exception thrown when the type of the incoming <see langword="SAFEARRAY" /> does not match the type specified in the managed signature.
Represents structured exception handling (SEH) errors.
Replaces the standard common language runtime (CLR) free-threaded marshaler with the standard OLE STA marshaler.
Specifies how strings should be marshalled for generated p/invokes
Provides support for type equivalence.
Contains the <see cref="T:System.Runtime.InteropServices.FUNCFLAGS" /> that were originally imported for this method from the COM type library.
Describes the original settings of the <see langword="FUNCFLAGS" /> in the COM type library from where this method was imported.
Specifies which <see cref="T:System.Type" /> exclusively uses an interface. This class cannot be inherited.
Contains the <see cref="T:System.Runtime.InteropServices.TYPEFLAGS" /> that were originally imported for this type from the COM type library.
Describes the original settings of the <see cref="T:System.Runtime.InteropServices.TYPEFLAGS" /> in the COM type library from which the type was imported.
Contains the <see cref="T:System.Runtime.InteropServices.VARFLAGS" /> that were originally imported for this field from the COM type library.
Describes the original settings of the <see cref="T:System.Runtime.InteropServices.VARFLAGS" /> in the COM type library from which the variable was imported.
Specifies the version number of an exported type library.
Represents an attribute that declares that an assembly should be inspected during type map building.
Represents an attribute that creates a type association between a type and its proxy.
Represents an attribute that defines type mapping between a string and a type.
Represents an entry type for interop type-mapping logic.
Wraps objects the marshaler should marshal as a <see langword="VT_UNKNOWN" /> .
Specifies the calling convention required to call P/Invoke methods implemented in unmanaged code.
Any method marked with <see cref="T:System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute" /> can be directly called from native code. The function token can be loaded to a local variable using the address-of operator in C# and passed as a callback to a native method.
Controls the marshaling behavior of a delegate signature passed as an unmanaged function pointer to or from unmanaged code. This class cannot be inherited.
Indicates how to marshal the array elements when an array is marshaled from managed to unmanaged code as a <see cref="F:System.Runtime.InteropServices.UnmanagedType.SafeArray" /> .
Marshals data of type <see langword="VT_VARIANT | VT_BYREF" /> from managed to unmanaged code. This class cannot be inherited.
Specifies that the P/Invoke marked with this attribute should be linked in as a WASM import.

System.​Runtime.​InteropServices.​ComTypes

enum ADVF
Specifies the requested behavior when setting up an advise sink or a caching connection with an object.
Stores the parameters that are used during a moniker binding operation.
struct BINDPTR
Contains a pointer to a bound-to <see cref="T:System.Runtime.InteropServices.FUNCDESC" /> structure, <see cref="T:System.Runtime.InteropServices.VARDESC" /> structure, or an <see langword="ITypeComp" /> interface.
Identifies the calling convention used by a method described in a METHODDATA structure.
Describes a connection that exists to a given connection point.
Specifies the direction of the data flow in the <paramref name="dwDirection" /> parameter of the <see cref="M:System.Runtime.InteropServices.ComTypes.IDataObject.EnumFormatEtc(System.Runtime.InteropServices.ComTypes.DATADIR)" /> method. This determines the formats that the resulting enumerator can enumerate.
Identifies the type description being bound to.
Contains the arguments passed to a method or property by <see langword="IDispatch::Invoke" /> .
Specifies the desired data or view aspect of the object when drawing or getting data.
struct ELEMDESC
Contains the type description and process transfer information for a variable, function, or a function parameter.
Describes the exceptions that occur during <see langword="IDispatch::Invoke" /> .
struct FILETIME
Represents the number of 100-nanosecond intervals since January 1, 1601. This structure is a 64-bit value.
Represents a generalized Clipboard format.
struct FUNCDESC
Defines a function description.
Identifies the constants that define the properties of a function.
Defines how to access a function.
Provides a managed definition of the <see langword="IAdviseSink" /> interface.
struct IBindCtx
Provides the managed definition of the <see langword="IBindCtx" /> interface.
Provides the managed definition of the <see langword="IConnectionPoint" /> interface.
Provides the managed definition of the <see langword="IConnectionPointContainer" /> interface.
Provides the managed definition of the <see langword="IDataObject" /> interface.
struct IDLDESC
Contains information needed for transferring a structure element, parameter, or function return value between processes.
Describes how to transfer a structure element, parameter, or function return value between processes.
Manages the definition of the <see langword="IEnumConnectionPoints" /> interface.
Manages the definition of the <see langword="IEnumConnections" /> interface.
Provides the managed definition of the <see langword="IEnumFORMATETC" /> interface.
Manages the definition of the <see langword="IEnumMoniker" /> interface.
Provides the managed definition of the <see langword="IEnumSTATDATA" /> interface.
Manages the definition of the <see langword="IEnumString" /> interface.
Manages the definition of the <see langword="IEnumVARIANT" /> interface.
struct IMoniker
Provides the managed definition of the <see langword="IMoniker" /> interface, with COM functionality from <see langword="IPersist" /> and <see langword="IPersistStream" /> .
Defines the attributes of an implemented or inherited interface of a type.
Specifies how to invoke a function by <see langword="IDispatch::Invoke" /> .
Provides the managed definition of the <see langword="IPersistFile" /> interface, with functionality from <see langword="IPersist" /> .
Provides the managed definition of the <see langword="IRunningObjectTable" /> interface.
struct IStream
Provides the managed definition of the <see langword="IStream" /> interface, with <see langword="ISequentialStream" /> functionality.
Provides the managed definition of the <see langword="ITypeComp" /> interface.
Provides the managed definition of the Component Automation ITypeInfo interface.
Provides the managed definition of the <see langword="ITypeInfo2" /> interface.
struct ITypeLib
Provides the managed definition of the <see langword="ITypeLib" /> interface.
Provides a managed definition of the <see langword="ITypeLib2" /> interface.
Defines flags that apply to type libraries.
Contains information about how to transfer a structure element, parameter, or function return value between processes.
Describes how to transfer a structure element, parameter, or function return value between processes.
struct STATDATA
Provides the managed definition of the <see langword="STATDATA" /> structure.
struct STATSTG
Contains statistical information about an open storage, stream, or byte-array object.
Provides the managed definition of the <see langword="STGMEDIUM" /> structure.
Identifies the target operating system platform.
enum TYMED
Provides the managed definition of the <see langword="TYMED" /> structure.
struct TYPEATTR
Contains attributes of a <see langword="UCOMITypeInfo" /> .
struct TYPEDESC
Describes the type of a variable, return type of a function, or the type of a function parameter.
Defines the properties and attributes of a type description.
Specifies various types of data and functions.
Identifies a particular type library and provides localization support for member names.
struct VARDESC
Describes a variable, constant, or data member.
Identifies the constants that define the properties of a variable.
Defines the kind of variable.

System.​Runtime.​InteropServices.​Java

System.​Runtime.​InteropServices.​Marshalling

Marshaller for ANSI strings.
Represents a marshaller for arrays.
Marshaller for BSTR strings.
Indicates that a type's instances should be exposed to COM.
Marshals a COM interface using a <see cref="T:System.Runtime.InteropServices.Marshalling.StrategyBasedComWrappers" /> instance.
Options for how to generate COM interface interop with the COM interop source generator.
Base class for all COM source-generated runtime callable wrappers (RCWs).
A type that represents an OLE VARIANT in managed code.
Marshals an <see cref="T:System.Object" /> to an <see cref="T:System.Runtime.InteropServices.Marshalling.ComVariant" /> .
Converts the exception to the default value of the specified unmanaged type.
Marshals an exception object to the value of its <see cref="P:System.Exception.HResult" /> converted to <typeparamref name="T" /> .
Converts all exceptions to <see cref="P:System.Numerics.IFloatingPointIeee754`1.NaN" /> .
Represents a marshaller that swallows exceptions.
Specifies that the attributed type will be exposed to COM through source-generated COM and that the source generator should generate code for it.
Specifies that the attributed type is a COM interface and that the source generator should generate code for it.
Defines type-level information for managed class types exposed to COM.
Defines details about a managed class type exposed to COM.
Defines an unmanaged virtual method table look up strategy.
Provides details for the IUnknown-derived interface.
Defines a strategy for acquiring interface details.
Defines type-level information for an IUnknown-derived interface.
Defines the IUnknown interaction strategy.
Indicates that an interface is a managed representation of an IUnknown-derived interface.
Provides information about a virtual method table for a managed interface to enable invoking methods in the virtual method table.
Attribute used to provide a custom marshaller type or size information for marshalling.
Represents a marshaller for an array of pointers.
A <see cref="T:System.Runtime.InteropServices.ComWrappers" /> -based type that uses customizable strategy objects to implement COM object wrappers and managed object wrappers exposed to COM.
Marshals COM interfaces using a StrategyBasedComWrappers instance that only creates unique native object wrappers (RCWs).
A marshaller for UTF-16 strings.
A marshaller for UTF-8 strings.
Provides information about a virtual method table and the unmanaged instance pointer.

System.​Runtime.​InteropServices.​ObjectiveC

API to enable Objective-C marshalling.
Attribute used to indicate a class represents a tracked Objective-C type.

System.​Security

Represents text that should be kept confidential, such as by deleting it from computer memory when no longer needed. This class cannot be inherited.
Provides a collection of methods for allocating unmanaged memory and copying unmanaged memory blocks.