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
guidstringnativeTypeNameUtf8StringmarshalTypeTypeSignaturecookieUtf8String
Properties
Cookie
Gets or sets an additional value to be passed onto the custom marshaller.
public Utf8String? Cookie { get; set; }
Property Value
Guid
Gets or sets the unique identifier of the type library that contains the marshaller.
public string? Guid { get; set; }
Property Value
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
NativeType
Gets the native type of the marshal descriptor. This is the byte any descriptor starts with.
public override NativeType NativeType { get; }
Property Value
NativeTypeName
Gets or sets the name of the native type of the marshaller.
public Utf8String? NativeTypeName { get; set; }
Property Value
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
parentModuleModuleDefinitionThe module defining the descriptor.
readerBinaryStreamReaderThe 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
contextBlobSerializationContext