Delen via


ICorDebug::CanLaunchOrAttach Method

Returns an HRESULT that indicates whether launching a new process or attaching to the specified existing process is possible within the context of the current machine and runtime configuration.

HRESULT CanLaunchOrAttach (
    [in] DWORD      dwProcessId,
    [in] BOOL       win32DebuggingEnabled
);

Parameters

  • dwProcessId
    [in] The ID of an existing process.

  • win32DebuggingEnabled
    [in] Pass in true if you plan to launch with Win32 debugging enabled, or to attach with Win32 debugging enabled; otherwise, pass false.

Return Value

S_OK if the debugging services determine that launching a new process or attaching to the given process is possible, given the information about the current machine and runtime configuration. Possible HRESULT values are:

  • S_OK

  • CORDBG_E_DEBUGGING_NOT_POSSIBLE

  • CORDBG_E_KERNEL_DEBUGGER_PRESENT

  • CORDBG_E_KERNEL_DEBUGGER_ENABLED

Remarks

This method is purely informational. The interface will not stop you from launching or attaching to a process, regardless of the value returned by CanLaunchOrAttach.

If you plan to launch with Win32 debugging enabled or attach with Win32 debugging enabled, pass true for win32DebuggingEnabled. The HRESULT returned by CanLaunchOrAttach might differ if you use this option.

Requirements

Platforms: See .NET Framework System Requirements.

Header: CorDebug.idl

Library: CorGuids.lib

.NET Framework Versions: 3.5 SP1, 3.5, 3.0 SP1, 3.0, 2.0 SP1, 2.0, 1.1, 1.0

See Also

Reference

ICorDebug Interface