combase: Move CoGetCurrentLogicalThreadId().

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2020-08-20 10:34:42 +03:00 committed by Alexandre Julliard
parent 90c0e3a4dd
commit 6e0e890fba
6 changed files with 25 additions and 27 deletions

View File

@ -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;
}

View File

@ -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

View File

@ -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.@]
*

View File

@ -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

View File

@ -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

View File

@ -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 */