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
);
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
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.
Platforms: See .NET Framework System Requirements.
Header: CorDebug.idl, CorDebug.h
Library: CorGuids.lib
.NET Framework Versions: 4.5, 4, 3.5 SP1, 3.5, 3.0 SP1, 3.0, 2.0 SP1, 2.0, 1.1, 1.0