Francois Gouget : rpcrt4: Give a name to the critical sections.
Alexandre Julliard
julliard at winehq.org
Mon Nov 14 13:34:00 CST 2011
Module: wine
Branch: master
Commit: 86d8217aeaa761a098652d321e23fe4d05611319
URL: http://source.winehq.org/git/wine.git/?a=commit;h=86d8217aeaa761a098652d321e23fe4d05611319
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Mon Nov 14 15:10:01 2011 +0100
rpcrt4: Give a name to the critical sections.
---
dlls/rpcrt4/rpc_assoc.c | 2 ++
dlls/rpcrt4/rpc_server.c | 2 ++
dlls/rpcrt4/rpc_transport.c | 2 ++
dlls/rpcrt4/rpcrt4_main.c | 2 ++
4 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/dlls/rpcrt4/rpc_assoc.c b/dlls/rpcrt4/rpc_assoc.c
index 8364a9a..bcaa1c2 100644
--- a/dlls/rpcrt4/rpc_assoc.c
+++ b/dlls/rpcrt4/rpc_assoc.c
@@ -74,6 +74,7 @@ static RPC_STATUS RpcAssoc_Alloc(LPCSTR Protseq, LPCSTR NetworkAddr,
list_init(&assoc->free_connection_pool);
list_init(&assoc->context_handle_list);
InitializeCriticalSection(&assoc->cs);
+ assoc->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": RpcAssoc.cs");
assoc->Protseq = RPCRT4_strdupA(Protseq);
assoc->NetworkAddr = RPCRT4_strdupA(NetworkAddr);
assoc->Endpoint = RPCRT4_strdupA(Endpoint);
@@ -213,6 +214,7 @@ ULONG RpcAssoc_Release(RpcAssoc *assoc)
HeapFree(GetProcessHeap(), 0, assoc->NetworkAddr);
HeapFree(GetProcessHeap(), 0, assoc->Protseq);
+ assoc->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&assoc->cs);
HeapFree(GetProcessHeap(), 0, assoc);
diff --git a/dlls/rpcrt4/rpc_server.c b/dlls/rpcrt4/rpc_server.c
index 438338b..558fbd8 100644
--- a/dlls/rpcrt4/rpc_server.c
+++ b/dlls/rpcrt4/rpc_server.c
@@ -931,6 +931,7 @@ static RPC_STATUS alloc_serverprotoseq(UINT MaxCalls, const char *Protseq, RpcSe
(*ps)->MaxCalls = 0;
(*ps)->conn = NULL;
InitializeCriticalSection(&(*ps)->cs);
+ (*ps)->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": RpcServerProtseq.cs");
(*ps)->is_listening = FALSE;
(*ps)->mgr_mutex = NULL;
(*ps)->server_ready_event = NULL;
@@ -946,6 +947,7 @@ static RPC_STATUS alloc_serverprotoseq(UINT MaxCalls, const char *Protseq, RpcSe
static void destroy_serverprotoseq(RpcServerProtseq *ps)
{
RPCRT4_strfree(ps->Protseq);
+ ps->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&ps->cs);
CloseHandle(ps->mgr_mutex);
CloseHandle(ps->server_ready_event);
diff --git a/dlls/rpcrt4/rpc_transport.c b/dlls/rpcrt4/rpc_transport.c
index 4632f4a..6568683 100644
--- a/dlls/rpcrt4/rpc_transport.c
+++ b/dlls/rpcrt4/rpc_transport.c
@@ -1863,6 +1863,7 @@ static ULONG RpcHttpAsyncData_Release(RpcHttpAsyncData *data)
TRACE("destroying async data %p\n", data);
CloseHandle(data->completion_event);
HeapFree(GetProcessHeap(), 0, data->inet_buffers.lpvBuffer);
+ data->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&data->cs);
HeapFree(GetProcessHeap(), 0, data);
}
@@ -1906,6 +1907,7 @@ static RpcConnection *rpcrt4_ncacn_http_alloc(void)
httpc->async_data->inet_buffers.lpvBuffer = NULL;
httpc->async_data->destination_buffer = NULL;
InitializeCriticalSection(&httpc->async_data->cs);
+ httpc->async_data->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": RpcHttpAsyncData.cs");
return &httpc->common;
}
diff --git a/dlls/rpcrt4/rpcrt4_main.c b/dlls/rpcrt4/rpcrt4_main.c
index 2d7a754..5976948 100644
--- a/dlls/rpcrt4/rpcrt4_main.c
+++ b/dlls/rpcrt4/rpcrt4_main.c
@@ -127,6 +127,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
list_remove(&tdata->entry);
LeaveCriticalSection(&threaddata_cs);
+ tdata->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&tdata->cs);
if (tdata->connection)
ERR("tdata->connection should be NULL but is still set to %p\n", tdata->connection);
@@ -888,6 +889,7 @@ static struct threaddata *get_or_create_threaddata(void)
if (!tdata) return NULL;
InitializeCriticalSection(&tdata->cs);
+ tdata->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": threaddata.cs");
tdata->thread_id = GetCurrentThreadId();
EnterCriticalSection(&threaddata_cs);
More information about the wine-cvs
mailing list