[PATCH] quartz: implement AsyncReader_FindPin
David Adam
david.adam.cnrs at gmail.com
Sat Aug 7 04:53:36 CDT 2010
Hi,
what about if ppPin is NULL?
I think that this patch needs test cases to prove that it is correct?
David
2010/8/6 Anton Khirnov <wyskas at gmail.com>
> ---
> dlls/quartz/filesource.c | 32 ++++++++++++++++++++++++++++++--
> 1 files changed, 30 insertions(+), 2 deletions(-)
>
> diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c
> index 110415d..00a91c8 100644
> --- a/dlls/quartz/filesource.c
> +++ b/dlls/quartz/filesource.c
> @@ -548,9 +548,37 @@ static HRESULT WINAPI AsyncReader_EnumPins(IBaseFilter
> * iface, IEnumPins **ppEn
>
> static HRESULT WINAPI AsyncReader_FindPin(IBaseFilter * iface, LPCWSTR Id,
> IPin **ppPin)
> {
> - FIXME("(%s, %p)\n", debugstr_w(Id), ppPin);
> + IEnumPins *enumpins;
> + HRESULT hr;
>
> - return E_NOTIMPL;
> + hr = AsyncReader_EnumPins(iface, &enumpins);
> + if (FAILED(hr))
> + return S_FALSE;
> +
> + while (hr == S_OK) {
> + IPin *pin;
> + LPWSTR pinname;
> +
> + hr = IEnumPins_Next(enumpins, 1, &pin, NULL);
> + if (FAILED(hr))
> + break;
> +
> + hr = IPin_QueryId(pin, &pinname);
> + if (SUCCEEDED(hr)) {
> + if (!strcmpW(pinname, Id)) {
> + *ppPin = pin;
> + IPin_AddRef(*ppPin);
> + CoTaskMemFree(pinname);
> + break;
> + }
> + CoTaskMemFree(pinname);
> + }
> + }
> +
> + IEnumPins_Release(enumpins);
> + if (SUCCEEDED(hr))
> + return S_OK;
> + return S_FALSE;
> }
>
> static HRESULT WINAPI AsyncReader_QueryFilterInfo(IBaseFilter * iface,
> FILTER_INFO *pInfo)
> --
> 1.7.1
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20100807/3b571610/attachment.htm>
More information about the wine-devel
mailing list