2005-01-06 13:58:04 +00:00
|
|
|
/* $Id$
|
2003-03-31 22:28:59 +00:00
|
|
|
*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS system libraries
|
|
|
|
* FILE: lib/kernel32/debug/debugger.c
|
|
|
|
* PURPOSE: Win32 Debugger API
|
|
|
|
* PROGRAMMER: ???
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* INCLUDES ******************************************************************/
|
|
|
|
|
|
|
|
#include <k32.h>
|
|
|
|
|
|
|
|
/* FUNCTIONS *****************************************************************/
|
|
|
|
|
2003-07-10 18:50:51 +00:00
|
|
|
/*
|
2004-12-09 19:03:33 +00:00
|
|
|
* @implemented
|
2003-07-10 18:50:51 +00:00
|
|
|
*/
|
2004-12-09 19:03:33 +00:00
|
|
|
BOOL WINAPI
|
|
|
|
CheckRemoteDebuggerPresent (
|
|
|
|
HANDLE hProcess,
|
|
|
|
PBOOL pbDebuggerPresent
|
|
|
|
)
|
2003-03-31 22:28:59 +00:00
|
|
|
{
|
2004-12-09 19:03:33 +00:00
|
|
|
HANDLE DebugPort;
|
|
|
|
NTSTATUS Status;
|
|
|
|
|
|
|
|
if(pbDebuggerPresent == NULL)
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_INVALID_PARAMETER);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
Status = NtQueryInformationProcess(hProcess,
|
|
|
|
ProcessDebugPort,
|
|
|
|
(PVOID)&DebugPort,
|
|
|
|
sizeof(HANDLE),
|
|
|
|
NULL);
|
|
|
|
if(NT_SUCCESS(Status))
|
|
|
|
{
|
|
|
|
*pbDebuggerPresent = ((DebugPort != NULL) ? TRUE : FALSE);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
SetLastErrorByStatus(Status);
|
|
|
|
return FALSE;
|
2003-03-31 22:28:59 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 18:50:51 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2004-12-09 19:03:33 +00:00
|
|
|
BOOL WINAPI
|
|
|
|
ContinueDebugEvent (
|
|
|
|
DWORD dwProcessId,
|
|
|
|
DWORD dwThreadId,
|
|
|
|
DWORD dwContinueStatus
|
|
|
|
)
|
2003-03-31 22:28:59 +00:00
|
|
|
{
|
2004-12-09 19:03:33 +00:00
|
|
|
CLIENT_ID ClientId;
|
|
|
|
NTSTATUS Status;
|
2003-03-31 22:28:59 +00:00
|
|
|
|
2004-12-09 19:03:33 +00:00
|
|
|
ClientId.UniqueProcess = (HANDLE)dwProcessId;
|
|
|
|
ClientId.UniqueThread = (HANDLE)dwThreadId;
|
2003-03-31 22:28:59 +00:00
|
|
|
|
2004-12-09 19:03:33 +00:00
|
|
|
Status = DbgUiContinue(&ClientId, dwContinueStatus);
|
2003-03-31 22:28:59 +00:00
|
|
|
|
2004-12-09 19:03:33 +00:00
|
|
|
if(!NT_SUCCESS(Status))
|
|
|
|
{
|
|
|
|
SetLastErrorByStatus(Status);
|
|
|
|
return FALSE;
|
|
|
|
}
|
2003-03-31 22:28:59 +00:00
|
|
|
|
2004-12-09 19:03:33 +00:00
|
|
|
return TRUE;
|
2003-03-31 22:28:59 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 18:50:51 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @unimplemented
|
|
|
|
*/
|
2004-12-09 19:03:33 +00:00
|
|
|
BOOL
|
|
|
|
WINAPI
|
|
|
|
DebugActiveProcess (
|
|
|
|
DWORD dwProcessId
|
|
|
|
)
|
2003-03-31 22:28:59 +00:00
|
|
|
{
|
2004-12-09 19:03:33 +00:00
|
|
|
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|
|
|
return FALSE;
|
2003-03-31 22:28:59 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 18:50:51 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @unimplemented
|
|
|
|
*/
|
2004-12-09 19:03:33 +00:00
|
|
|
BOOL
|
|
|
|
WINAPI
|
|
|
|
DebugActiveProcessStop (
|
|
|
|
DWORD dwProcessId
|
|
|
|
)
|
2003-03-31 22:28:59 +00:00
|
|
|
{
|
2004-12-09 19:03:33 +00:00
|
|
|
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|
|
|
return FALSE;
|
2003-03-31 22:28:59 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 18:50:51 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @unimplemented
|
|
|
|
*/
|
2004-12-09 19:03:33 +00:00
|
|
|
BOOL
|
|
|
|
WINAPI
|
|
|
|
DebugSetProcessKillOnExit (
|
|
|
|
BOOL KillOnExit
|
|
|
|
)
|
2003-03-31 22:28:59 +00:00
|
|
|
{
|
2004-12-09 19:03:33 +00:00
|
|
|
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|
|
|
return FALSE;
|
2003-03-31 22:28:59 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 18:50:51 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2004-12-09 19:03:33 +00:00
|
|
|
BOOL
|
|
|
|
WINAPI
|
|
|
|
IsDebuggerPresent (VOID)
|
2003-03-31 22:28:59 +00:00
|
|
|
{
|
2004-12-09 19:03:33 +00:00
|
|
|
return (BOOL)NtCurrentPeb()->BeingDebugged;
|
2003-03-31 22:28:59 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 18:50:51 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @unimplemented
|
|
|
|
*/
|
2004-12-09 19:03:33 +00:00
|
|
|
BOOL
|
|
|
|
WINAPI
|
|
|
|
WaitForDebugEvent (
|
|
|
|
LPDEBUG_EVENT lpDebugEvent,
|
|
|
|
DWORD dwMilliseconds
|
|
|
|
)
|
2003-03-31 22:28:59 +00:00
|
|
|
{
|
2004-12-09 19:03:33 +00:00
|
|
|
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|
|
|
return FALSE;
|
2003-03-31 22:28:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* EOF */
|