Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/combase/combase.c | 19 +++++++++++++++++++ dlls/combase/combase.spec | 2 +- dlls/ole32/compobj.c | 29 ----------------------------- dlls/ole32/ole32.spec | 2 +- 4 files changed, 21 insertions(+), 31 deletions(-)
diff --git a/dlls/combase/combase.c b/dlls/combase/combase.c index cceb36a5931..c4a7f719129 100644 --- a/dlls/combase/combase.c +++ b/dlls/combase/combase.c @@ -1387,3 +1387,22 @@ void WINAPI DECLSPEC_HOTPATCH CoFreeUnusedLibraries(void) { CoFreeUnusedLibrariesEx(INFINITE, 0); } + +/*********************************************************************** + * CoGetCallContext (combase.@) + */ +HRESULT WINAPI CoGetCallContext(REFIID riid, void **obj) +{ + struct tlsdata *tlsdata; + HRESULT hr; + + TRACE("%s, %p\n", debugstr_guid(riid), obj); + + if (FAILED(hr = com_get_tlsdata(&tlsdata))) + return hr; + + if (!tlsdata->call_state) + return RPC_E_CALL_COMPLETE; + + return IUnknown_QueryInterface(tlsdata->call_state, riid, obj); +} diff --git a/dlls/combase/combase.spec b/dlls/combase/combase.spec index 8a91088ca4e..8293c9de259 100644 --- a/dlls/combase/combase.spec +++ b/dlls/combase/combase.spec @@ -97,7 +97,7 @@ @ stdcall CoGetActivationState(int128 long ptr) @ stub CoGetApartmentID @ stdcall CoGetApartmentType(ptr ptr) ole32.CoGetApartmentType -@ stdcall CoGetCallContext(ptr ptr) ole32.CoGetCallContext +@ stdcall CoGetCallContext(ptr ptr) @ stdcall CoGetCallState(long ptr) @ stdcall CoGetCallerTID(ptr) ole32.CoGetCallerTID @ stub CoGetCancelObject diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c index 350508ac9a3..2dc2d417e07 100644 --- a/dlls/ole32/compobj.c +++ b/dlls/ole32/compobj.c @@ -3458,35 +3458,6 @@ HRESULT WINAPI CoAllowSetForegroundWindow(IUnknown *pUnk, void *pvReserved) return S_OK; }
-/*********************************************************************** - * CoGetCallContext [OLE32.@] - * - * Gets the context of the currently executing server call in the current - * thread. - * - * PARAMS - * riid [I] Context interface to return. - * ppv [O] Pointer to memory that will receive the context on return. - * - * RETURNS - * Success: S_OK. - * Failure: HRESULT code. - */ -HRESULT WINAPI CoGetCallContext(REFIID riid, void **ppv) -{ - struct oletls *info = COM_CurrentInfo(); - - TRACE("(%s, %p)\n", debugstr_guid(riid), ppv); - - if (!info) - return E_OUTOFMEMORY; - - if (!info->call_state) - return RPC_E_CALL_COMPLETE; - - return IUnknown_QueryInterface(info->call_state, riid, ppv); -} - /*********************************************************************** * CoSwitchCallContext [OLE32.@] * diff --git a/dlls/ole32/ole32.spec b/dlls/ole32/ole32.spec index f21f6429ca5..43237550195 100644 --- a/dlls/ole32/ole32.spec +++ b/dlls/ole32/ole32.spec @@ -27,7 +27,7 @@ @ stdcall CoFreeUnusedLibrariesEx(long long) @ stdcall CoGetActivationState(int128 long ptr) combase.CoGetActivationState @ stdcall CoGetApartmentType(ptr ptr) -@ stdcall CoGetCallContext(ptr ptr) +@ stdcall CoGetCallContext(ptr ptr) combase.CoGetCallContext @ stdcall CoGetCallState(long ptr) combase.CoGetCallState @ stdcall CoGetCallerTID(ptr) @ stdcall CoGetClassObject(ptr long ptr ptr ptr)