static HRESULT WINAPI IEnumPinsImpl_Reset(IEnumPins * iface) { IEnumPinsImpl *This = impl_from_IEnumPins(iface); TRACE("(%p)->()\n", iface); This->Version = This->receive_version(This->base); This->uIndex = 0; return S_OK; }
static HRESULT WINAPI IEnumPinsImpl_Skip(IEnumPins * iface, ULONG cPins) { IEnumPinsImpl *This = impl_from_IEnumPins(iface); TRACE("(%p)->(%u)\n", iface, cPins); if (This->Version != This->receive_version(This->base)) return VFW_E_ENUM_OUT_OF_SYNC; if (This->receive_pincount(This->base) >= This->uIndex + cPins) return S_FALSE; This->uIndex += cPins; return S_OK; }
static HRESULT WINAPI IEnumPinsImpl_Next(IEnumPins * iface, ULONG cPins, IPin ** ppPins, ULONG * pcFetched) { IEnumPinsImpl *This = impl_from_IEnumPins(iface); HRESULT hr = S_OK; ULONG i = 0; TRACE("(%p)->(%u, %p, %p)\n", iface, cPins, ppPins, pcFetched); if (!ppPins) return E_POINTER; if (cPins > 1 && !pcFetched) return E_INVALIDARG; if (pcFetched) *pcFetched = 0; if (This->Version != This->receive_version(This->base)) return VFW_E_ENUM_OUT_OF_SYNC; while (i < cPins && hr == S_OK) { IPin *pin; pin = This->receive_pin(This->base, This->uIndex + i); if (!pin) break; else ppPins[i] = pin; ++i; } if (pcFetched) *pcFetched = i; This->uIndex += i; if (i < cPins) return S_FALSE; return S_OK; }