Microsoft Developer Network
Attaches the calling process to the specified client process, enabling it to debug the client process.
dwProcessId
If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError
.
The DebugActiveProcessEx
function enables a process to be debugged by another process. When a debugger attaches to a process, the system sends a CREATE_PROCESS_DEBUG_EVENT
or CREATE_THREAD_DEBUG_EVENT
notification to the debugger.
A process can only be attached to one debugger at a time. If the process is already being debugged, DebugActiveProcessEx
fails.
Use the DebugActiveProcessStop
function to detach the debugger from the process.
If dwProcessId
is 0, the debugger attaches to the first process that is being debugged. This can be useful if a debugger process is started before the process it is intended to debug.
Windows 2000 Professional
Windows 2000 Server
winbase.h
(include windows.h
)
winbase.h
Kernel32.lib