diff --git a/reactos/ChangeLog b/reactos/ChangeLog index c8b5b7b554d..090bd4b6051 100644 --- a/reactos/ChangeLog +++ b/reactos/ChangeLog @@ -1,3 +1,17 @@ +2001-03-18 David Welch + + * ntoskrnl/ke/apc.c (KiDeliverApc): Bug fix. + * ntoskrnl/ke/apc.c (KeInsertQueueApc): More comments. + * ntoskrnl/ke/catch.c (KiDispatchException): Bug fix. + * ntoskrnl/ke/timer.c (KeDelayExecutionThread): Don't use removed + function KeAddTimeoutThread. + * ntoskrnl/ke/timer.c (KeAddTimeoutThread): Removed. + * ntoskrnl/ke/wait.c (KeWaitForSingleObject, KeWaitForMultipleObjects): + Don't use KeAddTimeoutThread. + * ntoskrnl/mm/freelist.c (MmAllocateContiguousAlignedMemory): Bug fix + * ntoskrnl/mm/freelist.c (MmAllocatePage): Allocate from the top + memory. + 2001-03-17 David Welch * ntoskrnl/ke/catch.c (KiDispatchException): Implementation of diff --git a/reactos/ntoskrnl/dbg/user.c b/reactos/ntoskrnl/dbg/user.c new file mode 100644 index 00000000000..3641fff758d --- /dev/null +++ b/reactos/ntoskrnl/dbg/user.c @@ -0,0 +1,110 @@ +/* + * ReactOS kernel + * Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* + * PROJECT: ReactOS kernel + * FILE: ntoskrnl/dbg/user.c + * PURPOSE: User mode debugging + * PROGRAMMER: David Welch (welch@cwcom.net) + * PORTABILITY: Unchecked + */ + +/* INCLUDES ******************************************************************/ + +#include +#include +#include +#include + +#include + +/* FUNCTIONS *****************************************************************/ + +VOID +DbgkCreateThread(PVOID StartAddress) +{ + LPC_DBG_MESSAGE Message; + LPC_DBG_MESSAGE Reply; + NTSTATUS Status; + + if (PsGetCurrentThread()->ThreadsProcess->DebugPort == NULL) + { + return; + } + + Message.Header.MessageSize = sizeof(LPC_DBG_MESSAGE); + Message.Header.DataSize = sizeof(LPC_DBG_MESSAGE) - + sizeof(LPC_MESSAGE_HEADER); + Message.Type = DBG_EVENT_CREATE_THREAD; + Message.Status = STATUS_SUCCESS; + Message.Data.CreateThread.Reserved = 0; + Message.Data.CreateThread.StartAddress = StartAddress; + + /* FIXME: Freeze all threads in process */ + + /* Send the message to the process's debug port and wait for a reply */ + Status = + LpcSendDebugMessagePort(PsGetCurrentThread()->ThreadsProcess->DebugPort, + &Message, + &Reply); + if (!NT_SUCCESS(Status)) + { + return; + } + + /* FIXME: Examine reply */ + return; +} + +ULONG +DbgkForwardException(EXCEPTION_RECORD Er, ULONG FirstChance) +{ + LPC_DBG_MESSAGE Message; + LPC_DBG_MESSAGE Reply; + NTSTATUS Status; + + if (PsGetCurrentThread()->ThreadsProcess->DebugPort == NULL) + { + return(0); + } + + Message.Header.MessageSize = sizeof(LPC_DBG_MESSAGE); + Message.Header.DataSize = sizeof(LPC_DBG_MESSAGE) - + sizeof(LPC_MESSAGE_HEADER); + Message.Type = DBG_EVENT_EXCEPTION; + Message.Status = STATUS_SUCCESS; + Message.Data.Exception.ExceptionRecord = Er; + Message.Data.Exception.FirstChance = FirstChance; + + /* FIXME: Freeze all threads in process */ + + /* Send the message to the process's debug port and wait for a reply */ + Status = + LpcSendDebugMessagePort(PsGetCurrentThread()->ThreadsProcess->DebugPort, + &Message, + &Reply); + if (!NT_SUCCESS(Status)) + { + return(0); + } + + /* FIXME: Examine reply */ + return(0); +} + +/* EOF */