Added missing initialization of the filesource output pin critical

section.
Avoid indefinite wait when calling GetOverlappedResult.
Fixed initial refcount of the IMemAllocator object.
Improved some traces.
This commit is contained in:
Christian Costa 2004-08-13 19:49:16 +00:00 committed by Alexandre Julliard
parent 869e9cafd9
commit 8b0ec72563
2 changed files with 5 additions and 4 deletions

View File

@ -882,6 +882,7 @@ static HRESULT FileAsyncReader_Construct(HANDLE hFile, IBaseFilter * pBaseFilter
pPinImpl->hEvent = CreateEventW(NULL, 0, 0, NULL);
pPinImpl->bFlushing = FALSE;
pPinImpl->pHead = NULL;
InitializeCriticalSection(&pPinImpl->csList);
*ppPin = (IPin *)(&pPinImpl->pin.pin.lpVtbl);
return S_OK;
@ -1092,7 +1093,7 @@ static HRESULT WINAPI FileAsyncReader_WaitForNext(IAsyncReader * iface, DWORD dw
{
DWORD dwBytes;
/* get any errors */
if (!GetOverlappedResult(This->hFile, &pDataRq->ovl, &dwBytes, TRUE))
if (!GetOverlappedResult(This->hFile, &pDataRq->ovl, &dwBytes, FALSE))
hr = HRESULT_FROM_WIN32(GetLastError());
}

View File

@ -97,7 +97,7 @@ static HRESULT BaseMemAllocator_Init(HRESULT (* fnAlloc)(IMemAllocator *), HRESU
pMemAlloc->lpVtbl = &BaseMemAllocator_VTable;
pMemAlloc->ref = 0;
pMemAlloc->ref = 1;
pMemAlloc->pProps = NULL;
list_init(&pMemAlloc->free_list);
list_init(&pMemAlloc->used_list);
@ -474,7 +474,7 @@ static ULONG WINAPI StdMediaSample2_AddRef(IMediaSample2 * iface)
{
ICOM_THIS(StdMediaSample2, iface);
TRACE("()\n");
TRACE("(%p)->() AddRef from %ld\n", iface, This->ref);
return InterlockedIncrement(&This->ref);
}
@ -483,7 +483,7 @@ static ULONG WINAPI StdMediaSample2_Release(IMediaSample2 * iface)
{
ICOM_THIS(StdMediaSample2, iface);
TRACE("()\n");
TRACE("(%p)->() Release from %ld\n", iface, This->ref);
if (!InterlockedDecrement(&This->ref))
{