Rob Shearman : rpcrt4: Hold the thread-data' s critical section while cancelling a call.
Alexandre Julliard
julliard at winehq.org
Mon Nov 19 08:19:48 CST 2007
Module: wine
Branch: master
Commit: 8a15423ab7db1826f888759507801c04e36094b4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8a15423ab7db1826f888759507801c04e36094b4
Author: Rob Shearman <rob at codeweavers.com>
Date: Sun Nov 18 15:51:03 2007 +0000
rpcrt4: Hold the thread-data's critical section while cancelling a call.
Check that there is a connection before trying to cancel it.
---
dlls/rpcrt4/rpcrt4_main.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/dlls/rpcrt4/rpcrt4_main.c b/dlls/rpcrt4/rpcrt4_main.c
index ac69d5b..d557664 100644
--- a/dlls/rpcrt4/rpcrt4_main.c
+++ b/dlls/rpcrt4/rpcrt4_main.c
@@ -926,7 +926,9 @@ RPC_STATUS RPC_ENTRY RpcCancelThread(void* ThreadHandle)
LIST_FOR_EACH_ENTRY(tdata, &threaddata_list, struct threaddata, entry)
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;
}
LeaveCriticalSection(&threaddata_cs);
More information about the wine-cvs
mailing list