Commit 6e0e890f authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

combase: Move CoGetCurrentLogicalThreadId().

parent 90c0e3a4
...@@ -2211,3 +2211,25 @@ HRESULT WINAPI CoGetContextToken(ULONG_PTR *token) ...@@ -2211,3 +2211,25 @@ HRESULT WINAPI CoGetContextToken(ULONG_PTR *token)
return S_OK; 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;
}
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
@ stdcall CoGetClassObject(ptr long ptr ptr ptr) ole32.CoGetClassObject @ stdcall CoGetClassObject(ptr long ptr ptr ptr) ole32.CoGetClassObject
@ stub CoGetClassVersion @ stub CoGetClassVersion
@ stdcall CoGetContextToken(ptr) @ stdcall CoGetContextToken(ptr)
@ stdcall CoGetCurrentLogicalThreadId(ptr) ole32.CoGetCurrentLogicalThreadId @ stdcall CoGetCurrentLogicalThreadId(ptr)
@ stdcall CoGetCurrentProcess() ole32.CoGetCurrentProcess @ stdcall CoGetCurrentProcess() ole32.CoGetCurrentProcess
@ stdcall CoGetDefaultContext(long ptr ptr) @ stdcall CoGetDefaultContext(long ptr ptr)
@ stdcall CoGetErrorInfo(long ptr) GetErrorInfo @ stdcall CoGetErrorInfo(long ptr) GetErrorInfo
......
...@@ -2915,20 +2915,6 @@ DWORD WINAPI CoGetCurrentProcess(void) ...@@ -2915,20 +2915,6 @@ DWORD WINAPI CoGetCurrentProcess(void)
} }
/*********************************************************************** /***********************************************************************
* CoGetCurrentLogicalThreadId [OLE32.@]
*/
HRESULT WINAPI CoGetCurrentLogicalThreadId(GUID *id)
{
TRACE("(%p)\n", id);
if (!id)
return E_INVALIDARG;
*id = COM_CurrentCausalityId();
return S_OK;
}
/***********************************************************************
* CoIsOle1Class [OLE32.@] * CoIsOle1Class [OLE32.@]
* *
* Determines whether the specified class an OLE v1 class. * Determines whether the specified class an OLE v1 class.
......
...@@ -287,16 +287,6 @@ static inline APARTMENT* COM_CurrentApt(void) ...@@ -287,16 +287,6 @@ static inline APARTMENT* COM_CurrentApt(void)
return COM_CurrentInfo()->apt; 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 */ /* helpers for debugging */
# define DEBUG_SET_CRITSEC_NAME(cs, name) (cs)->DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": " name) # 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 # define DEBUG_CLEAR_CRITSEC_NAME(cs) (cs)->DebugInfo->Spare[0] = 0
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
@ stdcall CoGetCallerTID(ptr) @ stdcall CoGetCallerTID(ptr)
@ stdcall CoGetClassObject(ptr long ptr ptr ptr) @ stdcall CoGetClassObject(ptr long ptr ptr ptr)
@ stdcall CoGetContextToken(ptr) combase.CoGetContextToken @ stdcall CoGetContextToken(ptr) combase.CoGetContextToken
@ stdcall CoGetCurrentLogicalThreadId(ptr) @ stdcall CoGetCurrentLogicalThreadId(ptr) combase.CoGetCurrentLogicalThreadId
@ stdcall CoGetCurrentProcess() @ stdcall CoGetCurrentProcess()
@ stdcall CoGetDefaultContext(long ptr ptr) combase.CoGetDefaultContext @ stdcall CoGetDefaultContext(long ptr ptr) combase.CoGetDefaultContext
@ stdcall CoGetInstanceFromFile(ptr ptr ptr long long wstr long ptr) combase.CoGetInstanceFromFile @ stdcall CoGetInstanceFromFile(ptr ptr ptr long long wstr long ptr) combase.CoGetInstanceFromFile
......
...@@ -659,7 +659,7 @@ static HRESULT WINAPI ClientRpcChannelBuffer_GetBuffer(LPRPCCHANNELBUFFER iface, ...@@ -659,7 +659,7 @@ static HRESULT WINAPI ClientRpcChannelBuffer_GetBuffer(LPRPCCHANNELBUFFER iface,
message_state->channel_hook_info.iid = *riid; message_state->channel_hook_info.iid = *riid;
message_state->channel_hook_info.cbSize = sizeof(message_state->channel_hook_info); 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.dwServerPid = This->server_pid;
message_state->channel_hook_info.iMethod = msg->ProcNum & ~RPC_FLAGS_VALID_BIT; message_state->channel_hook_info.iMethod = msg->ProcNum & ~RPC_FLAGS_VALID_BIT;
message_state->channel_hook_info.pObject = NULL; /* only present on server-side */ message_state->channel_hook_info.pObject = NULL; /* only present on server-side */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment