/************************************************************************ * EnumConnectionsImpl_Next (IEnumConnections) * */ static HRESULT WINAPI EnumConnectionsImpl_Next(IEnumConnections* iface, ULONG cConn, LPCONNECTDATA pCD, ULONG *pEnum) { EnumConnectionsImpl *This = impl_from_IEnumConnections(iface); DWORD nRet = 0; TRACE("(%p)->(%d, %p, %p)\n", This, cConn, pCD, pEnum); if(pEnum == NULL) { if(cConn != 1) return E_POINTER; } else *pEnum = 0; if(This->nCur >= This->nConns) return S_FALSE; while(This->nCur < This->nConns && cConn) { *pCD++ = This->pCD[This->nCur]; IUnknown_AddRef(This->pCD[This->nCur].pUnk); This->nCur++; cConn--; nRet++; } if(pEnum) *pEnum = nRet; return S_OK; }
/************************************************************************ * EnumConnectionsImpl_Reset (IEnumConnections) * */ static HRESULT WINAPI EnumConnectionsImpl_Reset(IEnumConnections* iface) { EnumConnectionsImpl *This = impl_from_IEnumConnections(iface); TRACE("(%p)\n", This); This->nCur = 0; return S_OK; }
static ULONG WINAPI EnumConnections_AddRef(IEnumConnections *iface) { EnumConnections *This = impl_from_IEnumConnections(iface); ULONG ref = InterlockedIncrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); return ref; }
/************************************************************************ * EnumConnectionsImpl_AddRef (IUnknown) * * See Windows documentation for more details on IUnknown methods. */ static ULONG WINAPI EnumConnectionsImpl_AddRef(IEnumConnections* iface) { EnumConnectionsImpl *This = impl_from_IEnumConnections(iface); ULONG refCount = InterlockedIncrement(&This->ref); TRACE("(%p)->(ref before=%d)\n", This, refCount - 1); IUnknown_AddRef(This->pUnk); return refCount; }
/************************************************************************ * EnumConnectionsImpl_Clone (IEnumConnections) * */ static HRESULT WINAPI EnumConnectionsImpl_Clone(IEnumConnections* iface, LPENUMCONNECTIONS *ppEnum) { EnumConnectionsImpl *This = impl_from_IEnumConnections(iface); EnumConnectionsImpl *newObj; TRACE("(%p)->(%p)\n", This, ppEnum); newObj = EnumConnectionsImpl_Construct(This->pUnk, This->nConns, This->pCD); newObj->nCur = This->nCur; *ppEnum = (LPENUMCONNECTIONS)newObj; IUnknown_AddRef(This->pUnk); return S_OK; }
/************************************************************************ * EnumConnectionsImpl_Skip (IEnumConnections) * */ static HRESULT WINAPI EnumConnectionsImpl_Skip(IEnumConnections* iface, ULONG cSkip) { EnumConnectionsImpl *This = impl_from_IEnumConnections(iface); TRACE("(%p)->(%d)\n", This, cSkip); if(This->nCur + cSkip >= This->nConns) return S_FALSE; This->nCur += cSkip; return S_OK; }
static ULONG WINAPI EnumConnections_Release(IEnumConnections *iface) { EnumConnections *This = impl_from_IEnumConnections(iface); ULONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); if(!ref) { IConnectionPoint_Release(&This->cp->IConnectionPoint_iface); heap_free(This); } return ref; }
/************************************************************************ * EnumConnectionsImpl_Release (IUnknown) * * See Windows documentation for more details on IUnknown methods. */ static ULONG WINAPI EnumConnectionsImpl_Release(IEnumConnections* iface) { EnumConnectionsImpl *This = impl_from_IEnumConnections(iface); ULONG refCount = InterlockedDecrement(&This->ref); TRACE("(%p)->(ref before=%d)\n", This, refCount + 1); IUnknown_Release(This->pUnk); /* * If the reference count goes down to 0, perform suicide. */ if (!refCount) EnumConnectionsImpl_Destroy(This); return refCount; }
static HRESULT WINAPI EnumConnections_QueryInterface(IEnumConnections *iface, REFIID riid, void **ppv) { EnumConnections *This = impl_from_IEnumConnections(iface); TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv); if(IsEqualGUID(riid, &IID_IUnknown)) { *ppv = &This->IEnumConnections_iface; }else if(IsEqualGUID(riid, &IID_IEnumConnections)) { *ppv = &This->IEnumConnections_iface; }else { WARN("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv); *ppv = NULL; return E_NOINTERFACE; } IUnknown_AddRef((IUnknown*)*ppv); return S_OK; }
static HRESULT WINAPI EnumConnections_Next(IEnumConnections *iface, ULONG cConnections, CONNECTDATA *rgcd, ULONG *pcFetched) { EnumConnections *This = impl_from_IEnumConnections(iface); ULONG fetched = 0; TRACE("(%p)->(%d %p %p)\n", This, cConnections, rgcd, pcFetched); while(fetched < cConnections && This->iter < This->cp->sinks_size) { if(!This->cp->sinks[This->iter].unk) { This->iter++; continue; } rgcd[fetched].pUnk = This->cp->sinks[This->iter].unk; rgcd[fetched].dwCookie = ++This->iter; IUnknown_AddRef(rgcd[fetched].pUnk); fetched++; } if(pcFetched) *pcFetched = fetched; return fetched == cConnections ? S_OK : S_FALSE; }
static HRESULT WINAPI EnumConnections_Clone(IEnumConnections *iface, IEnumConnections **ppEnum) { EnumConnections *This = impl_from_IEnumConnections(iface); FIXME("(%p)->(%p)\n", This, ppEnum); return E_NOTIMPL; }
static HRESULT WINAPI EnumConnections_Reset(IEnumConnections *iface) { EnumConnections *This = impl_from_IEnumConnections(iface); FIXME("(%p)\n", This); return E_NOTIMPL; }
static HRESULT WINAPI EnumConnections_Skip(IEnumConnections *iface, ULONG cConnections) { EnumConnections *This = impl_from_IEnumConnections(iface); FIXME("(%p)->(%d)\n", This, cConnections); return E_NOTIMPL; }