wininet/tests: Statically initialize and name the notification_cs critical section.

Francois Gouget fgouget at codeweavers.com
Wed Jul 3 05:15:01 CDT 2013


---
 dlls/wininet/tests/http.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c
index e763ebf..cac7cee 100644
--- a/dlls/wininet/tests/http.c
+++ b/dlls/wininet/tests/http.c
@@ -4401,6 +4401,13 @@ struct info
 };
 
 static CRITICAL_SECTION notification_cs;
+static CRITICAL_SECTION_DEBUG notification_cs_debug =
+{
+    0, 0, &notification_cs,
+    { &notification_cs_debug.ProcessLocksList, &notification_cs_debug.ProcessLocksList },
+      0, 0, { (DWORD_PTR)(__FILE__ ": notification_cs") }
+};
+static CRITICAL_SECTION notification_cs = { &notification_cs_debug, -1, 0, 0, 0, 0 };
 
 static void CALLBACK check_notification( HINTERNET handle, DWORD_PTR context, DWORD status, LPVOID buffer, DWORD buflen )
 {
@@ -4588,8 +4595,6 @@ static void test_async_HttpSendRequestEx(const struct notification_data *nd)
 
     trace("Async HttpSendRequestEx test (%s %s)\n", nd->method, nd->host);
 
-    InitializeCriticalSection( &notification_cs );
-
     info.test  = nd->test;
     info.count = nd->count;
     info.index = 0;
@@ -4684,6 +4689,8 @@ static void test_async_HttpSendRequestEx(const struct notification_data *nd)
     WaitForSingleObject( info.wait, 10000 );
     Sleep(100);
     CloseHandle( info.wait );
+
+    DeleteCriticalSection(&notification_cs);
 }
 
 static HINTERNET closetest_session, closetest_req, closetest_conn;
-- 
1.7.10.4




More information about the wine-patches mailing list