3 * Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 * PROJECT: ReactOS kernel
21 * FILE: ntoskrnl/dbg/user.c
22 * PURPOSE: User mode debugging
23 * PROGRAMMER: David Welch (welch@cwcom.net)
24 * PORTABILITY: Unchecked
27 /* INCLUDES ******************************************************************/
29 #include <internal/ntoskrnl.h>
31 #include <internal/ps.h>
32 #include <internal/dbg.h>
34 #include <internal/debug.h>
36 /* FUNCTIONS *****************************************************************/
39 DbgkCreateThread(PVOID StartAddress)
41 LPC_DBG_MESSAGE Message;
42 LPC_DBG_MESSAGE Reply;
45 if (PsGetCurrentThread()->ThreadsProcess->DebugPort == NULL)
50 Message.Header.MessageSize = sizeof(LPC_DBG_MESSAGE);
51 Message.Header.DataSize = sizeof(LPC_DBG_MESSAGE) -
53 Message.Type = DBG_EVENT_CREATE_THREAD;
54 Message.Status = STATUS_SUCCESS;
55 Message.Data.CreateThread.Reserved = 0;
56 Message.Data.CreateThread.StartAddress = StartAddress;
58 /* FIXME: Freeze all threads in process */
60 /* Send the message to the process's debug port and wait for a reply */
62 LpcSendDebugMessagePort(PsGetCurrentThread()->ThreadsProcess->DebugPort,
65 if (!NT_SUCCESS(Status))
70 /* FIXME: Examine reply */
75 DbgkForwardException(EXCEPTION_RECORD Er, ULONG FirstChance)
77 LPC_DBG_MESSAGE Message;
78 LPC_DBG_MESSAGE Reply;
81 if (PsGetCurrentThread()->ThreadsProcess->DebugPort == NULL)
86 Message.Header.MessageSize = sizeof(LPC_DBG_MESSAGE);
87 Message.Header.DataSize = sizeof(LPC_DBG_MESSAGE) -
89 Message.Type = DBG_EVENT_EXCEPTION;
90 Message.Status = STATUS_SUCCESS;
91 Message.Data.Exception.ExceptionRecord = Er;
92 Message.Data.Exception.FirstChance = FirstChance;
94 /* FIXME: Freeze all threads in process */
96 /* Send the message to the process's debug port and wait for a reply */
98 LpcSendDebugMessagePort(PsGetCurrentThread()->ThreadsProcess->DebugPort,
101 if (!NT_SUCCESS(Status))
106 /* FIXME: Examine reply */