Bewerken

Share via


MetadataBuilder.AddFieldRelativeVirtualAddress Method

Definition

Adds a mapping from a field to its initial value stored in the PE image.

public:
 void AddFieldRelativeVirtualAddress(System::Reflection::Metadata::FieldDefinitionHandle field, int offset);
public void AddFieldRelativeVirtualAddress (System.Reflection.Metadata.FieldDefinitionHandle field, int offset);
member this.AddFieldRelativeVirtualAddress : System.Reflection.Metadata.FieldDefinitionHandle * int -> unit
Public Sub AddFieldRelativeVirtualAddress (field As FieldDefinitionHandle, offset As Integer)

Parameters

field
FieldDefinitionHandle

The field definition handle.

offset
Int32

The offset within the block in the PE image that stores initial values of mapped fields (usually in the .text section).

Exceptions

offset is negative.

Remarks

Entries must be added in the same order as the corresponding field definitions.

The final relative virtual address stored in the metadata is calculated when the metadata is serialized by adding the offset to the virtual address of the block start.

Applies to