Debugging Tools for Windows

SetImplicitThreadDataOffset

The SetImplicitThreadDataOffset method sets the implicit thread for the current process.

HRESULT
  IDebugSystemObjects2::SetImplicitThreadDataOffset(
    IN ULONG64  Offset
    );

Parameters

Offset
Specifies the location in the target's memory address space of the data structure of the system thread that is to become the implicit thread for the current process. If this is zero, the implicit thread for the current process is set to the default implicit thread.

Return Value

S_OK
The method was successful.

This method may also return error values. See Return Values for more details.

Interface Version

SetImplicitThreadDataOffset is available in IDebugSystemObjects2 and later versions.

Comments

In kernel-mode debugging, the data structure is the KTHREAD structure for the process.

In user-mode debugging, the data structure is the thread environment block (TEB) for the process.

Caution  Because it is possible to use SetImplicitProcessDataOffset to set the implicit process independently of the implicit thread, the implicit thread might not belong to the implicit process. This can cause errors if you attempt to access any of the user state for the implicit thread, because it will be incompatible with the virtual address space (specified by the implicit process).

For more information about the current implicit thread, see Threads and Processes. For details on the KTHREAD structure and TEB, see Microsoft Windows Internals by David Solomon and Mark Russinovich.

Requirements

Headers: Defined in Dbgeng.h. Include Dbgeng.h.

Build machine: CAPEBUILD