Commit 86d8217a authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

rpcrt4: Give a name to the critical sections.

parent 3e16622a
......@@ -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);
......
......@@ -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);
......
......@@ -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;
}
......
......@@ -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);
......
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