Debugging Tools for Windows

SetCurrentProcessId

The SetCurrentProcessId method makes the specified process the current process.

HRESULT
  IDebugSystemObjects::SetCurrentProcessId(
    IN ULONG  Id
    );

Parameters

Id
Specifies the engine process ID for the process that is to become the current process.

Return Value

S_OK
The method was successful.
E_NOINTERFACE
No process with the given process ID was found.
E_FAIL
No suitable candidate for the current thread could be found in the process.

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

Interface Version

SetCurrentProcessId is available in all versions of IDebugSystemObjects.

Comments

This method also changes the current thread, and may change the current target and current computer.

If the process is changed, the callback IDebugEventCallbacks::ChangeEngineState will be called with the DEBUG_CES_CURRENT_THREAD bit set.

Note  In kernel-mode debugging, the current process is a virtual process, it is not a system process. This method cannot be used to change between system processes in kernel-mode debugging. However, the implicit process may be changed by using SetImplicitProcessDataOffset.

For more information about processes, see Threads and Processes. For details on monitoring events, see Monitoring Events.

Requirements

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

Build machine: CAPEBUILD