From 86d8217aeaa761a098652d321e23fe4d05611319 Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Mon, 14 Nov 2011 15:10:01 +0100 Subject: [PATCH] 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(+) diff --git a/dlls/rpcrt4/rpc_assoc.c b/dlls/rpcrt4/rpc_assoc.c index 8364a9a4f36..bcaa1c2579e 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 438338bdd22..558fbd812a9 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 4632f4a9e1b..6568683f7da 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 2d7a754d626..5976948ea40 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); -- 2.11.4.GIT