[PATCH] ole32: Implement CoGetCurrentLogicalThreadId()
Nikolay Sivov
nsivov at codeweavers.com
Wed Mar 9 14:43:26 CST 2016
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
For https://bugs.winehq.org/show_bug.cgi?id=17540
dlls/ole32/compobj.c | 14 ++++++++++++++
dlls/ole32/ole2stubs.c | 8 --------
dlls/ole32/tests/compobj.c | 16 ++++++++++++++++
include/objbase.h | 1 +
4 files changed, 31 insertions(+), 8 deletions(-)
diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c
index de7438c..91f11f6 100644
--- a/dlls/ole32/compobj.c
+++ b/dlls/ole32/compobj.c
@@ -3850,6 +3850,20 @@ DWORD WINAPI CoGetCurrentProcess(void)
return GetCurrentProcessId();
}
+/***********************************************************************
+ * CoGetCurrentLogicalThreadId [OLE32.@]
+ */
+HRESULT WINAPI CoGetCurrentLogicalThreadId(GUID *id)
+{
+ TRACE("(%p)\n", id);
+
+ if (!id)
+ return E_INVALIDARG;
+
+ *id = COM_CurrentCausalityId();
+ return S_OK;
+}
+
/******************************************************************************
* CoRegisterMessageFilter [OLE32.@]
*
diff --git a/dlls/ole32/ole2stubs.c b/dlls/ole32/ole2stubs.c
index 1f8b9f8..7fdde95 100644
--- a/dlls/ole32/ole2stubs.c
+++ b/dlls/ole32/ole2stubs.c
@@ -84,11 +84,3 @@ HRESULT WINAPI CoGetCallerTID(LPDWORD lpdwTID)
return E_NOTIMPL;
}
-/***********************************************************************
- * CoGetCurrentLogicalThreadId [OLE32.@]
- */
-HRESULT WINAPI CoGetCurrentLogicalThreadId(GUID *pguid)
-{
- FIXME(": stub\n");
- return E_NOTIMPL;
-}
diff --git a/dlls/ole32/tests/compobj.c b/dlls/ole32/tests/compobj.c
index 183d8a0..e0c396f 100644
--- a/dlls/ole32/tests/compobj.c
+++ b/dlls/ole32/tests/compobj.c
@@ -3093,6 +3093,21 @@ static void test_IMallocSpy(void)
ok(hr == CO_E_OBJNOTREG, "got 0x%08x\n", hr);
}
+static void test_CoGetCurrentLogicalThreadId(void)
+{
+ GUID id, id2;
+ HRESULT hr;
+
+ hr = CoGetCurrentLogicalThreadId(NULL);
+ ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+
+ memset(&id, 0, sizeof(id));
+ memset(&id2, 0, sizeof(id2));
+ hr = CoGetCurrentLogicalThreadId(&id);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(memcmp(&id, &id2, sizeof(id)), "got zero id\n");
+}
+
static void init_funcs(void)
{
HMODULE hOle32 = GetModuleHandleA("ole32");
@@ -3161,4 +3176,5 @@ START_TEST(compobj)
test_OleRegGetUserType();
test_CoGetApartmentType();
test_IMallocSpy();
+ test_CoGetCurrentLogicalThreadId();
}
diff --git a/include/objbase.h b/include/objbase.h
index 02656d1..43f3357 100644
--- a/include/objbase.h
+++ b/include/objbase.h
@@ -285,6 +285,7 @@ HRESULT WINAPI CoInitialize(LPVOID lpReserved);
HRESULT WINAPI CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit);
void WINAPI CoUninitialize(void);
DWORD WINAPI CoGetCurrentProcess(void);
+HRESULT WINAPI CoGetCurrentLogicalThreadId(GUID *id);
HRESULT WINAPI CoGetApartmentType(APTTYPE *type, APTTYPEQUALIFIER *qualifier);
HINSTANCE WINAPI CoLoadLibrary(LPOLESTR lpszLibName, BOOL bAutoFree);
--
2.7.0
More information about the wine-patches
mailing list