Share via


IDkmStartDebuggingOperations.AttachToProcess(DkmProcessAttachRequest) Method

Definition

Causes the debug monitor to attach to the process. Before this method returns, the debug monitor must start an event thread (or reuse an existing event thread) and create the DkmProcess object on the event thread. Creating the DkmProcess object will send a process create event.

Note that this method may only be called in response to the Visual Studio debugger package requesting an attach. Components that wish to attach to another process should send a custom event to a visual studio package. From a package, an attach can be requested through the IVsDebugger.LaunchDebugTargets API.

public:
 Microsoft::VisualStudio::Debugger::DkmProcess ^ AttachToProcess(Microsoft::VisualStudio::Debugger::Start::DkmProcessAttachRequest ^ request);
public Microsoft.VisualStudio.Debugger.DkmProcess AttachToProcess (Microsoft.VisualStudio.Debugger.Start.DkmProcessAttachRequest request);
abstract member AttachToProcess : Microsoft.VisualStudio.Debugger.Start.DkmProcessAttachRequest -> Microsoft.VisualStudio.Debugger.DkmProcess
Public Function AttachToProcess (request As DkmProcessAttachRequest) As DkmProcess

Parameters

request
DkmProcessAttachRequest

[In] DkmProcessAttachRequest is used to describe the process that debugger should attach to.

Returns

[Out] DkmProcess represents a target process which is being debugged. The debugger debugs processes, so this is the basic unit of debugging. A DkmProcess can represent a system process or a virtual process such as minidumps.

Exceptions

E_ATTACH_USER_CANCELED indicates that the attach to process operation was canceled. Returning this error will suppress most error messages. So it can be used in combination with DkmUserMessage.Post or DkmCustomMessage.SendToVsService as a way of providing custom failure messages to the user.

Applies to