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