winhttp: Give a name to the critical sections.

This commit is contained in:
Francois Gouget 2011-11-14 15:09:35 +01:00 committed by Alexandre Julliard
parent 51ab24dd66
commit ea93b27c34
2 changed files with 12 additions and 2 deletions

View File

@ -539,7 +539,11 @@ BOOL netconn_init( netconn_t *conn, BOOL secure )
LeaveCriticalSection( &init_ssl_cs );
return FALSE;
}
for (i = 0; i < num_ssl_locks; i++) InitializeCriticalSection( &ssl_locks[i] );
for (i = 0; i < num_ssl_locks; i++)
{
InitializeCriticalSection( &ssl_locks[i] );
ssl_locks[i].DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": ssl_locks");
}
pCRYPTO_set_locking_callback(ssl_lock_callback);
LeaveCriticalSection( &init_ssl_cs );
@ -568,7 +572,11 @@ void netconn_unload( void )
if (ssl_locks)
{
int i;
for (i = 0; i < num_ssl_locks; i++) DeleteCriticalSection( &ssl_locks[i] );
for (i = 0; i < num_ssl_locks; i++)
{
ssl_locks[i].DebugInfo->Spare[0] = 0;
DeleteCriticalSection( &ssl_locks[i] );
}
HeapFree( GetProcessHeap(), 0, ssl_locks );
}
#endif

View File

@ -2233,6 +2233,7 @@ static ULONG WINAPI winhttp_request_Release(
cancel_request( request );
free_request( request );
LeaveCriticalSection( &request->cs );
request->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection( &request->cs );
heap_free( request );
}
@ -3387,6 +3388,7 @@ HRESULT WinHttpRequest_create( IUnknown *unknown, void **obj )
request->proxy.lpszProxy = NULL;
request->proxy.lpszProxyBypass = NULL;
InitializeCriticalSection( &request->cs );
request->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": winhttp_request.cs");
*obj = &request->IWinHttpRequest_iface;
TRACE("returning iface %p\n", *obj);