Nikolay Sivov : ole32: Implement IComThreadingInfo:: GetCurrentLogicalThreadId().

Alexandre Julliard julliard at wine.codeweavers.com
Fri Mar 11 07:55:45 CST 2016


Module: wine
Branch: master
Commit: 5b7c9ecd09a4dadf45011b32b6846f44cb9e92fd
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=5b7c9ecd09a4dadf45011b32b6846f44cb9e92fd

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Thu Mar 10 12:51:34 2016 +0300

ole32: Implement IComThreadingInfo::GetCurrentLogicalThreadId().

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ole32/compobj.c       |  4 ++--
 dlls/ole32/tests/compobj.c | 12 ++++++++++++
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c
index 91f11f6..a7fe650 100644
--- a/dlls/ole32/compobj.c
+++ b/dlls/ole32/compobj.c
@@ -4739,8 +4739,8 @@ static HRESULT WINAPI Context_CTI_GetCurrentThreadType(IComThreadingInfo *iface,
 
 static HRESULT WINAPI Context_CTI_GetCurrentLogicalThreadId(IComThreadingInfo *iface, GUID *logical_thread_id)
 {
-    FIXME("(%p): stub\n", logical_thread_id);
-    return E_NOTIMPL;
+    TRACE("(%p)\n", logical_thread_id);
+    return CoGetCurrentLogicalThreadId(logical_thread_id);
 }
 
 static HRESULT WINAPI Context_CTI_SetCurrentLogicalThreadId(IComThreadingInfo *iface, REFGUID logical_thread_id)
diff --git a/dlls/ole32/tests/compobj.c b/dlls/ole32/tests/compobj.c
index 0f562a2..d684e33 100644
--- a/dlls/ole32/tests/compobj.c
+++ b/dlls/ole32/tests/compobj.c
@@ -1782,6 +1782,7 @@ static void test_CoGetObjectContext(void)
     struct info info;
     HANDLE thread;
     DWORD tid, exitcode;
+    GUID id, id2;
 
     if (!pCoGetObjectContext)
     {
@@ -1810,6 +1811,17 @@ static void test_CoGetObjectContext(void)
     pComThreadingInfo = NULL;
     hr = pCoGetObjectContext(&IID_IComThreadingInfo, (void **)&pComThreadingInfo);
     ok(hr == S_OK, "Expected S_OK, got 0x%08x\n", hr);
+
+    hr = IComThreadingInfo_GetCurrentLogicalThreadId(pComThreadingInfo, NULL);
+    ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+
+    id = id2 = GUID_NULL;
+    hr = IComThreadingInfo_GetCurrentLogicalThreadId(pComThreadingInfo, &id);
+    ok(hr == S_OK, "got 0x%08x\n", hr);
+
+    hr = CoGetCurrentLogicalThreadId(&id2);
+    ok(IsEqualGUID(&id, &id2), "got %s, expected %s\n", wine_dbgstr_guid(&id), wine_dbgstr_guid(&id2));
+
     IComThreadingInfo_Release(pComThreadingInfo);
 
     SetEvent(info.stop);




More information about the wine-cvs mailing list