quartz: Add DebugInfo to critical sections
Jan Zerebecki
jan.wine at zerebecki.de
Sat Mar 10 15:10:20 CST 2007
and add missing DeleteCriticalSection.
---
If this patch is rejected from inclusion, please tell me why, as
I would have to ask anyway.
dlls/quartz/dsoundrender.c | 6 +++++-
dlls/quartz/filesource.c | 5 +++++
dlls/quartz/filtergraph.c | 4 ++++
dlls/quartz/memallocator.c | 3 +++
dlls/quartz/parser.c | 3 +++
dlls/quartz/systemclock.c | 2 ++
dlls/quartz/transform.c | 3 +++
dlls/quartz/videorenderer.c | 3 +++
8 files changed, 28 insertions(+), 1 deletions(-)
diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c
index 67ab550..f9f0f1d 100644
--- a/dlls/quartz/dsoundrender.c
+++ b/dlls/quartz/dsoundrender.c
@@ -324,11 +324,13 @@ HRESULT DSoundRender_create(IUnknown * pUnkOuter, LPVOID * ppv)
pDSoundRender->IBasicAudio_vtbl = &IBasicAudio_Vtbl;
pDSoundRender->refCount = 1;
InitializeCriticalSection(&pDSoundRender->csFilter);
+ pDSoundRender->csFilter.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": DSoundRenderImpl*->csFilter");
pDSoundRender->state = State_Stopped;
pDSoundRender->ppPins = CoTaskMemAlloc(1 * sizeof(IPin *));
if (!pDSoundRender->ppPins)
{
+ pDSoundRender->csFilter.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&pDSoundRender->csFilter);
CoTaskMemFree(pDSoundRender);
return E_OUTOFMEMORY;
@@ -348,6 +350,7 @@ HRESULT DSoundRender_create(IUnknown * pUnkOuter, LPVOID * ppv)
else
{
CoTaskMemFree(pDSoundRender->ppPins);
+ pDSoundRender->csFilter.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&pDSoundRender->csFilter);
CoTaskMemFree(pDSoundRender);
}
@@ -403,8 +406,9 @@ static ULONG WINAPI DSoundRender_Release(IBaseFilter * iface)
if (!refCount)
{
+ This->csFilter.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&This->csFilter);
- if (This->pClock)
+ if (This->pClock)
IReferenceClock_Release(This->pClock);
if (This->dsbuffer)
diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c
index 66a753f..7523347 100644
--- a/dlls/quartz/filesource.c
+++ b/dlls/quartz/filesource.c
@@ -314,6 +314,7 @@ HRESULT AsyncReader_create(IUnknown * pUnkOuter, LPVOID * ppv)
pAsyncRead->pOutputPin = NULL;
InitializeCriticalSection(&pAsyncRead->csFilter);
+ pAsyncRead->csFilter.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": AsyncReader*->csFilter");
pAsyncRead->pszFileName = NULL;
pAsyncRead->pmt = NULL;
@@ -378,6 +379,7 @@ static ULONG WINAPI AsyncReader_Release(IBaseFilter * iface)
{
if (This->pOutputPin)
IPin_Release(This->pOutputPin);
+ This->csFilter.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&This->csFilter);
This->lpVtbl = NULL;
CoTaskMemFree(This);
@@ -764,6 +766,8 @@ static ULONG WINAPI FileAsyncReaderPin_Release(IPin * iface)
}
CloseHandle(This->hFile);
CloseHandle(This->hEvent);
+ This->csList.DebugInfo->Spare[0] = 0;
+ DeleteCriticalSection(&This->csList);
CoTaskMemFree(This);
return 0;
}
@@ -862,6 +866,7 @@ static HRESULT FileAsyncReader_Construct(HANDLE hFile, IBaseFilter * pBaseFilter
pPinImpl->pHead = NULL;
pPinImpl->pin.pConnectSpecific = FileAsyncReaderPin_ConnectSpecific;
InitializeCriticalSection(&pPinImpl->csList);
+ pPinImpl->csList.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": FileAsyncReader*->csList");
*ppPin = (IPin *)(&pPinImpl->pin.pin.lpVtbl);
return S_OK;
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c
index 4bbe879..c67f39a 100644
--- a/dlls/quartz/filtergraph.c
+++ b/dlls/quartz/filtergraph.c
@@ -76,6 +76,7 @@ static int EventsQueue_Init(EventsQueue* omr)
ZeroMemory(omr->messages, omr->ring_buffer_size * sizeof(Event));
InitializeCriticalSection(&omr->msg_crst);
+ omr->msg_crst.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": EventsQueue*->msg_crst");
return TRUE;
}
@@ -83,6 +84,7 @@ static int EventsQueue_Destroy(EventsQueue* omr)
{
CloseHandle(omr->msg_event);
CoTaskMemFree(omr->messages);
+ omr->msg_crst.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&omr->msg_crst);
return TRUE;
}
@@ -268,6 +270,7 @@ static ULONG Filtergraph_Release(IFilterGraphImpl *This) {
IFilterMapper2_Release(This->pFilterMapper2);
CloseHandle(This->hEventCompletion);
EventsQueue_Destroy(&This->evqueue);
+ This->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&This->cs);
CoTaskMemFree(This->ppFiltersInGraph);
CoTaskMemFree(This->pFilterNames);
@@ -4516,6 +4519,7 @@ HRESULT FilterGraph_create(IUnknown *pUnkOuter, LPVOID *ppObj)
fimpl->state = State_Stopped;
EventsQueue_Init(&fimpl->evqueue);
InitializeCriticalSection(&fimpl->cs);
+ fimpl->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": IFilterGraphImpl*->cs");
fimpl->nItfCacheEntries = 0;
hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, &IID_IFilterMapper2, (LPVOID*)&fimpl->pFilterMapper2);
diff --git a/dlls/quartz/memallocator.c b/dlls/quartz/memallocator.c
index 4bb6bab..50c8e0a 100644
--- a/dlls/quartz/memallocator.c
+++ b/dlls/quartz/memallocator.c
@@ -105,6 +105,7 @@ static HRESULT BaseMemAllocator_Init(HRESULT (* fnAlloc)(IMemAllocator *), HRESU
pMemAlloc->lWaiting = 0;
InitializeCriticalSection(&pMemAlloc->csState);
+ pMemAlloc->csState.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": BaseMemAllocator*->csState");
return S_OK;
}
@@ -155,6 +156,8 @@ static ULONG WINAPI BaseMemAllocator_Release(IMemAllocator * iface)
if (This->bCommitted)
This->fnFree(iface);
CoTaskMemFree(This->pProps);
+ This->csState.DebugInfo->Spare[0] = 0;
+ DeleteCriticalSection(&This->csState);
CoTaskMemFree(This);
return 0;
}
diff --git a/dlls/quartz/parser.c b/dlls/quartz/parser.c
index e9d0854..fbc01d6 100644
--- a/dlls/quartz/parser.c
+++ b/dlls/quartz/parser.c
@@ -71,6 +71,7 @@ HRESULT Parser_Create(ParserImpl* pParser, const CLSID* pClsid, PFN_PROCESS_SAMP
pParser->lpVtbl = &Parser_Vtbl;
pParser->refCount = 1;
InitializeCriticalSection(&pParser->csFilter);
+ pParser->csFilter.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": ParserImpl*->csFilter");
pParser->state = State_Stopped;
pParser->pClock = NULL;
ZeroMemory(&pParser->filterInfo, sizeof(FILTER_INFO));
@@ -93,6 +94,7 @@ HRESULT Parser_Create(ParserImpl* pParser, const CLSID* pClsid, PFN_PROCESS_SAMP
else
{
CoTaskMemFree(pParser->ppPins);
+ pParser->csFilter.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&pParser->csFilter);
CoTaskMemFree(pParser);
}
@@ -185,6 +187,7 @@ static ULONG WINAPI Parser_Release(IBaseFilter * iface)
{
ULONG i;
+ This->csFilter.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&This->csFilter);
if (This->pClock)
IReferenceClock_Release(This->pClock);
diff --git a/dlls/quartz/systemclock.c b/dlls/quartz/systemclock.c
index 78374d8..eec703e 100644
--- a/dlls/quartz/systemclock.c
+++ b/dlls/quartz/systemclock.c
@@ -224,6 +224,7 @@ static ULONG WINAPI SystemClockImpl_Release(IReferenceClock* iface) {
WaitForSingleObject(This->adviseThread, INFINITE);
CloseHandle(This->adviseThread);
}
+ This->safe.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&This->safe);
CoTaskMemFree(This);
}
@@ -384,6 +385,7 @@ HRESULT QUARTZ_CreateSystemClock(IUnknown * pUnkOuter, LPVOID * ppv) {
obj->lastTimeTickCount = GetTickCount();
InitializeCriticalSection(&obj->safe);
+ obj->safe.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": SystemClockImpl*->safe");
return SystemClockImpl_QueryInterface((IReferenceClock*) obj, &IID_IReferenceClock, ppv);
}
diff --git a/dlls/quartz/transform.c b/dlls/quartz/transform.c
index a610d43..5fc30ca 100644
--- a/dlls/quartz/transform.c
+++ b/dlls/quartz/transform.c
@@ -187,6 +187,7 @@ HRESULT TransformFilter_Create(TransformFilterImpl* pTransformFilter, const CLSI
pTransformFilter->refCount = 1;
InitializeCriticalSection(&pTransformFilter->csFilter);
+ pTransformFilter->csFilter.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": TransformFilterImpl*->csFilter");
pTransformFilter->state = State_Stopped;
pTransformFilter->pClock = NULL;
ZeroMemory(&pTransformFilter->filterInfo, sizeof(FILTER_INFO));
@@ -219,6 +220,7 @@ HRESULT TransformFilter_Create(TransformFilterImpl* pTransformFilter, const CLSI
else
{
CoTaskMemFree(pTransformFilter->ppPins);
+ pTransformFilter->csFilter.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&pTransformFilter->csFilter);
CoTaskMemFree(pTransformFilter);
}
@@ -274,6 +276,7 @@ static ULONG WINAPI TransformFilter_Release(IBaseFilter * iface)
{
ULONG i;
+ This->csFilter.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&This->csFilter);
if (This->pClock)
diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c
index 3ec283a..08b8379 100644
--- a/dlls/quartz/videorenderer.c
+++ b/dlls/quartz/videorenderer.c
@@ -437,6 +437,7 @@ HRESULT VideoRenderer_create(IUnknown * pUnkOuter, LPVOID * ppv)
pVideoRenderer->refCount = 1;
InitializeCriticalSection(&pVideoRenderer->csFilter);
+ pVideoRenderer->csFilter.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": VideoRendererImpl*->csFilter");
pVideoRenderer->state = State_Stopped;
pVideoRenderer->pClock = NULL;
pVideoRenderer->init = 0;
@@ -460,6 +461,7 @@ HRESULT VideoRenderer_create(IUnknown * pUnkOuter, LPVOID * ppv)
else
{
CoTaskMemFree(pVideoRenderer->ppPins);
+ pVideoRenderer->csFilter.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&pVideoRenderer->csFilter);
CoTaskMemFree(pVideoRenderer);
}
@@ -520,6 +522,7 @@ static ULONG WINAPI VideoRenderer_Release(IBaseFilter * iface)
if (!refCount)
{
+ This->csFilter.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&This->csFilter);
DestroyWindow(This->hWnd);
More information about the wine-patches
mailing list