Alexandre Julliard : ntdll: Implement DbgUiGet/SetThreadDebugObject().

Alexandre Julliard julliard at winehq.org
Fri Jan 29 15:10:21 CST 2021


Module: wine
Branch: master
Commit: f7c48da359a7b83e6a0ef35fdea89fcc613a48b0
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=f7c48da359a7b83e6a0ef35fdea89fcc613a48b0

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Jan 28 11:17:45 2021 +0100

ntdll: Implement DbgUiGet/SetThreadDebugObject().

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/ntdll.spec |  4 ++--
 dlls/ntdll/process.c  | 16 ++++++++++++++++
 include/winternl.h    |  2 ++
 3 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
index 2f1d4904111..285b719f2d5 100644
--- a/dlls/ntdll/ntdll.spec
+++ b/dlls/ntdll/ntdll.spec
@@ -38,10 +38,10 @@
 @ stub DbgUiContinue
 @ stub DbgUiConvertStateChangeStructure
 # @ stub DbgUiDebugActiveProcess
-# @ stub DbgUiGetThreadDebugObject
+@ stdcall DbgUiGetThreadDebugObject()
 @ stdcall DbgUiIssueRemoteBreakin(long)
 @ stdcall DbgUiRemoteBreakin(ptr)
-# @ stub DbgUiSetThreadDebugObject
+@ stdcall DbgUiSetThreadDebugObject(long)
 # @ stub DbgUiStopDebugging
 @ stub DbgUiWaitStateChange
 @ stdcall DbgUserBreakPoint()
diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c
index 4cf83753a79..d8280277418 100644
--- a/dlls/ntdll/process.c
+++ b/dlls/ntdll/process.c
@@ -118,6 +118,22 @@ NTSTATUS WINAPI RtlCreateUserProcess( UNICODE_STRING *path, ULONG attributes,
                                 &create_info, attr );
 }
 
+/***********************************************************************
+ *      DbgUiGetThreadDebugObject (NTDLL.@)
+ */
+HANDLE WINAPI DbgUiGetThreadDebugObject(void)
+{
+    return NtCurrentTeb()->DbgSsReserved[1];
+}
+
+/***********************************************************************
+ *      DbgUiSetThreadDebugObject (NTDLL.@)
+ */
+void WINAPI DbgUiSetThreadDebugObject( HANDLE handle )
+{
+    NtCurrentTeb()->DbgSsReserved[1] = handle;
+}
+
 /***********************************************************************
  *      DbgUiRemoteBreakin (NTDLL.@)
  */
diff --git a/include/winternl.h b/include/winternl.h
index 6de71e0e206..ac63567dad3 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -3020,8 +3020,10 @@ typedef struct _PS_CREATE_INFO
 NTSYSAPI void      WINAPI DbgBreakPoint(void);
 NTSYSAPI NTSTATUS WINAPIV DbgPrint(LPCSTR fmt, ...);
 NTSYSAPI NTSTATUS WINAPIV DbgPrintEx(ULONG iComponentId, ULONG Level, LPCSTR fmt, ...);
+NTSYSAPI HANDLE    WINAPI DbgUiGetThreadDebugObject(void);
 NTSYSAPI NTSTATUS  WINAPI DbgUiIssueRemoteBreakin(HANDLE);
 NTSYSAPI void      WINAPI DbgUiRemoteBreakin(void*);
+NTSYSAPI void      WINAPI DbgUiSetThreadDebugObject(HANDLE);
 NTSYSAPI void      WINAPI DbgUserBreakPoint(void);
 NTSYSAPI NTSTATUS  WINAPI LdrAccessResource(HMODULE,const IMAGE_RESOURCE_DATA_ENTRY*,void**,PULONG);
 NTSYSAPI NTSTATUS  WINAPI LdrAddDllDirectory(const UNICODE_STRING*,void**);




More information about the wine-cvs mailing list