b104c548b6af290b57d4578ea823e46ef58c43cf
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: ntoskrnl/dbg/user.c
6 * PURPOSE: User mode debugging
8 * PROGRAMMERS: David Welch (welch@cwcom.net)
11 /* INCLUDES ******************************************************************/
14 #include <internal/debug.h>
16 /* FUNCTIONS *****************************************************************/
19 DbgkCreateThread(PVOID StartAddress
)
21 LPC_DBG_MESSAGE Message
;
22 LPC_DBG_MESSAGE Reply
;
25 if (PsGetCurrentThread()->ThreadsProcess
->DebugPort
== NULL
)
30 Message
.Header
.MessageSize
= sizeof(LPC_DBG_MESSAGE
);
31 Message
.Header
.DataSize
= sizeof(LPC_DBG_MESSAGE
) -
33 Message
.Type
= DBG_EVENT_CREATE_THREAD
;
34 Message
.Status
= STATUS_SUCCESS
;
35 Message
.Data
.CreateThread
.Reserved
= 0;
36 Message
.Data
.CreateThread
.StartAddress
= StartAddress
;
38 /* FIXME: Freeze all threads in process */
40 /* Send the message to the process's debug port and wait for a reply */
42 LpcSendDebugMessagePort(PsGetCurrentThread()->ThreadsProcess
->DebugPort
,
45 if (!NT_SUCCESS(Status
))
50 /* FIXME: Examine reply */
55 DbgkForwardException(EXCEPTION_RECORD Er
, ULONG FirstChance
)
57 LPC_DBG_MESSAGE Message
;
58 LPC_DBG_MESSAGE Reply
;
61 if (PsGetCurrentThread()->ThreadsProcess
->DebugPort
== NULL
)
66 Message
.Header
.MessageSize
= sizeof(LPC_DBG_MESSAGE
);
67 Message
.Header
.DataSize
= sizeof(LPC_DBG_MESSAGE
) -
69 Message
.Type
= DBG_EVENT_EXCEPTION
;
70 Message
.Status
= STATUS_SUCCESS
;
71 Message
.Data
.Exception
.ExceptionRecord
= Er
;
72 Message
.Data
.Exception
.FirstChance
= FirstChance
;
74 /* FIXME: Freeze all threads in process */
76 /* Send the message to the process's debug port and wait for a reply */
78 LpcSendDebugMessagePort(PsGetCurrentThread()->ThreadsProcess
->DebugPort
,
81 if (!NT_SUCCESS(Status
))
86 /* FIXME: Examine reply */