Signed-off-by: Nikolay Sivov nsivov@codeweavers.com ---
Both internal functions will go away once relevant parts are moved to one place. InternalIsInitialized() is equivalent to combase.InternalIsProcessInitialized, that we could introduce is ole32 will need to such test.
dlls/combase/combase.c | 177 ++++++++++++++++++++++++++++ dlls/combase/combase.spec | 5 +- dlls/ole32/compobj.c | 235 +++----------------------------------- dlls/ole32/ole32.spec | 5 +- 4 files changed, 197 insertions(+), 225 deletions(-)
diff --git a/dlls/combase/combase.c b/dlls/combase/combase.c index 96c6a9bb817..516e8c9fd40 100644 --- a/dlls/combase/combase.c +++ b/dlls/combase/combase.c @@ -59,6 +59,18 @@ struct comclassredirect_data DWORD miscstatusdocprint; };
+struct ifacepsredirect_data +{ + ULONG size; + DWORD mask; + GUID iid; + ULONG nummethods; + GUID tlbid; + GUID base; + ULONG name_len; + ULONG name_offset; +}; + struct progidredirect_data { ULONG size; @@ -73,6 +85,26 @@ struct init_spy unsigned int id; };
+struct registered_ps +{ + struct list entry; + IID iid; + CLSID clsid; +}; + +static struct list registered_proxystubs = LIST_INIT(registered_proxystubs); + +static CRITICAL_SECTION cs_registered_ps; +static CRITICAL_SECTION_DEBUG psclsid_cs_debug = +{ + 0, 0, &cs_registered_ps, + { &psclsid_cs_debug.ProcessLocksList, &psclsid_cs_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": cs_registered_psclsid_list") } +}; +static CRITICAL_SECTION cs_registered_ps = { &psclsid_cs_debug, -1, 0, 0, 0, 0 }; + +extern BOOL WINAPI InternalIsInitialized(void); + static struct init_spy *get_spy_entry(struct tlsdata *tlsdata, unsigned int id) { struct init_spy *spy; @@ -1721,3 +1753,148 @@ HRESULT WINAPI CoRegisterMessageFilter(IMessageFilter *filter, IMessageFilter **
return S_OK; } + +void WINAPI InternalRevokeAllPSClsids(void) +{ + struct registered_ps *cur, *cur2; + + EnterCriticalSection(&cs_registered_ps); + + LIST_FOR_EACH_ENTRY_SAFE(cur, cur2, ®istered_proxystubs, struct registered_ps, entry) + { + list_remove(&cur->entry); + heap_free(cur); + } + + LeaveCriticalSection(&cs_registered_ps); +} + +static HRESULT get_ps_clsid_from_registry(const WCHAR* path, REGSAM access, CLSID *pclsid) +{ + WCHAR value[CHARS_IN_GUID]; + HKEY hkey; + DWORD len; + + access |= KEY_READ; + + if (open_classes_key(HKEY_CLASSES_ROOT, path, access, &hkey)) + return REGDB_E_IIDNOTREG; + + len = sizeof(value); + if (ERROR_SUCCESS != RegQueryValueExW(hkey, NULL, NULL, NULL, (BYTE *)value, &len)) + return REGDB_E_IIDNOTREG; + RegCloseKey(hkey); + + if (CLSIDFromString(value, pclsid) != NOERROR) + return REGDB_E_IIDNOTREG; + + return S_OK; +} + +/***************************************************************************** + * CoGetPSClsid (combase.@) + */ +HRESULT WINAPI CoGetPSClsid(REFIID riid, CLSID *pclsid) +{ + static const WCHAR interfaceW[] = L"Interface\"; + static const WCHAR psW[] = L"\ProxyStubClsid32"; + WCHAR path[ARRAY_SIZE(interfaceW) - 1 + CHARS_IN_GUID - 1 + ARRAY_SIZE(psW)]; + ACTCTX_SECTION_KEYED_DATA data; + struct registered_ps *cur; + REGSAM opposite = (sizeof(void*) > sizeof(int)) ? KEY_WOW64_32KEY : KEY_WOW64_64KEY; + BOOL is_wow64; + HRESULT hr; + + TRACE("%s, %p\n", debugstr_guid(riid), pclsid); + + if (!InternalIsInitialized()) + { + ERR("apartment not initialised\n"); + return CO_E_NOTINITIALIZED; + } + + if (!pclsid) + return E_INVALIDARG; + + EnterCriticalSection(&cs_registered_ps); + + LIST_FOR_EACH_ENTRY(cur, ®istered_proxystubs, struct registered_ps, entry) + { + if (IsEqualIID(&cur->iid, riid)) + { + *pclsid = cur->clsid; + LeaveCriticalSection(&cs_registered_ps); + return S_OK; + } + } + + LeaveCriticalSection(&cs_registered_ps); + + data.cbSize = sizeof(data); + if (FindActCtxSectionGuid(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION, + riid, &data)) + { + struct ifacepsredirect_data *ifaceps = (struct ifacepsredirect_data *)data.lpData; + *pclsid = ifaceps->iid; + return S_OK; + } + + /* Interface\{string form of riid}\ProxyStubClsid32 */ + lstrcpyW(path, interfaceW); + StringFromGUID2(riid, path + ARRAY_SIZE(interfaceW) - 1, CHARS_IN_GUID); + lstrcpyW(path + ARRAY_SIZE(interfaceW) - 1 + CHARS_IN_GUID - 1, psW); + + hr = get_ps_clsid_from_registry(path, 0, pclsid); + if (FAILED(hr) && (opposite == KEY_WOW64_32KEY || (IsWow64Process(GetCurrentProcess(), &is_wow64) && is_wow64))) + hr = get_ps_clsid_from_registry(path, opposite, pclsid); + + if (hr == S_OK) + TRACE("() Returning CLSID %s\n", debugstr_guid(pclsid)); + else + WARN("No PSFactoryBuffer object is registered for IID %s\n", debugstr_guid(riid)); + + return hr; +} + +/***************************************************************************** + * CoRegisterPSClsid (combase.@) + */ +HRESULT WINAPI CoRegisterPSClsid(REFIID riid, REFCLSID rclsid) +{ + struct registered_ps *cur; + + TRACE("%s, %s\n", debugstr_guid(riid), debugstr_guid(rclsid)); + + if (!InternalIsInitialized()) + { + ERR("apartment not initialised\n"); + return CO_E_NOTINITIALIZED; + } + + EnterCriticalSection(&cs_registered_ps); + + LIST_FOR_EACH_ENTRY(cur, ®istered_proxystubs, struct registered_ps, entry) + { + if (IsEqualIID(&cur->iid, riid)) + { + cur->clsid = *rclsid; + LeaveCriticalSection(&cs_registered_ps); + return S_OK; + } + } + + cur = heap_alloc(sizeof(*cur)); + if (!cur) + { + LeaveCriticalSection(&cs_registered_ps); + return E_OUTOFMEMORY; + } + + cur->iid = *riid; + cur->clsid = *rclsid; + list_add_head(®istered_proxystubs, &cur->entry); + + LeaveCriticalSection(&cs_registered_ps); + + return S_OK; +} diff --git a/dlls/combase/combase.spec b/dlls/combase/combase.spec index bb7eaf69f9d..02004852aa8 100644 --- a/dlls/combase/combase.spec +++ b/dlls/combase/combase.spec @@ -115,7 +115,7 @@ @ stdcall CoGetMarshalSizeMax(ptr ptr ptr long ptr long) @ stub CoGetModuleType @ stdcall CoGetObjectContext(ptr ptr) -@ stdcall CoGetPSClsid(ptr ptr) ole32.CoGetPSClsid +@ stdcall CoGetPSClsid(ptr ptr) @ stub CoGetProcessIdentifier @ stdcall CoGetStandardMarshal(ptr ptr long ptr long ptr) ole32.CoGetStandardMarshal @ stub CoGetStdMarshalEx @@ -143,7 +143,7 @@ @ stdcall CoRegisterInitializeSpy(ptr ptr) @ stdcall CoRegisterMallocSpy(ptr) @ stdcall CoRegisterMessageFilter(ptr ptr) -@ stdcall CoRegisterPSClsid(ptr ptr) ole32.CoRegisterPSClsid +@ stdcall CoRegisterPSClsid(ptr ptr) @ stdcall CoRegisterSurrogate(ptr) ole32.CoRegisterSurrogate @ stdcall CoRegisterSurrogateEx(ptr ptr) ole32.CoRegisterSurrogateEx @ stdcall CoReleaseMarshalData(ptr) ole32.CoReleaseMarshalData @@ -268,6 +268,7 @@ @ stub InternalNotifyDDStartOrStop @ stub InternalOleModalLoopBlockFn @ stub InternalRegisterWindowPropInterface +@ stdcall InternalRevokeAllPSClsids() @ stub InternalReleaseMarshalObjRef @ stub InternalSTAInvoke @ stub InternalServerExceptionFilter diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c index f02cdb8b53f..e8cc75c7de4 100644 --- a/dlls/ole32/compobj.c +++ b/dlls/ole32/compobj.c @@ -164,24 +164,6 @@ struct class_reg_data } u; };
-struct registered_psclsid -{ - struct list entry; - IID iid; - CLSID clsid; -}; - -static struct list registered_psclsid_list = LIST_INIT(registered_psclsid_list); - -static CRITICAL_SECTION cs_registered_psclsid_list; -static CRITICAL_SECTION_DEBUG psclsid_cs_debug = -{ - 0, 0, &cs_registered_psclsid_list, - { &psclsid_cs_debug.ProcessLocksList, &psclsid_cs_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": cs_registered_psclsid_list") } -}; -static CRITICAL_SECTION cs_registered_psclsid_list = { &psclsid_cs_debug, -1, 0, 0, 0, 0 }; - /* * This is a marshallable object exposing registered local servers. * IServiceProvider is used only because it happens meet requirements @@ -236,6 +218,8 @@ static CRITICAL_SECTION_DEBUG class_cs_debug = }; static CRITICAL_SECTION csRegisteredClassList = { &class_cs_debug, -1, 0, 0, 0, 0 };
+extern void WINAPI InternalRevokeAllPSClsids(void); + static inline enum comclass_miscfields dvaspect_to_miscfields(DWORD aspect) { switch (aspect) @@ -776,21 +760,6 @@ static void COM_RevokeAllClasses(const struct apartment *apt) LeaveCriticalSection( &csRegisteredClassList ); }
-static void revoke_registered_psclsids(void) -{ - struct registered_psclsid *psclsid, *psclsid2; - - EnterCriticalSection( &cs_registered_psclsid_list ); - - LIST_FOR_EACH_ENTRY_SAFE(psclsid, psclsid2, ®istered_psclsid_list, struct registered_psclsid, entry) - { - list_remove(&psclsid->entry); - HeapFree(GetProcessHeap(), 0, psclsid); - } - - LeaveCriticalSection( &cs_registered_psclsid_list ); -} - /****************************************************************************** * Implementation of the manual reset event object. (CLSID_ManualResetEvent) */ @@ -1997,7 +1966,7 @@ void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void) { TRACE("() - Releasing the COM libraries\n");
- revoke_registered_psclsids(); + InternalRevokeAllPSClsids(); RunningObjectTableImpl_UnInitialize(); } else if (lCOMRefCnt<1) { @@ -2145,193 +2114,6 @@ HRESULT COM_OpenKeyForAppIdFromCLSID(REFCLSID clsid, REGSAM access, HKEY *subkey return S_OK; }
-static HRESULT get_ps_clsid_from_registry(const WCHAR* path, REGSAM access, CLSID *pclsid) -{ - HKEY hkey; - WCHAR value[CHARS_IN_GUID]; - DWORD len; - - access |= KEY_READ; - - if (open_classes_key(HKEY_CLASSES_ROOT, path, access, &hkey)) - return REGDB_E_IIDNOTREG; - - len = sizeof(value); - if (ERROR_SUCCESS != RegQueryValueExW(hkey, NULL, NULL, NULL, (BYTE *)value, &len)) - return REGDB_E_IIDNOTREG; - RegCloseKey(hkey); - - if (CLSIDFromString(value, pclsid) != NOERROR) - return REGDB_E_IIDNOTREG; - - return S_OK; -} - -/***************************************************************************** - * CoGetPSClsid [OLE32.@] - * - * Retrieves the CLSID of the proxy/stub factory that implements - * IPSFactoryBuffer for the specified interface. - * - * PARAMS - * riid [I] Interface whose proxy/stub CLSID is to be returned. - * pclsid [O] Where to store returned proxy/stub CLSID. - * - * RETURNS - * S_OK - * E_OUTOFMEMORY - * REGDB_E_IIDNOTREG if no PSFactoryBuffer is associated with the IID, or it could not be parsed - * - * NOTES - * - * The standard marshaller activates the object with the CLSID - * returned and uses the CreateProxy and CreateStub methods on its - * IPSFactoryBuffer interface to construct the proxies and stubs for a - * given object. - * - * CoGetPSClsid determines this CLSID by searching the - * HKEY_CLASSES_ROOT\Interface{string form of riid}\ProxyStubClsid32 - * in the registry and any interface id registered by - * CoRegisterPSClsid within the current process. - * - * BUGS - * - * Native returns S_OK for interfaces with a key in HKCR\Interface, but - * without a ProxyStubClsid32 key and leaves garbage in pclsid. This should be - * considered a bug in native unless an application depends on this (unlikely). - * - * SEE ALSO - * CoRegisterPSClsid. - */ -HRESULT WINAPI CoGetPSClsid(REFIID riid, CLSID *pclsid) -{ - static const WCHAR wszInterface[] = {'I','n','t','e','r','f','a','c','e','\',0}; - static const WCHAR wszPSC[] = {'\','P','r','o','x','y','S','t','u','b','C','l','s','i','d','3','2',0}; - WCHAR path[ARRAY_SIZE(wszInterface) - 1 + CHARS_IN_GUID - 1 + ARRAY_SIZE(wszPSC)]; - APARTMENT *apt; - struct registered_psclsid *registered_psclsid; - ACTCTX_SECTION_KEYED_DATA data; - HRESULT hr; - REGSAM opposite = (sizeof(void*) > sizeof(int)) ? KEY_WOW64_32KEY : KEY_WOW64_64KEY; - BOOL is_wow64; - - TRACE("() riid=%s, pclsid=%p\n", debugstr_guid(riid), pclsid); - - if (!(apt = apartment_get_current_or_mta())) - { - ERR("apartment not initialised\n"); - return CO_E_NOTINITIALIZED; - } - apartment_release(apt); - - if (!pclsid) - return E_INVALIDARG; - - EnterCriticalSection(&cs_registered_psclsid_list); - - LIST_FOR_EACH_ENTRY(registered_psclsid, ®istered_psclsid_list, struct registered_psclsid, entry) - if (IsEqualIID(®istered_psclsid->iid, riid)) - { - *pclsid = registered_psclsid->clsid; - LeaveCriticalSection(&cs_registered_psclsid_list); - return S_OK; - } - - LeaveCriticalSection(&cs_registered_psclsid_list); - - data.cbSize = sizeof(data); - if (FindActCtxSectionGuid(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION, - riid, &data)) - { - struct ifacepsredirect_data *ifaceps = (struct ifacepsredirect_data*)data.lpData; - *pclsid = ifaceps->iid; - return S_OK; - } - - /* Interface\{string form of riid}\ProxyStubClsid32 */ - lstrcpyW(path, wszInterface); - StringFromGUID2(riid, path + ARRAY_SIZE(wszInterface) - 1, CHARS_IN_GUID); - lstrcpyW(path + ARRAY_SIZE(wszInterface) - 1 + CHARS_IN_GUID - 1, wszPSC); - - hr = get_ps_clsid_from_registry(path, 0, pclsid); - if (FAILED(hr) && (opposite == KEY_WOW64_32KEY || - (IsWow64Process(GetCurrentProcess(), &is_wow64) && is_wow64))) - hr = get_ps_clsid_from_registry(path, opposite, pclsid); - - if (hr == S_OK) - TRACE ("() Returning CLSID=%s\n", debugstr_guid(pclsid)); - else - WARN("No PSFactoryBuffer object is registered for IID %s\n", debugstr_guid(riid)); - - return hr; -} - -/***************************************************************************** - * CoRegisterPSClsid [OLE32.@] - * - * Register a proxy/stub CLSID for the given interface in the current process - * only. - * - * PARAMS - * riid [I] Interface whose proxy/stub CLSID is to be registered. - * rclsid [I] CLSID of the proxy/stub. - * - * RETURNS - * Success: S_OK - * Failure: E_OUTOFMEMORY - * - * NOTES - * - * Unlike CoRegisterClassObject(), CLSIDs registered with CoRegisterPSClsid() - * will be returned from other apartments in the same process. - * - * This function does not add anything to the registry and the effects are - * limited to the lifetime of the current process. - * - * SEE ALSO - * CoGetPSClsid. - */ -HRESULT WINAPI CoRegisterPSClsid(REFIID riid, REFCLSID rclsid) -{ - APARTMENT *apt; - struct registered_psclsid *registered_psclsid; - - TRACE("(%s, %s)\n", debugstr_guid(riid), debugstr_guid(rclsid)); - - if (!(apt = apartment_get_current_or_mta())) - { - ERR("apartment not initialised\n"); - return CO_E_NOTINITIALIZED; - } - apartment_release(apt); - - EnterCriticalSection(&cs_registered_psclsid_list); - - LIST_FOR_EACH_ENTRY(registered_psclsid, ®istered_psclsid_list, struct registered_psclsid, entry) - if (IsEqualIID(®istered_psclsid->iid, riid)) - { - registered_psclsid->clsid = *rclsid; - LeaveCriticalSection(&cs_registered_psclsid_list); - return S_OK; - } - - registered_psclsid = HeapAlloc(GetProcessHeap(), 0, sizeof(struct registered_psclsid)); - if (!registered_psclsid) - { - LeaveCriticalSection(&cs_registered_psclsid_list); - return E_OUTOFMEMORY; - } - - registered_psclsid->iid = *riid; - registered_psclsid->clsid = *rclsid; - list_add_head(®istered_psclsid_list, ®istered_psclsid->entry); - - LeaveCriticalSection(&cs_registered_psclsid_list); - - return S_OK; -} - - /*** * COM_GetRegisteredClassObject * @@ -3872,6 +3654,17 @@ HRESULT WINAPI CoRegisterSurrogateEx(REFGUID guid, void *reserved) return E_NOTIMPL; }
+BOOL WINAPI InternalIsInitialized(void) +{ + struct apartment *apt; + + if (!(apt = apartment_get_current_or_mta())) + return FALSE; + apartment_release(apt); + + return TRUE; +} + typedef struct { IGlobalOptions IGlobalOptions_iface; LONG ref; diff --git a/dlls/ole32/ole32.spec b/dlls/ole32/ole32.spec index ed5a958ce3c..02a8434d264 100644 --- a/dlls/ole32/ole32.spec +++ b/dlls/ole32/ole32.spec @@ -42,7 +42,7 @@ @ stdcall CoGetMarshalSizeMax(ptr ptr ptr long ptr long) combase.CoGetMarshalSizeMax @ stdcall CoGetObject(wstr ptr ptr ptr) @ stdcall CoGetObjectContext(ptr ptr) combase.CoGetObjectContext -@ stdcall CoGetPSClsid(ptr ptr) +@ stdcall CoGetPSClsid(ptr ptr) combase.CoGetPSClsid @ stdcall CoGetStandardMarshal(ptr ptr long ptr long ptr) @ stdcall CoGetState(ptr) @ stub CoGetTIDFromIPID @@ -69,7 +69,7 @@ @ stdcall CoRegisterInitializeSpy(ptr ptr) combase.CoRegisterInitializeSpy @ stdcall CoRegisterMallocSpy(ptr) combase.CoRegisterMallocSpy @ stdcall CoRegisterMessageFilter(ptr ptr) combase.CoRegisterMessageFilter -@ stdcall CoRegisterPSClsid(ptr ptr) +@ stdcall CoRegisterPSClsid(ptr ptr) combase.CoRegisterPSClsid @ stdcall CoRegisterSurrogate(ptr) @ stdcall CoRegisterSurrogateEx(ptr ptr) @ stdcall CoReleaseMarshalData(ptr) @@ -297,3 +297,4 @@ @ stdcall WriteFmtUserTypeStg(ptr long ptr) @ stub WriteOleStg @ stub WriteStringStream +@ stdcall InternalIsInitialized()
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/combase/combase.c | 313 +++++++++++++++++++++++++++++++++++ dlls/combase/combase.spec | 2 +- dlls/ole32/compobj.c | 336 -------------------------------------- dlls/ole32/ole32.spec | 2 +- 4 files changed, 315 insertions(+), 338 deletions(-)
diff --git a/dlls/combase/combase.c b/dlls/combase/combase.c index 516e8c9fd40..a2e5ac93a53 100644 --- a/dlls/combase/combase.c +++ b/dlls/combase/combase.c @@ -24,6 +24,7 @@ #define WIN32_NO_STATUS #define USE_COM_CONTEXT_DEF #include "objbase.h" +#include "ctxtcall.h" #include "oleauto.h" #include "dde.h" #include "winternl.h" @@ -1898,3 +1899,315 @@ HRESULT WINAPI CoRegisterPSClsid(REFIID riid, REFCLSID rclsid)
return S_OK; } + +struct thread_context +{ + IComThreadingInfo IComThreadingInfo_iface; + IContextCallback IContextCallback_iface; + IObjContext IObjContext_iface; + LONG refcount; +}; + +static inline struct thread_context *impl_from_IComThreadingInfo(IComThreadingInfo *iface) +{ + return CONTAINING_RECORD(iface, struct thread_context, IComThreadingInfo_iface); +} + +static inline struct thread_context *impl_from_IContextCallback(IContextCallback *iface) +{ + return CONTAINING_RECORD(iface, struct thread_context, IContextCallback_iface); +} + +static inline struct thread_context *impl_from_IObjContext(IObjContext *iface) +{ + return CONTAINING_RECORD(iface, struct thread_context, IObjContext_iface); +} + +static HRESULT WINAPI thread_context_info_QueryInterface(IComThreadingInfo *iface, REFIID riid, void **obj) +{ + struct thread_context *context = impl_from_IComThreadingInfo(iface); + + *obj = NULL; + + if (IsEqualIID(riid, &IID_IComThreadingInfo) || + IsEqualIID(riid, &IID_IUnknown)) + { + *obj = &context->IComThreadingInfo_iface; + } + else if (IsEqualIID(riid, &IID_IContextCallback)) + { + *obj = &context->IContextCallback_iface; + } + else if (IsEqualIID(riid, &IID_IObjContext)) + { + *obj = &context->IObjContext_iface; + } + + if (*obj) + { + IUnknown_AddRef((IUnknown *)*obj); + return S_OK; + } + + FIXME("interface not implemented %s\n", debugstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI thread_context_info_AddRef(IComThreadingInfo *iface) +{ + struct thread_context *context = impl_from_IComThreadingInfo(iface); + return InterlockedIncrement(&context->refcount); +} + +static ULONG WINAPI thread_context_info_Release(IComThreadingInfo *iface) +{ + struct thread_context *context = impl_from_IComThreadingInfo(iface); + + /* Context instance is initially created with CoGetContextToken() with refcount set to 0, + releasing context while refcount is at 0 destroys it. */ + if (!context->refcount) + { + heap_free(context); + return 0; + } + + return InterlockedDecrement(&context->refcount); +} + +static HRESULT WINAPI thread_context_info_GetCurrentApartmentType(IComThreadingInfo *iface, APTTYPE *apttype) +{ + APTTYPEQUALIFIER qualifier; + + TRACE("%p\n", apttype); + + return CoGetApartmentType(apttype, &qualifier); +} + +static HRESULT WINAPI thread_context_info_GetCurrentThreadType(IComThreadingInfo *iface, THDTYPE *thdtype) +{ + APTTYPEQUALIFIER qualifier; + APTTYPE apttype; + HRESULT hr; + + hr = CoGetApartmentType(&apttype, &qualifier); + if (FAILED(hr)) + return hr; + + TRACE("%p\n", thdtype); + + switch (apttype) + { + case APTTYPE_STA: + case APTTYPE_MAINSTA: + *thdtype = THDTYPE_PROCESSMESSAGES; + break; + default: + *thdtype = THDTYPE_BLOCKMESSAGES; + break; + } + return S_OK; +} + +static HRESULT WINAPI thread_context_info_GetCurrentLogicalThreadId(IComThreadingInfo *iface, GUID *logical_thread_id) +{ + TRACE("%p\n", logical_thread_id); + + return CoGetCurrentLogicalThreadId(logical_thread_id); +} + +static HRESULT WINAPI thread_context_info_SetCurrentLogicalThreadId(IComThreadingInfo *iface, REFGUID logical_thread_id) +{ + FIXME("%s stub\n", debugstr_guid(logical_thread_id)); + + return E_NOTIMPL; +} + +static const IComThreadingInfoVtbl thread_context_info_vtbl = +{ + thread_context_info_QueryInterface, + thread_context_info_AddRef, + thread_context_info_Release, + thread_context_info_GetCurrentApartmentType, + thread_context_info_GetCurrentThreadType, + thread_context_info_GetCurrentLogicalThreadId, + thread_context_info_SetCurrentLogicalThreadId +}; + +static HRESULT WINAPI thread_context_callback_QueryInterface(IContextCallback *iface, REFIID riid, void **obj) +{ + struct thread_context *context = impl_from_IContextCallback(iface); + return IComThreadingInfo_QueryInterface(&context->IComThreadingInfo_iface, riid, obj); +} + +static ULONG WINAPI thread_context_callback_AddRef(IContextCallback *iface) +{ + struct thread_context *context = impl_from_IContextCallback(iface); + return IComThreadingInfo_AddRef(&context->IComThreadingInfo_iface); +} + +static ULONG WINAPI thread_context_callback_Release(IContextCallback *iface) +{ + struct thread_context *context = impl_from_IContextCallback(iface); + return IComThreadingInfo_Release(&context->IComThreadingInfo_iface); +} + +static HRESULT WINAPI thread_context_callback_ContextCallback(IContextCallback *iface, + PFNCONTEXTCALL callback, ComCallData *param, REFIID riid, int method, IUnknown *punk) +{ + FIXME("%p, %p, %p, %s, %d, %p\n", iface, callback, param, debugstr_guid(riid), method, punk); + + return E_NOTIMPL; +} + +static const IContextCallbackVtbl thread_context_callback_vtbl = +{ + thread_context_callback_QueryInterface, + thread_context_callback_AddRef, + thread_context_callback_Release, + thread_context_callback_ContextCallback +}; + +static HRESULT WINAPI thread_object_context_QueryInterface(IObjContext *iface, REFIID riid, void **obj) +{ + struct thread_context *context = impl_from_IObjContext(iface); + return IComThreadingInfo_QueryInterface(&context->IComThreadingInfo_iface, riid, obj); +} + +static ULONG WINAPI thread_object_context_AddRef(IObjContext *iface) +{ + struct thread_context *context = impl_from_IObjContext(iface); + return IComThreadingInfo_AddRef(&context->IComThreadingInfo_iface); +} + +static ULONG WINAPI thread_object_context_Release(IObjContext *iface) +{ + struct thread_context *context = impl_from_IObjContext(iface); + return IComThreadingInfo_Release(&context->IComThreadingInfo_iface); +} + +static HRESULT WINAPI thread_object_context_SetProperty(IObjContext *iface, REFGUID propid, CPFLAGS flags, IUnknown *punk) +{ + FIXME("%p, %s, %x, %p\n", iface, debugstr_guid(propid), flags, punk); + + return E_NOTIMPL; +} + +static HRESULT WINAPI thread_object_context_RemoveProperty(IObjContext *iface, REFGUID propid) +{ + FIXME("%p, %s\n", iface, debugstr_guid(propid)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI thread_object_context_GetProperty(IObjContext *iface, REFGUID propid, CPFLAGS *flags, IUnknown **punk) +{ + FIXME("%p, %s, %p, %p\n", iface, debugstr_guid(propid), flags, punk); + + return E_NOTIMPL; +} + +static HRESULT WINAPI thread_object_context_EnumContextProps(IObjContext *iface, IEnumContextProps **props) +{ + FIXME("%p, %p\n", iface, props); + + return E_NOTIMPL; +} + +static void WINAPI thread_object_context_Reserved1(IObjContext *iface) +{ + FIXME("%p\n", iface); +} + +static void WINAPI thread_object_context_Reserved2(IObjContext *iface) +{ + FIXME("%p\n", iface); +} + +static void WINAPI thread_object_context_Reserved3(IObjContext *iface) +{ + FIXME("%p\n", iface); +} + +static void WINAPI thread_object_context_Reserved4(IObjContext *iface) +{ + FIXME("%p\n", iface); +} + +static void WINAPI thread_object_context_Reserved5(IObjContext *iface) +{ + FIXME("%p\n", iface); +} + +static void WINAPI thread_object_context_Reserved6(IObjContext *iface) +{ + FIXME("%p\n", iface); +} + +static void WINAPI thread_object_context_Reserved7(IObjContext *iface) +{ + FIXME("%p\n", iface); +} + +static const IObjContextVtbl thread_object_context_vtbl = +{ + thread_object_context_QueryInterface, + thread_object_context_AddRef, + thread_object_context_Release, + thread_object_context_SetProperty, + thread_object_context_RemoveProperty, + thread_object_context_GetProperty, + thread_object_context_EnumContextProps, + thread_object_context_Reserved1, + thread_object_context_Reserved2, + thread_object_context_Reserved3, + thread_object_context_Reserved4, + thread_object_context_Reserved5, + thread_object_context_Reserved6, + thread_object_context_Reserved7 +}; + +/*********************************************************************** + * CoGetContextToken (combase.@) + */ +HRESULT WINAPI CoGetContextToken(ULONG_PTR *token) +{ + struct tlsdata *tlsdata; + HRESULT hr; + + TRACE("%p\n", token); + + if (!InternalIsInitialized()) + { + ERR("apartment not initialised\n"); + return CO_E_NOTINITIALIZED; + } + + if (FAILED(hr = com_get_tlsdata(&tlsdata))) + return hr; + + if (!token) + return E_POINTER; + + if (!tlsdata->context_token) + { + struct thread_context *context; + + context = heap_alloc_zero(sizeof(*context)); + if (!context) + return E_OUTOFMEMORY; + + context->IComThreadingInfo_iface.lpVtbl = &thread_context_info_vtbl; + context->IContextCallback_iface.lpVtbl = &thread_context_callback_vtbl; + context->IObjContext_iface.lpVtbl = &thread_object_context_vtbl; + /* Context token does not take a reference, it's always zero until the + interface is explicitly requested with CoGetObjectContext(). */ + context->refcount = 0; + + tlsdata->context_token = &context->IObjContext_iface; + } + + *token = (ULONG_PTR)tlsdata->context_token; + TRACE("context_token %p\n", tlsdata->context_token); + + return S_OK; +} diff --git a/dlls/combase/combase.spec b/dlls/combase/combase.spec index 02004852aa8..806ee015371 100644 --- a/dlls/combase/combase.spec +++ b/dlls/combase/combase.spec @@ -103,7 +103,7 @@ @ stub CoGetCancelObject @ stdcall CoGetClassObject(ptr long ptr ptr ptr) ole32.CoGetClassObject @ stub CoGetClassVersion -@ stdcall CoGetContextToken(ptr) ole32.CoGetContextToken +@ stdcall CoGetContextToken(ptr) @ stdcall CoGetCurrentLogicalThreadId(ptr) ole32.CoGetCurrentLogicalThreadId @ stdcall CoGetCurrentProcess() ole32.CoGetCurrentProcess @ stdcall CoGetDefaultContext(long ptr ptr) diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c index e8cc75c7de4..83644782589 100644 --- a/dlls/ole32/compobj.c +++ b/dlls/ole32/compobj.c @@ -3142,342 +3142,6 @@ HRESULT WINAPI CoRegisterChannelHook(REFGUID guidExtension, IChannelHook *pChann return RPC_RegisterChannelHook(guidExtension, pChannelHook); }
-typedef struct Context -{ - IComThreadingInfo IComThreadingInfo_iface; - IContextCallback IContextCallback_iface; - IObjContext IObjContext_iface; - LONG refs; -} Context; - -static inline Context *impl_from_IComThreadingInfo( IComThreadingInfo *iface ) -{ - return CONTAINING_RECORD(iface, Context, IComThreadingInfo_iface); -} - -static inline Context *impl_from_IContextCallback( IContextCallback *iface ) -{ - return CONTAINING_RECORD(iface, Context, IContextCallback_iface); -} - -static inline Context *impl_from_IObjContext( IObjContext *iface ) -{ - return CONTAINING_RECORD(iface, Context, IObjContext_iface); -} - -static HRESULT Context_QueryInterface(Context *iface, REFIID riid, LPVOID *ppv) -{ - *ppv = NULL; - - if (IsEqualIID(riid, &IID_IComThreadingInfo) || - IsEqualIID(riid, &IID_IUnknown)) - { - *ppv = &iface->IComThreadingInfo_iface; - } - else if (IsEqualIID(riid, &IID_IContextCallback)) - { - *ppv = &iface->IContextCallback_iface; - } - else if (IsEqualIID(riid, &IID_IObjContext)) - { - *ppv = &iface->IObjContext_iface; - } - - if (*ppv) - { - IUnknown_AddRef((IUnknown*)*ppv); - return S_OK; - } - - FIXME("interface not implemented %s\n", debugstr_guid(riid)); - return E_NOINTERFACE; -} - -static ULONG Context_AddRef(Context *This) -{ - return InterlockedIncrement(&This->refs); -} - -static ULONG Context_Release(Context *This) -{ - /* Context instance is initially created with CoGetContextToken() with refcount set to 0, - releasing context while refcount is at 0 destroys it. */ - if (!This->refs) - { - HeapFree(GetProcessHeap(), 0, This); - return 0; - } - - return InterlockedDecrement(&This->refs); -} - -static HRESULT WINAPI Context_CTI_QueryInterface(IComThreadingInfo *iface, REFIID riid, LPVOID *ppv) -{ - Context *This = impl_from_IComThreadingInfo(iface); - return Context_QueryInterface(This, riid, ppv); -} - -static ULONG WINAPI Context_CTI_AddRef(IComThreadingInfo *iface) -{ - Context *This = impl_from_IComThreadingInfo(iface); - return Context_AddRef(This); -} - -static ULONG WINAPI Context_CTI_Release(IComThreadingInfo *iface) -{ - Context *This = impl_from_IComThreadingInfo(iface); - return Context_Release(This); -} - -static HRESULT WINAPI Context_CTI_GetCurrentApartmentType(IComThreadingInfo *iface, APTTYPE *apttype) -{ - APTTYPEQUALIFIER qualifier; - - TRACE("(%p)\n", apttype); - - return CoGetApartmentType(apttype, &qualifier); -} - -static HRESULT WINAPI Context_CTI_GetCurrentThreadType(IComThreadingInfo *iface, THDTYPE *thdtype) -{ - APTTYPEQUALIFIER qualifier; - APTTYPE apttype; - HRESULT hr; - - hr = CoGetApartmentType(&apttype, &qualifier); - if (FAILED(hr)) - return hr; - - TRACE("(%p)\n", thdtype); - - switch (apttype) - { - case APTTYPE_STA: - case APTTYPE_MAINSTA: - *thdtype = THDTYPE_PROCESSMESSAGES; - break; - default: - *thdtype = THDTYPE_BLOCKMESSAGES; - break; - } - return S_OK; -} - -static HRESULT WINAPI Context_CTI_GetCurrentLogicalThreadId(IComThreadingInfo *iface, GUID *logical_thread_id) -{ - TRACE("(%p)\n", logical_thread_id); - return CoGetCurrentLogicalThreadId(logical_thread_id); -} - -static HRESULT WINAPI Context_CTI_SetCurrentLogicalThreadId(IComThreadingInfo *iface, REFGUID logical_thread_id) -{ - FIXME("(%s): stub\n", debugstr_guid(logical_thread_id)); - return E_NOTIMPL; -} - -static const IComThreadingInfoVtbl Context_Threading_Vtbl = -{ - Context_CTI_QueryInterface, - Context_CTI_AddRef, - Context_CTI_Release, - Context_CTI_GetCurrentApartmentType, - Context_CTI_GetCurrentThreadType, - Context_CTI_GetCurrentLogicalThreadId, - Context_CTI_SetCurrentLogicalThreadId -}; - -static HRESULT WINAPI Context_CC_QueryInterface(IContextCallback *iface, REFIID riid, LPVOID *ppv) -{ - Context *This = impl_from_IContextCallback(iface); - return Context_QueryInterface(This, riid, ppv); -} - -static ULONG WINAPI Context_CC_AddRef(IContextCallback *iface) -{ - Context *This = impl_from_IContextCallback(iface); - return Context_AddRef(This); -} - -static ULONG WINAPI Context_CC_Release(IContextCallback *iface) -{ - Context *This = impl_from_IContextCallback(iface); - return Context_Release(This); -} - -static HRESULT WINAPI Context_CC_ContextCallback(IContextCallback *iface, PFNCONTEXTCALL pCallback, - ComCallData *param, REFIID riid, int method, IUnknown *punk) -{ - Context *This = impl_from_IContextCallback(iface); - - FIXME("(%p/%p)->(%p, %p, %s, %d, %p)\n", This, iface, pCallback, param, debugstr_guid(riid), method, punk); - return E_NOTIMPL; -} - -static const IContextCallbackVtbl Context_Callback_Vtbl = -{ - Context_CC_QueryInterface, - Context_CC_AddRef, - Context_CC_Release, - Context_CC_ContextCallback -}; - -static HRESULT WINAPI Context_OC_QueryInterface(IObjContext *iface, REFIID riid, LPVOID *ppv) -{ - Context *This = impl_from_IObjContext(iface); - return Context_QueryInterface(This, riid, ppv); -} - -static ULONG WINAPI Context_OC_AddRef(IObjContext *iface) -{ - Context *This = impl_from_IObjContext(iface); - return Context_AddRef(This); -} - -static ULONG WINAPI Context_OC_Release(IObjContext *iface) -{ - Context *This = impl_from_IObjContext(iface); - return Context_Release(This); -} - -static HRESULT WINAPI Context_OC_SetProperty(IObjContext *iface, REFGUID propid, CPFLAGS flags, IUnknown *punk) -{ - Context *This = impl_from_IObjContext(iface); - - FIXME("(%p/%p)->(%s, %x, %p)\n", This, iface, debugstr_guid(propid), flags, punk); - return E_NOTIMPL; -} - -static HRESULT WINAPI Context_OC_RemoveProperty(IObjContext *iface, REFGUID propid) -{ - Context *This = impl_from_IObjContext(iface); - - FIXME("(%p/%p)->(%s)\n", This, iface, debugstr_guid(propid)); - return E_NOTIMPL; -} - -static HRESULT WINAPI Context_OC_GetProperty(IObjContext *iface, REFGUID propid, CPFLAGS *flags, IUnknown **punk) -{ - Context *This = impl_from_IObjContext(iface); - - FIXME("(%p/%p)->(%s, %p, %p)\n", This, iface, debugstr_guid(propid), flags, punk); - return E_NOTIMPL; -} - -static HRESULT WINAPI Context_OC_EnumContextProps(IObjContext *iface, IEnumContextProps **props) -{ - Context *This = impl_from_IObjContext(iface); - - FIXME("(%p/%p)->(%p)\n", This, iface, props); - return E_NOTIMPL; -} - -static void WINAPI Context_OC_Reserved1(IObjContext *iface) -{ - Context *This = impl_from_IObjContext(iface); - FIXME("(%p/%p)\n", This, iface); -} - -static void WINAPI Context_OC_Reserved2(IObjContext *iface) -{ - Context *This = impl_from_IObjContext(iface); - FIXME("(%p/%p)\n", This, iface); -} - -static void WINAPI Context_OC_Reserved3(IObjContext *iface) -{ - Context *This = impl_from_IObjContext(iface); - FIXME("(%p/%p)\n", This, iface); -} - -static void WINAPI Context_OC_Reserved4(IObjContext *iface) -{ - Context *This = impl_from_IObjContext(iface); - FIXME("(%p/%p)\n", This, iface); -} - -static void WINAPI Context_OC_Reserved5(IObjContext *iface) -{ - Context *This = impl_from_IObjContext(iface); - FIXME("(%p/%p)\n", This, iface); -} - -static void WINAPI Context_OC_Reserved6(IObjContext *iface) -{ - Context *This = impl_from_IObjContext(iface); - FIXME("(%p/%p)\n", This, iface); -} - -static void WINAPI Context_OC_Reserved7(IObjContext *iface) -{ - Context *This = impl_from_IObjContext(iface); - FIXME("(%p/%p)\n", This, iface); -} - -static const IObjContextVtbl Context_Object_Vtbl = -{ - Context_OC_QueryInterface, - Context_OC_AddRef, - Context_OC_Release, - Context_OC_SetProperty, - Context_OC_RemoveProperty, - Context_OC_GetProperty, - Context_OC_EnumContextProps, - Context_OC_Reserved1, - Context_OC_Reserved2, - Context_OC_Reserved3, - Context_OC_Reserved4, - Context_OC_Reserved5, - Context_OC_Reserved6, - Context_OC_Reserved7 -}; - -/*********************************************************************** - * CoGetContextToken [OLE32.@] - */ -HRESULT WINAPI CoGetContextToken( ULONG_PTR *token ) -{ - struct oletls *info = COM_CurrentInfo(); - APARTMENT *apt; - - TRACE("(%p)\n", token); - - if (!info) - return E_OUTOFMEMORY; - - if (!(apt = apartment_get_current_or_mta())) - { - ERR("apartment not initialised\n"); - return CO_E_NOTINITIALIZED; - } - apartment_release(apt); - - if (!token) - return E_POINTER; - - if (!info->context_token) - { - Context *context; - - context = HeapAlloc(GetProcessHeap(), 0, sizeof(*context)); - if (!context) - return E_OUTOFMEMORY; - - context->IComThreadingInfo_iface.lpVtbl = &Context_Threading_Vtbl; - context->IContextCallback_iface.lpVtbl = &Context_Callback_Vtbl; - context->IObjContext_iface.lpVtbl = &Context_Object_Vtbl; - /* Context token does not take a reference, it's always zero until the - interface is explicitly requested with CoGetObjectContext(). */ - context->refs = 0; - - info->context_token = &context->IObjContext_iface; - } - - *token = (ULONG_PTR)info->context_token; - TRACE("context_token=%p\n", info->context_token); - - return S_OK; -} - HRESULT Handler_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) { static const WCHAR wszInprocHandler32[] = {'I','n','p','r','o','c','H','a','n','d','l','e','r','3','2',0}; diff --git a/dlls/ole32/ole32.spec b/dlls/ole32/ole32.spec index 02a8434d264..9c663692484 100644 --- a/dlls/ole32/ole32.spec +++ b/dlls/ole32/ole32.spec @@ -31,7 +31,7 @@ @ stdcall CoGetCallState(long ptr) combase.CoGetCallState @ stdcall CoGetCallerTID(ptr) @ stdcall CoGetClassObject(ptr long ptr ptr ptr) -@ stdcall CoGetContextToken(ptr) +@ stdcall CoGetContextToken(ptr) combase.CoGetContextToken @ stdcall CoGetCurrentLogicalThreadId(ptr) @ stdcall CoGetCurrentProcess() @ stdcall CoGetDefaultContext(long ptr ptr) combase.CoGetDefaultContext
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=77365
Your paranoid android.
=== debiant (32 bit Chinese:China report) ===
ole32: clipboard.c:1745: Test failed: got 800401d0 clipboard.c:1748: Test failed: called 4 clipboard.c:1757: Test failed: got 800401d0 clipboard.c:1760: Test failed: called 4 clipboard.c:1761: Test failed: called 1 clipboard.c:1767: Test failed: got 800401d0 clipboard.c:1770: Test failed: called 4 clipboard.c:1771: Test failed: called 1 clipboard.c:1777: Test failed: got 800401d0 clipboard.c:1780: Test failed: called 4 clipboard.c:1781: Test failed: called 1 clipboard.c:1792: Test failed: called 6 clipboard.c:1793: Test failed: called 2 clipboard.c:1802: Test failed: called 7 clipboard.c:1803: Test failed: called 2 clipboard.c:1812: Test failed: called 8 clipboard.c:1813: Test failed: called 2
Signed-off-by: Huw Davies huw@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/combase/combase.c | 22 ++++++++++++++++++++++ dlls/combase/combase.spec | 2 +- dlls/ole32/compobj.c | 14 -------------- dlls/ole32/compobj_private.h | 10 ---------- dlls/ole32/ole32.spec | 2 +- dlls/ole32/rpc.c | 2 +- 6 files changed, 25 insertions(+), 27 deletions(-)
diff --git a/dlls/combase/combase.c b/dlls/combase/combase.c index a2e5ac93a53..8ad95329d08 100644 --- a/dlls/combase/combase.c +++ b/dlls/combase/combase.c @@ -2211,3 +2211,25 @@ HRESULT WINAPI CoGetContextToken(ULONG_PTR *token)
return S_OK; } + +/*********************************************************************** + * CoGetCurrentLogicalThreadId (combase.@) + */ +HRESULT WINAPI CoGetCurrentLogicalThreadId(GUID *id) +{ + struct tlsdata *tlsdata; + HRESULT hr; + + if (!id) + return E_INVALIDARG; + + if (FAILED(hr = com_get_tlsdata(&tlsdata))) + return hr; + + if (IsEqualGUID(&tlsdata->causality_id, &GUID_NULL)) + CoCreateGuid(&tlsdata->causality_id); + + *id = tlsdata->causality_id; + + return S_OK; +} diff --git a/dlls/combase/combase.spec b/dlls/combase/combase.spec index 806ee015371..af83e89d174 100644 --- a/dlls/combase/combase.spec +++ b/dlls/combase/combase.spec @@ -104,7 +104,7 @@ @ stdcall CoGetClassObject(ptr long ptr ptr ptr) ole32.CoGetClassObject @ stub CoGetClassVersion @ stdcall CoGetContextToken(ptr) -@ stdcall CoGetCurrentLogicalThreadId(ptr) ole32.CoGetCurrentLogicalThreadId +@ stdcall CoGetCurrentLogicalThreadId(ptr) @ stdcall CoGetCurrentProcess() ole32.CoGetCurrentProcess @ stdcall CoGetDefaultContext(long ptr ptr) @ stdcall CoGetErrorInfo(long ptr) GetErrorInfo diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c index 83644782589..671f60e231a 100644 --- a/dlls/ole32/compobj.c +++ b/dlls/ole32/compobj.c @@ -2914,20 +2914,6 @@ DWORD WINAPI CoGetCurrentProcess(void) return info->thread_seqid; }
-/*********************************************************************** - * CoGetCurrentLogicalThreadId [OLE32.@] - */ -HRESULT WINAPI CoGetCurrentLogicalThreadId(GUID *id) -{ - TRACE("(%p)\n", id); - - if (!id) - return E_INVALIDARG; - - *id = COM_CurrentCausalityId(); - return S_OK; -} - /*********************************************************************** * CoIsOle1Class [OLE32.@] * diff --git a/dlls/ole32/compobj_private.h b/dlls/ole32/compobj_private.h index 5d7bf50b73f..8419fd04ffa 100644 --- a/dlls/ole32/compobj_private.h +++ b/dlls/ole32/compobj_private.h @@ -287,16 +287,6 @@ static inline APARTMENT* COM_CurrentApt(void) return COM_CurrentInfo()->apt; }
-static inline GUID COM_CurrentCausalityId(void) -{ - struct oletls *info = COM_CurrentInfo(); - if (!info) - return GUID_NULL; - if (IsEqualGUID(&info->causality_id, &GUID_NULL)) - CoCreateGuid(&info->causality_id); - return info->causality_id; -} - /* helpers for debugging */ # define DEBUG_SET_CRITSEC_NAME(cs, name) (cs)->DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": " name) # define DEBUG_CLEAR_CRITSEC_NAME(cs) (cs)->DebugInfo->Spare[0] = 0 diff --git a/dlls/ole32/ole32.spec b/dlls/ole32/ole32.spec index 9c663692484..543126e02bd 100644 --- a/dlls/ole32/ole32.spec +++ b/dlls/ole32/ole32.spec @@ -32,7 +32,7 @@ @ stdcall CoGetCallerTID(ptr) @ stdcall CoGetClassObject(ptr long ptr ptr ptr) @ stdcall CoGetContextToken(ptr) combase.CoGetContextToken -@ stdcall CoGetCurrentLogicalThreadId(ptr) +@ stdcall CoGetCurrentLogicalThreadId(ptr) combase.CoGetCurrentLogicalThreadId @ stdcall CoGetCurrentProcess() @ stdcall CoGetDefaultContext(long ptr ptr) combase.CoGetDefaultContext @ stdcall CoGetInstanceFromFile(ptr ptr ptr long long wstr long ptr) combase.CoGetInstanceFromFile diff --git a/dlls/ole32/rpc.c b/dlls/ole32/rpc.c index 895aa4010cd..bd825fd6c10 100644 --- a/dlls/ole32/rpc.c +++ b/dlls/ole32/rpc.c @@ -659,7 +659,7 @@ static HRESULT WINAPI ClientRpcChannelBuffer_GetBuffer(LPRPCCHANNELBUFFER iface,
message_state->channel_hook_info.iid = *riid; message_state->channel_hook_info.cbSize = sizeof(message_state->channel_hook_info); - message_state->channel_hook_info.uCausality = COM_CurrentCausalityId(); + CoGetCurrentLogicalThreadId(&message_state->channel_hook_info.uCausality); message_state->channel_hook_info.dwServerPid = This->server_pid; message_state->channel_hook_info.iMethod = msg->ProcNum & ~RPC_FLAGS_VALID_BIT; message_state->channel_hook_info.pObject = NULL; /* only present on server-side */
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=77366
Your paranoid android.
=== debiant (32 bit Chinese:China report) ===
ole32: clipboard.c:1213: Test failed: got 800401d0 clipboard.c:1214: Test failed: GetData not called clipboard.c:1217: Test failed: 5 5 clipboard.c:1223: Test failed: got 800401d0 clipboard.c:1224: Test failed: GetData not called clipboard.c:1228: Test failed: 5 clipboard.c:1233: Test failed: 5 clipboard.c:1239: Test failed: got 800401d0 clipboard.c:1250: Test failed: got 800401d0 clipboard.c:1256: Test failed: got 800401d0 clipboard.c:1257: Test failed: GetData not called clipboard.c:1261: Test failed: 5 clipboard.c:1263: Test failed: 1 1 clipboard.c:1266: Test failed: Failed to clear clipboard, hr 0x800401d0. clipboard.c:1269: Test failed: 1 clipboard.c:1278: Test failed: 5 clipboard.c:1281: Test failed: Failed to clear clipboard, hr 0x800401d0. clipboard.c:1283: Test failed: 5 5
Signed-off-by: Huw Davies huw@codeweavers.com