NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

ISymbolWriter.DefineLocalVariable

Defines a single parameter in the current method. The type of each parameter is taken from its position (sequence) within the method's signature.

Defines a single variable in the current lexical scope.

[Visual Basic]
Sub DefineLocalVariable( _
   ByVal name As String, _
   ByVal attributes As FieldAttributes, _
   ByVal signature() As Byte, _
   ByVal addrKind As SymAddressKind, _
   ByVal addr1 As Integer, _
   ByVal addr2 As Integer, _
   ByVal addr3 As Integer, _
   ByVal startOffset As Integer, _
   ByVal endOffset As Integer _
)
[C#]
void DefineLocalVariable(
   string name,
   FieldAttributes attributes,
   byte[] signature,
   SymAddressKind addrKind,
   int addr1,
   int addr2,
   int addr3,
   int startOffset,
   int endOffset
);
[C++]
void DefineLocalVariable(
   String* name,
   FieldAttributes attributes,
   unsigned char* signature[],
   SymAddressKind addrKind,
   int addr1,
   int addr2,
   int addr3,
   int startOffset,
   int endOffset
) = 0;
[JScript]
function DefineLocalVariable(
   name : String,
   attributes : FieldAttributes,
   signature : Byte[],
   addrKind : SymAddressKind,
   addr1 : int,
   addr2 : int,
   addr3 : int,
   startOffset : int,
   endOffset : int
);

Parameters

name
The local variable name.
attributes
The local variable attributes specified using the FieldAttributes enum.
signature
The local variable signature.
addrKind
The address types for addr1, addr2, and addr3 using SymAddressKind.
addr1
The first address for the local variable specification.
addr2
The second address for the local variable specification.
addr3
The third address for the local variable specification.
startOffset
If zero, it is ignored and the variable is defined over the entire scope. If non-zero, it must fall with the extent (offsets) of the current scope.
endOffset
If zero, it is ignored and the variable is defined over the entire scope. If non-zero, it must fall with the extent (offsets) of the current scope.

Remarks

The startOffset and endOffset parameters are optional. If their value is 0, they are ignored and the variable is defined over the entire scope. If their value is non-zero, they must fall within the offsets of the current scope.

This can be called multiple times for a variable of the same name that has multiple homes throughout a scope. (Note: Start and end offsets must not overlap in such a case.)

If parameters were defined in the metadata for a specified method, you would not have to define them again with calls to this method. The symbol readers will have to be smart enough to check the normal metadata for these first, and then fall back to the symbol store.

See Also

ISymbolWriter Interface | ISymbolWriter Members | System.Diagnostics.SymbolStore Namespace