Author: ion Date: Mon Oct 23 01:19:34 2006 New Revision: 24615
URL: http://svn.reactos.org/svn/reactos?rev=24615&view=rev Log: - Stub DbgUiConvertStateChangeStructure (this isn't done in kernel32 anymore) and export it. - Implement and export DbgUiSetThreadDebugObject. - Fix DbgUi* APIs to use DbgSsReserved[1], and not [0]. Still trying to figure out what [0] is for.
Modified: trunk/reactos/dll/ntdll/dbg/dbgui.c trunk/reactos/dll/ntdll/def/ntdll.def trunk/reactos/include/ndk/umfuncs.h
Modified: trunk/reactos/dll/ntdll/dbg/dbgui.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/dbg/dbgui.c?rev=2... ============================================================================== --- trunk/reactos/dll/ntdll/dbg/dbgui.c (original) +++ trunk/reactos/dll/ntdll/dbg/dbgui.c Mon Oct 23 01:19:34 2006 @@ -46,17 +46,13 @@ 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 @@ */ 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); }
/* - * @implemented - */ -NTSTATUS -NTAPI -DbgUiWaitStateChange(PDBGUI_WAIT_STATE_CHANGE DbgUiWaitStateCange, - PLARGE_INTEGER TimeOut) + * @unimplemented + */ +NTSTATUS +NTAPI +DbgUiConvertStateChangeStructure(IN PDBGUI_WAIT_STATE_CHANGE WaitStateChange, + IN LPDEBUG_EVENT DebugEvent) +{ + /* FIXME: UNIMPLEMENTED */ + return STATUS_NOT_IMPLEMENTED; +} + +/* + * @implemented + */ +NTSTATUS +NTAPI +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 @@ */ NTSTATUS NTAPI -DbgUiIssueRemoteBreakin(HANDLE Process) +DbgUiIssueRemoteBreakin(IN HANDLE Process) { HANDLE hThread; CLIENT_ID ClientId; @@ -143,7 +151,18 @@ 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 @@ 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 @@ 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 */
Modified: trunk/reactos/dll/ntdll/def/ntdll.def URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/def/ntdll.def?rev... ============================================================================== --- trunk/reactos/dll/ntdll/def/ntdll.def (original) +++ trunk/reactos/dll/ntdll/def/ntdll.def Mon Oct 23 01:19:34 2006 @@ -24,12 +24,14 @@ 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
Modified: trunk/reactos/include/ndk/umfuncs.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/umfuncs.h?rev=2... ============================================================================== --- trunk/reactos/include/ndk/umfuncs.h (original) +++ trunk/reactos/include/ndk/umfuncs.h Mon Oct 23 01:19:34 2006 @@ -142,7 +142,7 @@ NTAPI DbgUiContinue( IN PCLIENT_ID ClientId, - IN ULONG ContinueStatus + IN NTSTATUS ContinueStatus );
NTSTATUS @@ -162,6 +162,13 @@ DbgUiWaitStateChange( IN PDBGUI_WAIT_STATE_CHANGE DbgUiWaitStateCange, IN PLARGE_INTEGER TimeOut +); + +NTSTATUS +NTAPI +DbgUiConvertStateChangeStructure( + IN PDBGUI_WAIT_STATE_CHANGE WaitStateChange, + IN LPDEBUG_EVENT DebugEvent );
VOID