Commit f2e48c25 authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

oleaut32: Set DebugInfo for static CRITICAL_SECTION structure.

parent 870628fd
...@@ -45,6 +45,15 @@ ...@@ -45,6 +45,15 @@
WINE_DEFAULT_DEBUG_CHANNEL(variant); 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 */ /* Convert a variant from one type to another */
static inline HRESULT VARIANT_Coerce(VARIANTARG* pd, LCID lcid, USHORT wFlags, static inline HRESULT VARIANT_Coerce(VARIANTARG* pd, LCID lcid, USHORT wFlags,
VARIANTARG* ps, VARTYPE vt) VARIANTARG* ps, VARTYPE vt)
...@@ -1490,7 +1499,6 @@ HRESULT WINAPI VarUdateFromDate(DATE dateIn, ULONG dwFlags, UDATE *lpUdate) ...@@ -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 void VARIANT_GetLocalisedNumberChars(VARIANT_NUMBER_CHARS *lpChars, LCID lcid, DWORD dwFlags)
{ {
static const VARIANT_NUMBER_CHARS defaultChars = { '-','+','.',',','$',0,'.',',' }; static const VARIANT_NUMBER_CHARS defaultChars = { '-','+','.',',','$',0,'.',',' };
static CRITICAL_SECTION csLastChars = { NULL, -1, 0, 0, 0, 0 };
static VARIANT_NUMBER_CHARS lastChars; static VARIANT_NUMBER_CHARS lastChars;
static LCID lastLcid = -1; static LCID lastLcid = -1;
static DWORD lastFlags = 0; static DWORD lastFlags = 0;
...@@ -1498,14 +1506,14 @@ static void VARIANT_GetLocalisedNumberChars(VARIANT_NUMBER_CHARS *lpChars, LCID ...@@ -1498,14 +1506,14 @@ static void VARIANT_GetLocalisedNumberChars(VARIANT_NUMBER_CHARS *lpChars, LCID
WCHAR buff[4]; WCHAR buff[4];
/* To make caching thread-safe, a critical section is needed */ /* 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 /* Asking for default locale entries is very expensive: It is a registry
server call. So cache one locally, as Microsoft does it too */ server call. So cache one locally, as Microsoft does it too */
if(lcid == lastLcid && dwFlags == lastFlags) if(lcid == lastLcid && dwFlags == lastFlags)
{ {
memcpy(lpChars, &lastChars, sizeof(defaultChars)); memcpy(lpChars, &lastChars, sizeof(defaultChars));
LeaveCriticalSection(&csLastChars); LeaveCriticalSection(&cache_cs);
return; return;
} }
...@@ -1532,7 +1540,7 @@ static void VARIANT_GetLocalisedNumberChars(VARIANT_NUMBER_CHARS *lpChars, LCID ...@@ -1532,7 +1540,7 @@ static void VARIANT_GetLocalisedNumberChars(VARIANT_NUMBER_CHARS *lpChars, LCID
memcpy(&lastChars, lpChars, sizeof(defaultChars)); memcpy(&lastChars, lpChars, sizeof(defaultChars));
lastLcid = lcid; lastLcid = lcid;
lastFlags = dwFlags; lastFlags = dwFlags;
LeaveCriticalSection(&csLastChars); LeaveCriticalSection(&cache_cs);
} }
/* Number Parsing States */ /* Number Parsing States */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment