IDebugClient::AttachProcess method

The AttachProcess method connects the debugger engine to a user-modeprocess.

Syntax


HRESULT AttachProcess(
  [in] ULONG64 Server,
  [in] ULONG   ProcessId,
  [in] ULONG   AttachFlags
);

Parameters

Server [in]

Specifies the process server to use to attach to the process. If Server is zero, the engine will connect to a local process without using a process server.

ProcessId [in]

Specifies the process ID of the target process the debugger will attach to.

AttachFlags [in]

Specifies the flags that control how the debugger attaches to the target process. For details on these flags, see DEBUG_ATTACH_XXX.

Return value

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

Return codeDescription
S_OK

The method was successful.

 

Remarks

This method is available only for live user-mode debugging.

Note   The engine doesn't completely attach to the process until the WaitForEvent method has been called. Only after the process has generated an event -- for example, the create-process event -- does it become available in the debugger session.
 

For more information about creating and attaching to live user-mode targets, see Live User-Mode Targets.

Requirements

Target platform

Header

Dbgeng.h (include Dbgeng.h)

See also

IDebugClient
IDebugClient2
IDebugClient3
IDebugClient4
IDebugClient5
.attach (Attach to Process)
ConnectProcessServer
CreateProcess2
CreateProcessAndAttach2
GetRunningProcessSystemIds
GetRunningProcessDescription
DetachCurrentProcess
TerminateCurrentProcess
AbandonCurrentProcess

 

 

Send comments about this topic to Microsoft

Show: