3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: lib/ntdll/dbg/debug.c
6 * PURPOSE: User mode debugger support functions
7 * PROGRAMMER: Eric Kohl
12 /* INCLUDES *****************************************************************/
14 #include <ddk/ntddk.h>
15 #include <ntdll/rtl.h>
16 #include <ntdll/dbg.h>
19 /* FUNCTIONS *****************************************************************/
21 static HANDLE DbgSsApiPort = NULL;
22 static HANDLE DbgSsReplyPort = NULL;
25 typedef struct _LPC_DBGSS_MESSAGE
27 LPC_MESSAGE_HEADER Header;
32 } LPC_DBGSS_MESSAGE, *PLPC_DBGSS_MESSAGE;
35 /* FUNCTIONS *****************************************************************/
38 DbgSsServerThread(PVOID Unused)
40 LPC_DBGSS_MESSAGE Message;
45 Status = NtReplyWaitReceivePort (DbgSsApiPort,
48 (PLPC_MESSAGE)&Message);
49 if (!NT_SUCCESS(Status))
51 DbgPrint ("DbgSs: NtReplyWaitReceivePort failed - Status == %lx\n",
58 /* FIXME: missing code!! */
66 DbgSsHandleKmApiMsg(ULONG Unknown1,
69 return STATUS_NOT_IMPLEMENTED;
74 DbgSsInitialize(HANDLE ReplyPort,
79 SECURITY_QUALITY_OF_SERVICE Qos;
80 UNICODE_STRING PortName = UNICODE_STRING_INITIALIZER(L"\\DbgSsApiPort");
83 Qos.Length = sizeof(SECURITY_QUALITY_OF_SERVICE);
84 Qos.ImpersonationLevel = SecurityIdentification;
85 Qos.ContextTrackingMode = SECURITY_DYNAMIC_TRACKING;
86 Qos.EffectiveOnly = TRUE;
88 Status = NtConnectPort (&DbgSsApiPort,
96 if (!NT_SUCCESS(Status))
99 DbgSsReplyPort = ReplyPort;
100 // UnknownData1 = Unknown1;
101 // UnknownData2 = Unknown2;
102 // UnknownData3 = Unknown3;
104 Status = RtlCreateUserThread (NtCurrentProcess (),
110 (PTHREAD_START_ROUTINE)DbgSsServerThread,
120 DbgUiConnectToDbg(VOID)
122 SECURITY_QUALITY_OF_SERVICE Qos;
123 UNICODE_STRING PortName = UNICODE_STRING_INITIALIZER(L"\\DbgUiApiPort");
128 Teb = NtCurrentTeb ();
130 Qos.Length = sizeof(SECURITY_QUALITY_OF_SERVICE);
131 Qos.ImpersonationLevel = SecurityIdentification;
132 Qos.ContextTrackingMode = SECURITY_DYNAMIC_TRACKING;
133 Qos.EffectiveOnly = TRUE;
135 InfoSize = sizeof(ULONG);
137 Status = NtConnectPort (&Teb->DbgSsReserved[1],
143 &Teb->DbgSsReserved[0],
145 if (!NT_SUCCESS(Status))
147 Teb->DbgSsReserved[1] = NULL;
151 NtRegisterThreadTerminatePort(Teb->DbgSsReserved[1]);
158 DbgUiContinue(PCLIENT_ID ClientId,
159 ULONG ContinueStatus)
161 return STATUS_NOT_IMPLEMENTED;
166 DbgUiWaitStateChange(ULONG Unknown1,
169 return STATUS_NOT_IMPLEMENTED;