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.
This commit is contained in:
parent
4799f06f20
commit
7551b82cca
|
@ -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)
|
||||
|
@ -996,11 +986,33 @@ RPC_STATUS RPC_ENTRY RpcCancelThread(void* ThreadHandle)
|
|||
return RPC_S_OK;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* 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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue