Raphael wrote:
- This->lock.DebugInfo->Spare[1] = 0;You have to zero this out or DeleteCriticalSection will try
+ /*This->lock.DebugInfo->Spare[1] = 0;*/
DeleteCriticalSection(&(This->lock));
to delete that static memory.
How ? At opposite it produce DebugInfo leaks as seen in RtlDeleteCriticalSection (dlls/ntdll/critsection.c line 197) <snip> if (crit->DebugInfo) { /* only free the ones we made in here */ if (!crit->DebugInfo->Spare[1]) { RtlFreeHeap( GetProcessHeap(), 0, crit->DebugInfo ); crit->DebugInfo = NULL; } }
Actually it will leak DebugInfo if DebugInfo->Spare[1] is not 0.
<snip> i will provide a WINE_DEBUG_UNSET_CS_NAME for this problem
...
This is Alexandre's trick which I borrowed because it is very helpful in debugging lock problems.+#define WINE_SET_CS_NAME(cs, name) (cs)->DebugInfo->Spare[1] = (DWORD)This is a wine specific trick and should probably be put somewhere global
name +#define WINE_GET_CS_NAME(cs) (const char*)
(cs)->lock.DebugInfo->Spare[1]
so all users can be consistent. The name should have DEBUG in it
somewhere.
Yes, it should be better but i prefered to centralize it on dsound before moving it to wine/debug.h
Regards,
Raphael
It would be nice to formalize this and make it available in a more general way but that is Alexandre's call.