Share via


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.

Remarks

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

Requirements

Header: CorSym.idl, CorSym.h

See Also

Reference

ISymUnmanagedWriter Interface