Table of Contents

Class SafeArrayMarshalDescriptor

Namespace
AsmResolver.DotNet.Signatures
Assembly
AsmResolver.DotNet.dll

Represents a description for marshalling a safe array, which is a self-describing array that carries the type, rank, and bounds of the associated array data.

public class SafeArrayMarshalDescriptor : MarshalDescriptor
Inheritance
SafeArrayMarshalDescriptor
Inherited Members

Constructors

SafeArrayMarshalDescriptor(SafeArrayVariantType)

Creates a new instance of the SafeArrayMarshalDescriptor class.

public SafeArrayMarshalDescriptor(SafeArrayVariantType variantType)

Parameters

variantType SafeArrayVariantType

The element type of the safe array.

SafeArrayMarshalDescriptor(SafeArrayVariantType, SafeArrayTypeFlags)

Creates a new instance of the SafeArrayMarshalDescriptor class.

public SafeArrayMarshalDescriptor(SafeArrayVariantType variantType, SafeArrayTypeFlags flags)

Parameters

variantType SafeArrayVariantType

The element type of the safe array.

flags SafeArrayTypeFlags

The flags associated to the element type of the safe array.

SafeArrayMarshalDescriptor(SafeArrayVariantType, SafeArrayTypeFlags, TypeSignature?)

Creates a new instance of the SafeArrayMarshalDescriptor class.

public SafeArrayMarshalDescriptor(SafeArrayVariantType variantType, SafeArrayTypeFlags flags, TypeSignature? subType)

Parameters

variantType SafeArrayVariantType

The element type of the safe array.

flags SafeArrayTypeFlags

The flags associated to the element type of the safe array.

subType TypeSignature

The user defined array element type.

Properties

IsArray

Gets or sets a value indicating whether the type is an array.

public bool IsArray { get; set; }

Property Value

bool

IsByRef

Gets or sets a value indicating whether the type is a by-reference type.

public bool IsByRef { get; set; }

Property Value

bool

IsVector

Gets or sets a value indicating whether the type is a vector.

public bool IsVector { get; set; }

Property Value

bool

NativeType

Gets the native type of the marshal descriptor. This is the byte any descriptor starts with.

public override NativeType NativeType { get; }

Property Value

NativeType

UserDefinedSubType

Gets or sets the user defined element type of the safe array.

public TypeSignature? UserDefinedSubType { get; set; }

Property Value

TypeSignature

Remarks

This value is usually null. Valid .NET assemblies require VariantType to be set to Unknown, Dispatch, or Record.

VariantType

Gets or sets the element type of the safe array.

public SafeArrayVariantType VariantType { get; set; }

Property Value

SafeArrayVariantType

VariantTypeFlags

Gets or sets the flags associated to the element type of the safe array.

public SafeArrayTypeFlags VariantTypeFlags { get; set; }

Property Value

SafeArrayTypeFlags

Methods

FromReader(ModuleDefinition, ref BinaryStreamReader)

Reads a single safe array marshal descriptor from the provided input stream.

public static SafeArrayMarshalDescriptor FromReader(ModuleDefinition parentModule, ref BinaryStreamReader reader)

Parameters

parentModule ModuleDefinition

The module defining the descriptor.

reader BinaryStreamReader

The input stream.

Returns

SafeArrayMarshalDescriptor

The descriptor.

WriteContents(in BlobSerializationContext)

Serializes the blob (without extra data) to an output stream.

protected override void WriteContents(in BlobSerializationContext context)

Parameters

context BlobSerializationContext