Share via


ModuleMetadata.CreateFromMetadata Method

Definition

Overloads

CreateFromMetadata(IntPtr, Int32)

Create metadata module from a raw memory pointer to metadata directory of a PE image or .cormeta section of an object file. Only manifest modules are currently supported.

CreateFromMetadata(IntPtr, Int32, Action)

Create metadata module from a raw memory pointer to metadata directory of a PE image or .cormeta section of an object file. Only manifest modules are currently supported.

CreateFromMetadata(IntPtr, Int32, IDisposable, Boolean)

Create metadata module from a raw memory pointer to metadata directory of a PE image or .cormeta section of an object file. Only manifest modules are currently supported.

CreateFromMetadata(IntPtr, Int32)

Source:
ModuleMetadata.cs
Source:
ModuleMetadata.cs
Source:
ModuleMetadata.cs
Source:
ModuleMetadata.cs
Source:
ModuleMetadata.cs
Source:
ModuleMetadata.cs
Source:
ModuleMetadata.cs
Source:
ModuleMetadata.cs
Source:
ModuleMetadata.cs
Source:
ModuleMetadata.cs
Source:
ModuleMetadata.cs
Source:
ModuleMetadata.cs
Source:
ModuleMetadata.cs
Source:
ModuleMetadata.cs
Source:
ModuleMetadata.cs
Source:
ModuleMetadata.cs
Source:
ModuleMetadata.cs
Source:
ModuleMetadata.cs
Source:
ModuleMetadata.cs
Source:
ModuleMetadata.cs
Source:
ModuleMetadata.cs
Source:
ModuleMetadata.cs
Source:
ModuleMetadata.cs
Source:
ModuleMetadata.cs

Create metadata module from a raw memory pointer to metadata directory of a PE image or .cormeta section of an object file. Only manifest modules are currently supported.

public:
 static Microsoft::CodeAnalysis::ModuleMetadata ^ CreateFromMetadata(IntPtr metadata, int size);
public static Microsoft.CodeAnalysis.ModuleMetadata CreateFromMetadata (IntPtr metadata, int size);
public static Microsoft.CodeAnalysis.ModuleMetadata CreateFromMetadata (nint metadata, int size);
static member CreateFromMetadata : nativeint * int -> Microsoft.CodeAnalysis.ModuleMetadata
Public Shared Function CreateFromMetadata (metadata As IntPtr, size As Integer) As ModuleMetadata

Parameters

metadata
IntPtr

nint

nativeint

Pointer to the start of metadata block.

size
Int32

The size of the metadata block.

Returns

Exceptions

metadata is null.

size is not positive.

Applies to

CreateFromMetadata(IntPtr, Int32, Action)

Source:
ModuleMetadata.cs
Source:
ModuleMetadata.cs
Source:
ModuleMetadata.cs
Source:
ModuleMetadata.cs
Source:
ModuleMetadata.cs
Source:
ModuleMetadata.cs
Source:
ModuleMetadata.cs

Create metadata module from a raw memory pointer to metadata directory of a PE image or .cormeta section of an object file. Only manifest modules are currently supported.

public static Microsoft.CodeAnalysis.ModuleMetadata CreateFromMetadata (nint metadata, int size, Action onDispose);
public static Microsoft.CodeAnalysis.ModuleMetadata CreateFromMetadata (IntPtr metadata, int size, Action onDispose);
static member CreateFromMetadata : nativeint * int * Action -> Microsoft.CodeAnalysis.ModuleMetadata
Public Shared Function CreateFromMetadata (metadata As IntPtr, size As Integer, onDispose As Action) As ModuleMetadata

Parameters

metadata
IntPtr

nint

nativeint

Pointer to the start of metadata block.

size
Int32

The size of the metadata block.

onDispose
Action

Action to run when the metadata module is disposed. This will only be called then this actual metadata instance is disposed. Any instances created from this using Copy() will not call this when they are disposed.

Returns

Exceptions

onDispose is null.

Applies to

CreateFromMetadata(IntPtr, Int32, IDisposable, Boolean)

Source:
ModuleMetadata.cs

Create metadata module from a raw memory pointer to metadata directory of a PE image or .cormeta section of an object file. Only manifest modules are currently supported.

public static Microsoft.CodeAnalysis.ModuleMetadata CreateFromMetadata (IntPtr metadata, int size, IDisposable owner, bool disposeOwner);
static member CreateFromMetadata : nativeint * int * IDisposable * bool -> Microsoft.CodeAnalysis.ModuleMetadata
Public Shared Function CreateFromMetadata (metadata As IntPtr, size As Integer, owner As IDisposable, disposeOwner As Boolean) As ModuleMetadata

Parameters

metadata
IntPtr

nativeint

Pointer to the start of metadata block.

size
Int32

The size of the metadata block.

owner
IDisposable

Data that should be kept alive as long as this ModuleMetadata is alive. This can be useful, for example, if there is backing memory that the metadata depends on that should be kept rooted so it doesn't get garbage collected.

disposeOwner
Boolean

Whether or not owner should be Dispose()'d when this object is Disposed.

Returns

Exceptions

owner is null.

Applies to