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
guidstringThe unique identifier of the type library that contains the marshaller.
nativeTypeNameUtf8StringThe name of the native type of the marshaller.
marshalTypeTypeSignatureThe type used to marshal the value.
cookieUtf8StringAn 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
guidstringThe unique identifier of the type library that contains the marshaller.
nativeTypeNameUtf8StringThe name of the native type of the marshaller.
marshalTypeNameUtf8StringThe name of the marshal type.
marshalTypeTypeSignatureThe type used to marshal the value.
cookieUtf8StringAn 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
guidstringThe unique identifier of the type library that contains the marshaller.
nativeTypeNameUtf8StringThe name of the native type of the marshaller.
marshalTypeNameUtf8StringThe name of the marshal type.
cookieUtf8StringAn additional value to be passed onto the custom marshaller.
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
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
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
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