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
SafeArrayVariantTypeThe 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
SafeArrayVariantTypeThe element type of the safe array.
flags
SafeArrayTypeFlagsThe 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
SafeArrayVariantTypeThe element type of the safe array.
flags
SafeArrayTypeFlagsThe flags associated to the element type of the safe array.
subType
TypeSignatureThe 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
IsByRef
Gets or sets a value indicating whether the type is a by-reference type.
public bool IsByRef { get; set; }
Property Value
IsVector
Gets or sets a value indicating whether the type is a vector.
public bool IsVector { get; set; }
Property Value
NativeType
Gets the native type of the marshal descriptor. This is the byte any descriptor starts with.
public override NativeType NativeType { get; }
Property Value
UserDefinedSubType
Gets or sets the user defined element type of the safe array.
public TypeSignature? UserDefinedSubType { get; set; }
Property Value
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
VariantTypeFlags
Gets or sets the flags associated to the element type of the safe array.
public SafeArrayTypeFlags VariantTypeFlags { get; set; }
Property Value
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
ModuleDefinitionThe module defining the descriptor.
reader
BinaryStreamReaderThe 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