CheckRemoteDebuggerPresent function (debugapi.h)

Determines whether the specified process is being debugged.

Syntax

BOOL CheckRemoteDebuggerPresent(
  [in]      HANDLE hProcess,
  [in, out] PBOOL  pbDebuggerPresent
);

Parameters

[in] hProcess

A handle to the process.

[in, out] pbDebuggerPresent

A pointer to a variable that the function sets to TRUE if the specified process is being debugged, or FALSE otherwise.

Return value

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.

Remarks

The "remote" in CheckRemoteDebuggerPresent does not imply that the debugger necessarily resides on a different computer; instead, it indicates that the debugger resides in a separate and parallel process. Use the IsDebuggerPresent function to detect whether the calling process is running under the debugger.

To compile an application that uses this function, define the _WIN32_WINNT macro as 0x0501 or later. For more information, see Using the Windows Headers.

Requirements

Requirement Value
Minimum supported client Windows Vista, Windows XP with SP1 [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header debugapi.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See also

Debugging Functions

IsDebuggerPresent