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

The unique identifier of the type library that contains the marshaller.

nativeTypeName Utf8String

The name of the native type of the marshaller.

marshalType TypeSignature

The type used to marshal the value.

cookie Utf8String

An additional value to be passed onto the custom marshaller.

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

Creates a new instance of the CustomMarshalDescriptor class.

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

Parameters

guid string

The unique identifier of the type library that contains the marshaller.

nativeTypeName Utf8String

The name of the native type of the marshaller.

marshalTypeName Utf8String

The name of the marshal type.

marshalType TypeSignature

The type used to marshal the value.

cookie Utf8String

An additional value to be passed onto the custom marshaller.

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

Creates a new instance of the CustomMarshalDescriptor class.

public CustomMarshalDescriptor(string? guid, Utf8String? nativeTypeName, Utf8String? marshalTypeName, Utf8String? cookie)

Parameters

guid string

The unique identifier of the type library that contains the marshaller.

nativeTypeName Utf8String

The name of the native type of the marshaller.

marshalTypeName Utf8String

The name of the marshal type.

cookie Utf8String

An additional value to be passed onto the custom marshaller.

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

Remarks

This value supersedes MarshalTypeName when set to a non-null value.

MarshalTypeName

Gets or sets the name of the type used to marshal the value.

public Utf8String? MarshalTypeName { get; set; }

Property Value

Utf8String

Remarks

This value is ignored by the builder when MarshalType is not null.

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