Commit 8a15423a authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

rpcrt4: Hold the thread-data's critical section while cancelling a call.

Check that there is a connection before trying to cancel it.
parent 23e995e3
...@@ -926,7 +926,9 @@ RPC_STATUS RPC_ENTRY RpcCancelThread(void* ThreadHandle) ...@@ -926,7 +926,9 @@ RPC_STATUS RPC_ENTRY RpcCancelThread(void* ThreadHandle)
LIST_FOR_EACH_ENTRY(tdata, &threaddata_list, struct threaddata, entry) LIST_FOR_EACH_ENTRY(tdata, &threaddata_list, struct threaddata, entry)
if (tdata->thread_id == target_tid) if (tdata->thread_id == target_tid)
{ {
rpcrt4_conn_cancel_call(tdata->connection); EnterCriticalSection(&tdata->cs);
if (tdata->connection) rpcrt4_conn_cancel_call(tdata->connection);
LeaveCriticalSection(&tdata->cs);
break; break;
} }
LeaveCriticalSection(&threaddata_cs); LeaveCriticalSection(&threaddata_cs);
......
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