Commit 7551b82c authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

rpcrt4: Implement RpcCancelThreadEx.

Implement RpcCancelThreadEx using existing code moved into a new function, rpc_ccancel_thread. Implement RpcCancelThread based on RpcCancelThreadEx with timeout of 0.
parent 4799f06f
......@@ -968,20 +968,10 @@ NDR_SCONTEXT RPCRT4_PopThreadContextHandle(void)
return context_handle;
}
/******************************************************************************
* RpcCancelThread (rpcrt4.@)
*/
RPC_STATUS RPC_ENTRY RpcCancelThread(void* ThreadHandle)
static RPC_STATUS rpc_cancel_thread(DWORD target_tid)
{
DWORD target_tid;
struct threaddata *tdata;
TRACE("(%p)\n", ThreadHandle);
target_tid = GetThreadId(ThreadHandle);
if (!target_tid)
return RPC_S_INVALID_ARG;
EnterCriticalSection(&threaddata_cs);
LIST_FOR_EACH_ENTRY(tdata, &threaddata_list, struct threaddata, entry)
if (tdata->thread_id == target_tid)
......@@ -997,10 +987,32 @@ RPC_STATUS RPC_ENTRY RpcCancelThread(void* ThreadHandle)
}
/******************************************************************************
* RpcCancelThread (rpcrt4.@)
*/
RPC_STATUS RPC_ENTRY RpcCancelThread(void* ThreadHandle)
{
TRACE("(%p)\n", ThreadHandle);
return RpcCancelThreadEx(ThreadHandle, 0);
}
/******************************************************************************
* RpcCancelThreadEx (rpcrt4.@)
*/
RPC_STATUS RPC_ENTRY RpcCancelThreadEx(void* ThreadHandle, LONG Timeout)
{
DWORD target_tid;
FIXME("(%p, %d)\n", ThreadHandle, Timeout);
return RPC_S_OK;
target_tid = GetThreadId(ThreadHandle);
if (!target_tid)
return RPC_S_INVALID_ARG;
if (Timeout)
{
FIXME("(%p, %d)\n", ThreadHandle, Timeout);
return RPC_S_OK;
}
else
return rpc_cancel_thread(target_tid);
}
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