taskmgr: Give a name and statically initialize PerfDataCriticalSection.

Francois Gouget fgouget at codeweavers.com
Mon Nov 14 04:04:42 CST 2011


On Mon, 14 Nov 2011, Francois Gouget wrote:
[...]
>  static CRITICAL_SECTION                PerfDataCriticalSection;
> +static CRITICAL_SECTION_DEBUG PerfDataCriticalSection_debug  =
> +{
> +    0, 0, &PerfDataCriticalSection,
> +    { &PerfDataCriticalSection_debug.ProcessLocksList, &PerfDataCriticalSection_debug.ProcessLocksList },
> +      0, 0, { (DWORD_PTR)(__FILE__ ": PerfDataCriticalSection") }
> +};
[...]
> +    PerfDataCriticalSection.DebugInfo->Spare[0] = 0;
>      DeleteCriticalSection(&PerfDataCriticalSection);

Actually I think unsetting Spare[0] is wrong for statically initialized 
critical sections because it causes RtlDeleteCriticalSection() to do an 
RtlFreeHeap() on DebugInfo which happens to also be statically 
allocated. So I'll rework this patch and some of my previous patches.

-- 
Francois Gouget <fgouget at codeweavers.com>



More information about the wine-patches mailing list