ICorDebugRegisterSet::GetThreadContext Method

Gets the context of the current thread.

Syntax

HRESULT GetThreadContext(
    [in] ULONG32 contextSize,
    [in, out, length_is(contextSize),
        size_is(contextSize)] BYTE context[]
);

Parameters

contextSize [in] The size, in bytes, of the context array.

context [in, out] An array of bytes that compose the Win32 CONTEXT structure for the current platform.

Remarks

The debugger should call this function instead of the Win32 GetThreadContext function, because the thread may be in a "hijacked" state where its context has been temporarily changed. The data returned is a Win32 CONTEXT structure for the current platform.

For non-leaf frames, clients should check which registers are valid by using ICorDebugRegisterSet::GetRegistersAvailable.

Requirements

Platforms: See System Requirements.

Header: CorDebug.idl, CorDebug.h

Library: CorGuids.lib

.NET Framework Versions: Available since 1.0

See also