strmbase: Fallback to InitializeCriticalSection() if RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO is unsupported.

This commit is contained in:
Paul Gofman 2024-03-19 12:44:58 -06:00 committed by Alexandre Julliard
parent 525ef1bf77
commit 86557b9e0b
Notes: Alexandre Julliard 2024-03-19 23:10:28 +01:00
Approved-by: Zebediah Figura (@zfigura)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/wine/-/merge_requests/5355
3 changed files with 8 additions and 4 deletions

View file

@ -524,10 +524,12 @@ void strmbase_filter_init(struct strmbase_filter *filter, IUnknown *outer,
filter->outer_unk = outer ? outer : &filter->IUnknown_inner;
filter->refcount = 1;
InitializeCriticalSectionEx(&filter->filter_cs, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO);
if (!InitializeCriticalSectionEx(&filter->filter_cs, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO))
InitializeCriticalSection(&filter->filter_cs);
if (filter->filter_cs.DebugInfo != (RTL_CRITICAL_SECTION_DEBUG *)-1)
filter->filter_cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": strmbase_filter.filter_cs");
InitializeCriticalSectionEx(&filter->stream_cs, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO);
if (!InitializeCriticalSectionEx(&filter->stream_cs, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO))
InitializeCriticalSection(&filter->stream_cs);
if (filter->stream_cs.DebugInfo != (RTL_CRITICAL_SECTION_DEBUG *)-1)
filter->stream_cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": strmbase_filter.stream_cs");
filter->clsid = *clsid;

View file

@ -730,7 +730,8 @@ void strmbase_passthrough_init(struct strmbase_passthrough *passthrough, IUnknow
passthrough->IMediaPosition_iface.lpVtbl = &IMediaPositionPassThru_Vtbl;
passthrough->IMediaSeeking_iface.lpVtbl = &IMediaSeekingPassThru_Vtbl;
passthrough->ISeekingPassThru_iface.lpVtbl = &ISeekingPassThru_Vtbl;
InitializeCriticalSectionEx(&passthrough->time_cs, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO);
if (!InitializeCriticalSectionEx(&passthrough->time_cs, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO))
InitializeCriticalSection(&passthrough->time_cs);
passthrough->time_cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": strmbase_passthrough.time_cs" );
}

View file

@ -49,7 +49,8 @@ HRESULT strmbase_seeking_init(SourceSeeking *pSeeking, const IMediaSeekingVtbl *
pSeeking->llDuration = pSeeking->llStop;
pSeeking->dRate = 1.0;
pSeeking->timeformat = TIME_FORMAT_MEDIA_TIME;
InitializeCriticalSectionEx(&pSeeking->cs, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO);
if (!InitializeCriticalSectionEx(&pSeeking->cs, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO))
InitializeCriticalSection(&pSeeking->cs);
pSeeking->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": SourceSeeking.cs");
return S_OK;
}