mirror of
git://source.winehq.org/git/wine.git
synced 2024-08-31 14:43:38 +00:00
oleaut32: Set DebugInfo for static CRITICAL_SECTION structure.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
870628fd28
commit
f2e48c2536
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue