Table of Contents

Class CustomMarshalDescriptor

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

Represents a description for a marshaller that marshals a value using a custom marshaller type.

public class CustomMarshalDescriptor : MarshalDescriptor
Inheritance
CustomMarshalDescriptor
Inherited Members

Constructors

CustomMarshalDescriptor(string?, Utf8String?, TypeSignature?, Utf8String?)

Creates a new instance of the CustomMarshalDescriptor class.

public CustomMarshalDescriptor(string? guid, Utf8String? nativeTypeName, TypeSignature? marshalType, Utf8String? cookie)

Parameters

guid string
nativeTypeName Utf8String
marshalType TypeSignature
cookie Utf8String

Properties

Gets or sets an additional value to be passed onto the custom marshaller.

public Utf8String? Cookie { get; set; }

Property Value

Utf8String

Guid

Gets or sets the unique identifier of the type library that contains the marshaller.

public string? Guid { get; set; }

Property Value

string

Remarks

This field is ignored by the CLR.

MarshalType

Gets or sets the type used to marshal the value.

public TypeSignature? MarshalType { get; set; }

Property Value

TypeSignature

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

NativeTypeName

Gets or sets the name of the native type of the marshaller.

public Utf8String? NativeTypeName { get; set; }

Property Value

Utf8String

Remarks

This field is ignored by the CLR.

Methods

FromReader(ModuleDefinition, ref BinaryStreamReader)

Reads a single custom marshal descriptor from the provided input stream.

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

Parameters

parentModule ModuleDefinition

The module defining the descriptor.

reader BinaryStreamReader

The input stream.

Returns

CustomMarshalDescriptor

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