Skip to content

Latest commit

 

History

History
62 lines (52 loc) · 1.99 KB

idebugprogramex2-attach.md

File metadata and controls

62 lines (52 loc) · 1.99 KB
description title ms.date ms.topic f1_keywords helpviewer_keywords author ms.author manager ms.subservice dev_langs
Attach a session to a program.
IDebugProgramEx2::Attach
11/04/2016
reference
IDebugProgramEx2::Attach
IDebugProgramEx2::Attach
maiak
maiak
mijacobs
debug-diagnostics
CPP
CSharp

IDebugProgramEx2::Attach

Attach a session to a program.

Syntax

int Attach( 
   IDebugEventCallback2 pCallback,
   uint                 dwReason,
   IDebugSession2       pSession
);
HRESULT Attach( 
   IDebugEventCallback2* pCallback,
   DWORD                 dwReason,
   IDebugSession2*       pSession
);

Parameters

pCallback
[in] An IDebugEventCallback2 object that represents the callback function that the attached debug engine sends events to.

dwReason
[in] A value from the ATTACH_REASON enumeration that describes the reason for the attach operation.

pSession
[in] A value that uniquely identifies the session that is attaching to the program.

Return Value

If successful, returns S_OK; otherwise returns an error code. This method should return E_ATTACH_DEBUGGER_ALREADY_ATTACHED if the program is already attached.

Remarks

The port that contains the program can use the value in pSession to determine which session is attempting to attach to the program. For example, if a port allows only one debug session to attach to a process at a time, the port can determine if the same session is already attached to other programs in the process.

Note

The interface passed in pSession is to be treated only as a cookie, a value that uniquely identifies the session debug manager attaching to this program; none of the methods on the supplied interface are functional.

See also