Francois Gouget : wininet: Give a name to the critical sections, make them static and delete them when unloading the dll.

Alexandre Julliard julliard at winehq.org
Wed Nov 16 12:46:47 CST 2011


Module: wine
Branch: master
Commit: 17929b925ea93cdbe140b6a5a7b120589cf020fb
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=17929b925ea93cdbe140b6a5a7b120589cf020fb

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Wed Nov 16 16:29:44 2011 +0100

wininet: Give a name to the critical sections, make them static and delete them when unloading the dll.

---

 dlls/wininet/http.c          |    2 ++
 dlls/wininet/netconnection.c |    9 ++++++++-
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index 1847820..16f550c 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -1825,6 +1825,7 @@ static void HTTPREQ_Destroy(object_header_t *hdr)
     }
     heap_free(request->cacheFile);
 
+    request->read_section.DebugInfo->Spare[0] = 0;
     DeleteCriticalSection( &request->read_section );
     WININET_Release(&request->session->hdr);
 
@@ -3047,6 +3048,7 @@ static DWORD HTTP_HttpOpenRequestW(http_session_t *session,
     request->data_stream = &request->netconn_stream.data_stream;
 
     InitializeCriticalSection( &request->read_section );
+    request->read_section.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": http_request_t.read_section");
 
     WININET_AddRef( &session->hdr );
     request->session = session;
diff --git a/dlls/wininet/netconnection.c b/dlls/wininet/netconnection.c
index dd887eb..bf93301 100644
--- a/dlls/wininet/netconnection.c
+++ b/dlls/wininet/netconnection.c
@@ -484,7 +484,10 @@ static DWORD init_openssl(void)
         return ERROR_OUTOFMEMORY;
 
     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);
 
     return ERROR_SUCCESS;
@@ -578,7 +581,11 @@ void NETCON_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]);
+        }
         heap_free(ssl_locks);
     }
 #endif




More information about the wine-cvs mailing list