implemented CheckRemoteDebuggerPresent() (only kernel32 part)

svn path=/trunk/; revision=11995
This commit is contained in:
Thomas Bluemel 2004-12-09 19:03:33 +00:00
parent e6bc6ec79d
commit 865bf755ca

View file

@ -1,4 +1,4 @@
/* $Id: debugger.c,v 1.4 2004/01/23 17:12:54 ekohl Exp $
/* $Id: debugger.c,v 1.5 2004/12/09 19:03:33 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@ -13,90 +13,133 @@
/* FUNCTIONS *****************************************************************/
/*
* @unimplemented
*/
BOOL WINAPI CheckRemoteDebuggerPresent(HANDLE hProcess, PBOOL pbDebuggerPresent)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
/*
* @implemented
*/
BOOL WINAPI ContinueDebugEvent
(
DWORD dwProcessId,
DWORD dwThreadId,
DWORD dwContinueStatus
)
BOOL WINAPI
CheckRemoteDebuggerPresent (
HANDLE hProcess,
PBOOL pbDebuggerPresent
)
{
CLIENT_ID ClientId;
NTSTATUS Status;
ClientId.UniqueProcess = (HANDLE)dwProcessId;
ClientId.UniqueThread = (HANDLE)dwThreadId;
Status = DbgUiContinue(&ClientId, dwContinueStatus);
if(!NT_SUCCESS(Status))
{
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;
}
return TRUE;
}
/*
* @unimplemented
*/
BOOL WINAPI DebugActiveProcess(DWORD dwProcessId)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
/*
* @unimplemented
*/
BOOL WINAPI DebugActiveProcessStop(DWORD dwProcessId)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
/*
* @unimplemented
*/
BOOL WINAPI DebugSetProcessKillOnExit(BOOL KillOnExit)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
/*
* @implemented
*/
BOOL WINAPI IsDebuggerPresent(VOID)
BOOL WINAPI
ContinueDebugEvent (
DWORD dwProcessId,
DWORD dwThreadId,
DWORD dwContinueStatus
)
{
return (BOOL)NtCurrentPeb()->BeingDebugged;
CLIENT_ID ClientId;
NTSTATUS Status;
ClientId.UniqueProcess = (HANDLE)dwProcessId;
ClientId.UniqueThread = (HANDLE)dwThreadId;
Status = DbgUiContinue(&ClientId, dwContinueStatus);
if(!NT_SUCCESS(Status))
{
SetLastErrorByStatus(Status);
return FALSE;
}
return TRUE;
}
/*
* @unimplemented
*/
BOOL WINAPI WaitForDebugEvent(LPDEBUG_EVENT lpDebugEvent, DWORD dwMilliseconds)
BOOL
WINAPI
DebugActiveProcess (
DWORD dwProcessId
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
/*
* @unimplemented
*/
BOOL
WINAPI
DebugActiveProcessStop (
DWORD dwProcessId
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
/*
* @unimplemented
*/
BOOL
WINAPI
DebugSetProcessKillOnExit (
BOOL KillOnExit
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
/*
* @implemented
*/
BOOL
WINAPI
IsDebuggerPresent (VOID)
{
return (BOOL)NtCurrentPeb()->BeingDebugged;
}
/*
* @unimplemented
*/
BOOL
WINAPI
WaitForDebugEvent (
LPDEBUG_EVENT lpDebugEvent,
DWORD dwMilliseconds
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
/* EOF */