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
class
DataMisalignedException
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.
class
DllNotFoundException
The exception that is thrown when a DLL specified in a DLL import cannot be found.
System.​IO
class
UnmanagedMemoryAccessor
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.
struct
ArrayWithOffset
Encapsulates an array and an offset within the specified array.
class
AutomationProxyAttribute
Specifies whether the type should be marshaled using the Automation marshaler or a custom proxy and stub.
class
BestFitMappingAttribute
Controls whether Unicode characters are converted to the closest matching ANSI characters.
class
BStrWrapper
Marshals data of type <see langword="VT_BSTR" /> from managed to unmanaged code. This class cannot be inherited.
enum
CallingConvention
Specifies the calling convention required to call methods implemented in unmanaged code.
class
ClassInterfaceAttribute
Indicates the type of class interface to be generated for a class exposed to COM, if an interface is generated at all.
enum
ClassInterfaceType
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.
class
CoClassAttribute
Specifies the class identifier of a coclass imported from a type library.
class
CollectionsMarshal
An unsafe class that provides a set of methods to access the underlying data representations of collections.
class
ComAliasNameAttribute
Indicates the COM alias for a parameter or field type.
class
ComAwareEventInfo
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.
class
ComEventsHelper
Provides methods that enable .NET delegates that handle events to be added and removed from COM objects.
class
COMException
The exception that is thrown when an unrecognized HRESULT is returned from a COM method call.
class
ComImportAttribute
Indicates that the attributed type was previously defined in COM.
enum
ComInterfaceType
Identifies how to expose an interface to COM.
enum
ComMemberType
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
ComWrappers
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.
enum
CreatedWrapperFlags
Specifies flags for <see cref="M:System.Runtime.InteropServices.ComWrappers.CreateObject(System.IntPtr,System.Runtime.InteropServices.CreateObjectFlags,System.Object,System.Runtime.InteropServices.CreatedWrapperFlags@)" /> .
enum
CreateObjectFlags
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.
class
CurrencyWrapper
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.
class
DefaultCharSetAttribute
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.
class
DispatchWrapper
Wraps objects the marshaler should marshal as a <see langword="VT_DISPATCH" /> .
class
DispIdAttribute
Specifies the COM dispatch identifier (DISPID) of a method, field, or property.
class
DllImportAttribute
Indicates that the attributed method is exposed by an unmanaged dynamic-link library (DLL) as a static entry point.
class
DllImportResolver
Provides a delegate used to resolve native libraries via callback.
enum
DllImportSearchPath
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)" /> .
class
ErrorWrapper
Wraps objects the marshaler should marshal as a <see langword="VT_ERROR" /> .
class
GuidAttribute
Supplies an explicit <see cref="T:System.Guid" /> when an automatic GUID is undesirable.
class
HandleCollector
Tracks outstanding handles and forces a garbage collection when the specified threshold is reached.
struct
HandleRef
Wraps a managed object holding a handle to a resource that is passed to unmanaged code using platform invoke.
struct
ICustomAdapter
Provides a way for clients to access the actual object, rather than the adapter object handed out by a custom marshaler.
struct
ICustomFactory
Enables users to write activation code for managed objects that extend <see cref="T:System.MarshalByRefObject" /> .
struct
ICustomMarshaler
Provides custom wrappers for handling method calls.
struct
ICustomQueryInterface
Enables developers to provide a custom, managed implementation of the IUnknown::QueryInterface(REFIID riid, void **ppvObject) method.
struct
IDynamicInterfaceCastable
Interface used to participate in a type cast failure.
Indicates that the types defined within an assembly were originally defined in a type library.
class
InterfaceTypeAttribute
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.
class
LCIDConversionAttribute
Indicates that a method's unmanaged signature expects a locale identifier (LCID) parameter.
class
LibraryImportAttribute
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.
class
MarshalAsAttribute
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.
class
NativeLibrary
Provides APIs for managing native libraries.
class
NativeMemory
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.
class
OptionalAttribute
Indicates that a parameter is optional.
enum
PosixSignal
Specifies a POSIX signal number.
class
PosixSignalContext
Provides data for a <see cref="T:System.Runtime.InteropServices.PosixSignalRegistration" /> event.
class
PosixSignalRegistration
Handles a <see cref="T:System.Runtime.InteropServices.PosixSignal" /> .
class
PreserveSigAttribute
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.
class
ProgIdAttribute
Allows the user to specify the ProgID of a class.
class
RuntimeEnvironment
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.
class
SEHException
Represents structured exception handling (SEH) errors.
class
StandardOleMarshalObject
Replaces the standard common language runtime (CLR) free-threaded marshaler with the standard OLE STA marshaler.
enum
StringMarshalling
Specifies how strings should be marshalled for generated p/invokes
class
TypeIdentifierAttribute
Provides support for type equivalence.
class
TypeLibFuncAttribute
Contains the <see cref="T:System.Runtime.InteropServices.FUNCFLAGS" /> that were originally imported for this method from the COM type library.
enum
TypeLibFuncFlags
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.
class
TypeLibTypeAttribute
Contains the <see cref="T:System.Runtime.InteropServices.TYPEFLAGS" /> that were originally imported for this type from the COM type library.
enum
TypeLibTypeFlags
Describes the original settings of the <see cref="T:System.Runtime.InteropServices.TYPEFLAGS" /> in the COM type library from which the type was imported.
class
TypeLibVarAttribute
Contains the <see cref="T:System.Runtime.InteropServices.VARFLAGS" /> that were originally imported for this field from the COM type library.
enum
TypeLibVarFlags
Describes the original settings of the <see cref="T:System.Runtime.InteropServices.VARFLAGS" /> in the COM type library from which the variable was imported.
class
TypeLibVersionAttribute
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.
class
TypeMapAttribute`1
Represents an attribute that defines type mapping between a string and a type.
class
TypeMapping
Represents an entry type for interop type-mapping logic.
class
UnknownWrapper
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.
enum
VarEnum
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" /> .
class
VariantWrapper
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.
struct
BIND_OPTS
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.
enum
CALLCONV
Identifies the calling convention used by a method described in a METHODDATA structure.
struct
CONNECTDATA
Describes a connection that exists to a given connection point.
enum
DATADIR
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.
enum
DESCKIND
Identifies the type description being bound to.
struct
DISPPARAMS
Contains the arguments passed to a method or property by <see langword="IDispatch::Invoke" /> .
enum
DVASPECT
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.
struct
EXCEPINFO
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.
struct
FORMATETC
Represents a generalized Clipboard format.
struct
FUNCDESC
Defines a function description.
enum
FUNCFLAGS
Identifies the constants that define the properties of a function.
enum
FUNCKIND
Defines how to access a function.
struct
IAdviseSink
Provides a managed definition of the <see langword="IAdviseSink" /> interface.
struct
IBindCtx
Provides the managed definition of the <see langword="IBindCtx" /> interface.
struct
IConnectionPoint
Provides the managed definition of the <see langword="IConnectionPoint" /> interface.
struct
IConnectionPointContainer
Provides the managed definition of the <see langword="IConnectionPointContainer" /> interface.
struct
IDataObject
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.
enum
IDLFLAG
Describes how to transfer a structure element, parameter, or function return value between processes.
struct
IEnumConnectionPoints
Manages the definition of the <see langword="IEnumConnectionPoints" /> interface.
struct
IEnumConnections
Manages the definition of the <see langword="IEnumConnections" /> interface.
struct
IEnumFORMATETC
Provides the managed definition of the <see langword="IEnumFORMATETC" /> interface.
struct
IEnumMoniker
Manages the definition of the <see langword="IEnumMoniker" /> interface.
struct
IEnumSTATDATA
Provides the managed definition of the <see langword="IEnumSTATDATA" /> interface.
struct
IEnumString
Manages the definition of the <see langword="IEnumString" /> interface.
struct
IEnumVARIANT
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" /> .
enum
IMPLTYPEFLAGS
Defines the attributes of an implemented or inherited interface of a type.
enum
INVOKEKIND
Specifies how to invoke a function by <see langword="IDispatch::Invoke" /> .
struct
IPersistFile
Provides the managed definition of the <see langword="IPersistFile" /> interface, with functionality from <see langword="IPersist" /> .
struct
IRunningObjectTable
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.
struct
ITypeComp
Provides the managed definition of the <see langword="ITypeComp" /> interface.
struct
ITypeInfo
Provides the managed definition of the Component Automation ITypeInfo interface.
struct
ITypeInfo2
Provides the managed definition of the <see langword="ITypeInfo2" /> interface.
struct
ITypeLib
Provides the managed definition of the <see langword="ITypeLib" /> interface.
struct
ITypeLib2
Provides a managed definition of the <see langword="ITypeLib2" /> interface.
enum
LIBFLAGS
Defines flags that apply to type libraries.
struct
PARAMDESC
Contains information about how to transfer a structure element, parameter, or function return value between processes.
enum
PARAMFLAG
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.
struct
STGMEDIUM
Provides the managed definition of the <see langword="STGMEDIUM" /> structure.
enum
SYSKIND
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.
enum
TYPEFLAGS
Defines the properties and attributes of a type description.
enum
TYPEKIND
Specifies various types of data and functions.
struct
TYPELIBATTR
Identifies a particular type library and provides localization support for member names.
struct
VARDESC
Describes a variable, constant, or data member.
enum
VARFLAGS
Identifies the constants that define the properties of a variable.
enum
VARKIND
Defines the kind of variable.
System.​Runtime.​InteropServices.​Java
struct
ComponentCrossReference
class
JavaMarshal
struct
MarkCrossReferencesArgs
struct
StronglyConnectedComponent
System.​Runtime.​InteropServices.​Marshalling
class
AnsiStringMarshaller
Marshaller for ANSI strings.
class
ArrayMarshaller`2
Represents a marshaller for arrays.
class
BStrStringMarshaller
Marshaller for BSTR strings.
Indicates that a type's instances should be exposed to COM.
class
ComInterfaceMarshaller`1
Marshals a COM interface using a <see cref="T:System.Runtime.InteropServices.Marshalling.StrategyBasedComWrappers" /> instance.
enum
ComInterfaceOptions
Options for how to generate COM interface interop with the COM interop source generator.
class
ComObject
Base class for all COM source-generated runtime callable wrappers (RCWs).
struct
ComVariant
A type that represents an OLE VARIANT in managed code.
class
ComVariantMarshaller
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.
struct
IComExposedClass
Defines type-level information for managed class types exposed to COM.
struct
IComExposedDetails
Defines details about a managed class type exposed to COM.
struct
IIUnknownCacheStrategy
Defines an unmanaged virtual method table look up strategy.
struct
IIUnknownDerivedDetails
Provides details for the IUnknown-derived interface.
Defines a strategy for acquiring interface details.
struct
IIUnknownInterfaceType
Defines type-level information for an IUnknown-derived interface.
struct
IIUnknownStrategy
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.
class
MarshalUsingAttribute
Attribute used to provide a custom marshaller type or size information for marshalling.
class
PointerArrayMarshaller`2
Represents a marshaller for an array of pointers.
class
StrategyBasedComWrappers
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).
class
Utf16StringMarshaller
A marshaller for UTF-16 strings.
class
Utf8StringMarshaller
A marshaller for UTF-8 strings.
struct
VirtualMethodTableInfo
Provides information about a virtual method table and the unmanaged instance pointer.
System.​Runtime.​InteropServices.​ObjectiveC
class
ObjectiveCMarshal
API to enable Objective-C marshalling.
Attribute used to indicate a class represents a tracked Objective-C type.
System.​Security
class
SecureString
Represents text that should be kept confidential, such as by deleting it from computer memory when no longer needed. This class cannot be inherited.
class
SecureStringMarshal
Provides a collection of methods for allocating unmanaged memory and copying unmanaged memory blocks.