0c03ae27fc1e8e016f6cbecc091cfb6f580bbece
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 ******************************************************************/
30 #include <internal/debug.h>
32 /* FUNCTIONS *****************************************************************/
35 DbgkCreateThread(PVOID StartAddress
)
37 LPC_DBG_MESSAGE Message
;
38 LPC_DBG_MESSAGE Reply
;
41 if (PsGetCurrentThread()->ThreadsProcess
->DebugPort
== NULL
)
46 Message
.Header
.MessageSize
= sizeof(LPC_DBG_MESSAGE
);
47 Message
.Header
.DataSize
= sizeof(LPC_DBG_MESSAGE
) -
49 Message
.Type
= DBG_EVENT_CREATE_THREAD
;
50 Message
.Status
= STATUS_SUCCESS
;
51 Message
.Data
.CreateThread
.Reserved
= 0;
52 Message
.Data
.CreateThread
.StartAddress
= StartAddress
;
54 /* FIXME: Freeze all threads in process */
56 /* Send the message to the process's debug port and wait for a reply */
58 LpcSendDebugMessagePort(PsGetCurrentThread()->ThreadsProcess
->DebugPort
,
61 if (!NT_SUCCESS(Status
))
66 /* FIXME: Examine reply */
71 DbgkForwardException(EXCEPTION_RECORD Er
, ULONG FirstChance
)
73 LPC_DBG_MESSAGE Message
;
74 LPC_DBG_MESSAGE Reply
;
77 if (PsGetCurrentThread()->ThreadsProcess
->DebugPort
== NULL
)
82 Message
.Header
.MessageSize
= sizeof(LPC_DBG_MESSAGE
);
83 Message
.Header
.DataSize
= sizeof(LPC_DBG_MESSAGE
) -
85 Message
.Type
= DBG_EVENT_EXCEPTION
;
86 Message
.Status
= STATUS_SUCCESS
;
87 Message
.Data
.Exception
.ExceptionRecord
= Er
;
88 Message
.Data
.Exception
.FirstChance
= FirstChance
;
90 /* FIXME: Freeze all threads in process */
92 /* Send the message to the process's debug port and wait for a reply */
94 LpcSendDebugMessagePort(PsGetCurrentThread()->ThreadsProcess
->DebugPort
,
97 if (!NT_SUCCESS(Status
))
102 /* FIXME: Examine reply */