diff --git a/reactos/dll/ntdll/dbg/dbgui.c b/reactos/dll/ntdll/dbg/dbgui.c index b1d3423b20e..8ec73c4cd6d 100644 --- a/reactos/dll/ntdll/dbg/dbgui.c +++ b/reactos/dll/ntdll/dbg/dbgui.c @@ -46,17 +46,13 @@ DbgUiConnectToDbg(VOID) OBJECT_ATTRIBUTES ObjectAttributes; /* Don't connect twice */ - if (NtCurrentTeb()->DbgSsReserved[0]) return STATUS_SUCCESS; + if (NtCurrentTeb()->DbgSsReserved[1]) return STATUS_SUCCESS; /* Setup the Attributes */ - InitializeObjectAttributes(&ObjectAttributes, - 0, - 0, - 0, - 0); + InitializeObjectAttributes(&ObjectAttributes, NULL, 0, NULL, 0); /* Create the object */ - return ZwCreateDebugObject(&NtCurrentTeb()->DbgSsReserved[0], + return ZwCreateDebugObject(&NtCurrentTeb()->DbgSsReserved[1], DEBUG_OBJECT_ALL_ACCESS, &ObjectAttributes, TRUE); @@ -67,25 +63,37 @@ DbgUiConnectToDbg(VOID) */ NTSTATUS NTAPI -DbgUiContinue(PCLIENT_ID ClientId, - ULONG ContinueStatus) +DbgUiContinue(IN PCLIENT_ID ClientId, + IN NTSTATUS ContinueStatus) { /* Tell the kernel object to continue */ - return ZwDebugContinue(NtCurrentTeb()->DbgSsReserved[0], + return ZwDebugContinue(NtCurrentTeb()->DbgSsReserved[1], ClientId, ContinueStatus); } +/* + * @unimplemented + */ +NTSTATUS +NTAPI +DbgUiConvertStateChangeStructure(IN PDBGUI_WAIT_STATE_CHANGE WaitStateChange, + IN LPDEBUG_EVENT DebugEvent) +{ + /* FIXME: UNIMPLEMENTED */ + return STATUS_NOT_IMPLEMENTED; +} + /* * @implemented */ NTSTATUS NTAPI -DbgUiWaitStateChange(PDBGUI_WAIT_STATE_CHANGE DbgUiWaitStateCange, - PLARGE_INTEGER TimeOut) +DbgUiWaitStateChange(OUT PDBGUI_WAIT_STATE_CHANGE DbgUiWaitStateCange, + IN PLARGE_INTEGER TimeOut OPTIONAL) { /* Tell the kernel to wait */ - return NtWaitForDebugEvent(NtCurrentTeb()->DbgSsReserved[0], + return NtWaitForDebugEvent(NtCurrentTeb()->DbgSsReserved[1], TRUE, TimeOut, DbgUiWaitStateCange); @@ -110,7 +118,7 @@ DbgUiRemoteBreakin(VOID) */ NTSTATUS NTAPI -DbgUiIssueRemoteBreakin(HANDLE Process) +DbgUiIssueRemoteBreakin(IN HANDLE Process) { HANDLE hThread; CLIENT_ID ClientId; @@ -143,7 +151,18 @@ NTAPI DbgUiGetThreadDebugObject(VOID) { /* Just return the handle from the TEB */ - return NtCurrentTeb()->DbgSsReserved[0]; + return NtCurrentTeb()->DbgSsReserved[1]; +} + +/* +* @implemented +*/ +VOID +NTAPI +DbgUiSetThreadDebugObject(HANDLE DebugObject) +{ + /* Just set the handle in the TEB */ + NtCurrentTeb()->DbgSsReserved[1] = DebugObject; } /* @@ -156,7 +175,7 @@ DbgUiDebugActiveProcess(IN HANDLE Process) NTSTATUS Status; /* Tell the kernel to start debugging */ - Status = NtDebugActiveProcess(Process, NtCurrentTeb()->DbgSsReserved[0]); + Status = NtDebugActiveProcess(Process, NtCurrentTeb()->DbgSsReserved[1]); if (NT_SUCCESS(Status)) { /* Now break-in the process */ @@ -180,7 +199,7 @@ NTAPI DbgUiStopDebugging(IN HANDLE Process) { /* Call the kernel to remove the debug object */ - return NtRemoveProcessDebug(Process, NtCurrentTeb()->DbgSsReserved[0]); + return NtRemoveProcessDebug(Process, NtCurrentTeb()->DbgSsReserved[1]); } /* EOF */ diff --git a/reactos/dll/ntdll/def/ntdll.def b/reactos/dll/ntdll/def/ntdll.def index 98f20a11abc..5957dab7ac7 100644 --- a/reactos/dll/ntdll/def/ntdll.def +++ b/reactos/dll/ntdll/def/ntdll.def @@ -24,12 +24,14 @@ DbgBreakPoint@0 DbgPrint DbgPrintEx DbgPrompt@12 +DbgUiConvertStateChangeStructure@8 DbgUiDebugActiveProcess@4 DbgUiConnectToDbg@0 DbgUiContinue@8 DbgUiGetThreadDebugObject@0 DbgUiIssueRemoteBreakin@4 DbgUiRemoteBreakin@0 +DbgUiSetThreadDebugObject@4 DbgUiStopDebugging@4 DbgUiWaitStateChange@8 DbgUserBreakPoint@0 diff --git a/reactos/include/ndk/umfuncs.h b/reactos/include/ndk/umfuncs.h index 1850090a25b..e6748bd27ce 100644 --- a/reactos/include/ndk/umfuncs.h +++ b/reactos/include/ndk/umfuncs.h @@ -142,7 +142,7 @@ NTSTATUS NTAPI DbgUiContinue( IN PCLIENT_ID ClientId, - IN ULONG ContinueStatus + IN NTSTATUS ContinueStatus ); NTSTATUS @@ -164,6 +164,13 @@ DbgUiWaitStateChange( IN PLARGE_INTEGER TimeOut ); +NTSTATUS +NTAPI +DbgUiConvertStateChangeStructure( + IN PDBGUI_WAIT_STATE_CHANGE WaitStateChange, + IN LPDEBUG_EVENT DebugEvent +); + VOID NTAPI DbgUiRemoteBreakin(