ISymUnmanagedWriter::OpenScope Method

Opens a new lexical scope in the current method. The scope becomes the new current scope and is pushed onto a stack of scopes. Scopes must form a hierarchy. Siblings are not allowed to overlap.

HRESULT OpenScope(
    [in] ULONG32 startOffset,
    [out, retval] ULONG32* pRetVal);

Parameters

  • startOffset
    [in] The offset of the first instruction in the lexical scope, in bytes, from the beginning of the method.
  • pRetVal
    [out] A pointer to a ULONG32 that receives the scope identifier.

Return Value

S_OK if the method succeeds; otherwise, E_FAIL or some other error code.

Requirements

Header: CorSym.idl

Remarks

ISymUnmanagedWriter::OpenScope Method returns an opaque scope identifier that can be used with ISymUnmanagedWriter::SetScopeRange Method to define a scope's starting and ending offset at a later time. In this case, the offsets passed to ISymUnmanagedWriter::OpenScope Method and ISymUnmanagedWriter::CloseScope Method are ignored. Scope identifiers are valid only in the current method.

See Also

Reference

ISymUnmanagedWriter Interface