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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries * PROJECT: ReactOS system libraries
@ -13,90 +13,133 @@
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
/*
* @unimplemented
*/
BOOL WINAPI CheckRemoteDebuggerPresent(HANDLE hProcess, PBOOL pbDebuggerPresent)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
/* /*
* @implemented * @implemented
*/ */
BOOL WINAPI ContinueDebugEvent BOOL WINAPI
( CheckRemoteDebuggerPresent (
DWORD dwProcessId, HANDLE hProcess,
DWORD dwThreadId, PBOOL pbDebuggerPresent
DWORD dwContinueStatus )
)
{ {
CLIENT_ID ClientId; HANDLE DebugPort;
NTSTATUS Status; NTSTATUS Status;
ClientId.UniqueProcess = (HANDLE)dwProcessId; if(pbDebuggerPresent == NULL)
ClientId.UniqueThread = (HANDLE)dwThreadId; {
SetLastError(ERROR_INVALID_PARAMETER);
Status = DbgUiContinue(&ClientId, dwContinueStatus); return FALSE;
}
if(!NT_SUCCESS(Status))
{ Status = NtQueryInformationProcess(hProcess,
ProcessDebugPort,
(PVOID)&DebugPort,
sizeof(HANDLE),
NULL);
if(NT_SUCCESS(Status))
{
*pbDebuggerPresent = ((DebugPort != NULL) ? TRUE : FALSE);
return TRUE;
}
SetLastErrorByStatus(Status); SetLastErrorByStatus(Status);
return FALSE; 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 * @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 * @unimplemented
*/ */
BOOL WINAPI WaitForDebugEvent(LPDEBUG_EVENT lpDebugEvent, DWORD dwMilliseconds) BOOL
WINAPI
DebugActiveProcess (
DWORD dwProcessId
)
{ {
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE; 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 */ /* EOF */