AAFRESULT STDMETHODCALLTYPE ImplEnumAAFCodecFlavours::Next ( aafUInt32 count, aafUID_t * pAAFCodecFlavours, aafUInt32 * pFetched) { aafUID_t* pDef; aafUInt32 numDefs; HRESULT hr = E_FAIL; if ((!pFetched && count != 1) || (pFetched && count == 1)) return E_INVALIDARG; // Point at the first component in the array. pDef = pAAFCodecFlavours; for (numDefs = 0; numDefs < count; numDefs++) { hr = NextOne(pDef); if (FAILED(hr)) break; // Point at the next component in the array. This // will increment off the end of the array when // numComps == count-1, but the for loop should // prevent access to this location. pDef++; } if (pFetched) *pFetched = numDefs; return hr; }
AAFRESULT STDMETHODCALLTYPE ImplEnumAAFStorablePropVals::Next ( aafUInt32 count, ImplAAFPropertyValue ** ppPropertyValues, aafUInt32 * pFetched) { AAFRESULT result = AAFRESULT_SUCCESS; ASSERTU(isInitialized()); if (!isInitialized()) return AAFRESULT_NOT_INITIALIZED; if (NULL == ppPropertyValues || NULL == pFetched) return AAFRESULT_NULL_PARAM; if (0 == count) return AAFRESULT_INVALID_PARAM; aafUInt32 numItems; for (numItems = 0; numItems < count; numItems++) { result = NextOne(&ppPropertyValues[numItems]); if (FAILED(result)) break; } *pFetched = numItems; return result; }