Sebastian Lackner : oleaut32: Set DebugInfo for static CRITICAL_SECTION structure.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Feb 29 10:59:12 CST 2016


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

Author: Sebastian Lackner <sebastian at fds-team.de>
Date:   Sat Feb 27 02:09:55 2016 +0100

oleaut32: Set DebugInfo for static CRITICAL_SECTION structure.

Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/oleaut32/variant.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/dlls/oleaut32/variant.c b/dlls/oleaut32/variant.c
index b31e8bc..6fbb320 100644
--- a/dlls/oleaut32/variant.c
+++ b/dlls/oleaut32/variant.c
@@ -45,6 +45,15 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(variant);
 
+static CRITICAL_SECTION cache_cs;
+static CRITICAL_SECTION_DEBUG critsect_debug =
+{
+    0, 0, &cache_cs,
+    { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
+      0, 0, { (DWORD_PTR)(__FILE__ ": cache_cs") }
+};
+static CRITICAL_SECTION cache_cs = { &critsect_debug, -1, 0, 0, 0, 0 };
+
 /* Convert a variant from one type to another */
 static inline HRESULT VARIANT_Coerce(VARIANTARG* pd, LCID lcid, USHORT wFlags,
                                      VARIANTARG* ps, VARTYPE vt)
@@ -1490,7 +1499,6 @@ HRESULT WINAPI VarUdateFromDate(DATE dateIn, ULONG dwFlags, UDATE *lpUdate)
 static void VARIANT_GetLocalisedNumberChars(VARIANT_NUMBER_CHARS *lpChars, LCID lcid, DWORD dwFlags)
 {
   static const VARIANT_NUMBER_CHARS defaultChars = { '-','+','.',',','$',0,'.',',' };
-  static CRITICAL_SECTION csLastChars = { NULL, -1, 0, 0, 0, 0 };
   static VARIANT_NUMBER_CHARS lastChars;
   static LCID lastLcid = -1;
   static DWORD lastFlags = 0;
@@ -1498,14 +1506,14 @@ static void VARIANT_GetLocalisedNumberChars(VARIANT_NUMBER_CHARS *lpChars, LCID
   WCHAR buff[4];
 
   /* To make caching thread-safe, a critical section is needed */
-  EnterCriticalSection(&csLastChars);
+  EnterCriticalSection(&cache_cs);
 
   /* Asking for default locale entries is very expensive: It is a registry
      server call. So cache one locally, as Microsoft does it too */
   if(lcid == lastLcid && dwFlags == lastFlags)
   {
     memcpy(lpChars, &lastChars, sizeof(defaultChars));
-    LeaveCriticalSection(&csLastChars);
+    LeaveCriticalSection(&cache_cs);
     return;
   }
 
@@ -1532,7 +1540,7 @@ static void VARIANT_GetLocalisedNumberChars(VARIANT_NUMBER_CHARS *lpChars, LCID
   memcpy(&lastChars, lpChars, sizeof(defaultChars));
   lastLcid = lcid;
   lastFlags = dwFlags;
-  LeaveCriticalSection(&csLastChars);
+  LeaveCriticalSection(&cache_cs);
 }
 
 /* Number Parsing States */




More information about the wine-cvs mailing list