27#define NONAMELESSUNION
40#define INITIAL_SINKS 10
49 IAdviseSink_Release(
data->pAdvSink);
61 dst->pAdvSink =
src->pAdvSink;
62 if (
dst->pAdvSink) IAdviseSink_AddRef(
dst->pAdvSink );
63 dst->dwConnection =
src->dwConnection;
93 IEnumSTATDATA_AddRef(iface);
115 for(
i = 0;
i <
This->num_of_elems;
i++)
118 if (
This->holder) IUnknown_Release(
This->holder);
135 if (
This->index >=
This->num_of_elems)
147 if (fetched) *fetched =
count;
218 for(
i = 0,
count = 0;
i < array_len;
i++)
234 This->holder = holder;
235 if (holder) IUnknown_AddRef(holder);
236 *ppenum = &
This->IEnumSTATDATA_iface;
293 *
obj = &
This->IOleAdviseHolder_iface;
337 DWORD *pdwConnection)
342 static const FORMATETC empty_fmtetc = {0,
NULL, 0, -1, 0};
344 TRACE(
"(%p)->(%p, %p)\n",
This, pAdvise, pdwConnection);
346 if (pdwConnection==
NULL)
361 This->max_cons *
sizeof(*
This->connections));
364 new_conn.pAdvSink = pAdvise;
366 new_conn.formatetc = empty_fmtetc;
367 new_conn.dwConnection =
index + 1;
371 *pdwConnection = new_conn.dwConnection;
385 TRACE(
"(%p)->(%u)\n",
This, dwConnection);
388 index = dwConnection - 1;
407 TRACE(
"(%p)->(%p)\n",
This, enum_advise);
409 IOleAdviseHolder_QueryInterface(iface, &
IID_IUnknown, (
void**)&unk);
411 IUnknown_Release(unk);
423 TRACE(
"(%p)->(%p)\n", iface, pmk);
425 hr = IOleAdviseHolder_EnumAdvise(iface, &pEnum);
429 while (IEnumSTATDATA_Next(pEnum, 1, &statdata,
NULL) ==
S_OK)
431 IAdviseSink_OnRename(statdata.pAdvSink, pmk);
433 IAdviseSink_Release(statdata.pAdvSink);
435 IEnumSTATDATA_Release(pEnum);
449 TRACE(
"(%p)->()\n", iface);
451 hr = IOleAdviseHolder_EnumAdvise(iface, &pEnum);
455 while (IEnumSTATDATA_Next(pEnum, 1, &statdata,
NULL) ==
S_OK)
457 IAdviseSink_OnSave(statdata.pAdvSink);
459 IAdviseSink_Release(statdata.pAdvSink);
461 IEnumSTATDATA_Release(pEnum);
475 TRACE(
"(%p)->()\n", iface);
477 hr = IOleAdviseHolder_EnumAdvise(iface, &pEnum);
481 while (IEnumSTATDATA_Next(pEnum, 1, &statdata,
NULL) ==
S_OK)
483 IAdviseSink_OnClose(statdata.pAdvSink);
485 IAdviseSink_Release(statdata.pAdvSink);
487 IEnumSTATDATA_Release(pEnum);
496static const IOleAdviseHolderVtbl
oahvt =
544#define WINE_ADVF_REMOTE 0x80000000
557 TRACE(
"%p\n", ptrToDestroy);
565 IDataObject_DUnadvise(ptrToDestroy->
delegate,
638 DWORD *pdwConnection)
644 TRACE(
"(%p)->(%p, %p, %08x, %p, %p)\n",
This, pDataObject, pFetc, advf,
645 pAdvise, pdwConnection);
647 if (pdwConnection==
NULL)
663 This->maxCons *
sizeof(*
This->connections));
665 This->remote_connections,
666 This->maxCons *
sizeof(*
This->remote_connections));
669 new_conn.pAdvSink = pAdvise;
670 new_conn.advf = advf & ~WINE_ADVF_REMOTE;
671 new_conn.formatetc = *pFetc;
672 new_conn.dwConnection =
index + 1;
683 hr = IDataObject_DAdvise(
This->delegate, &new_conn.formatetc,
684 new_conn.advf, new_conn.pAdvSink,
688 IDataAdviseHolder_Unadvise(iface, new_conn.dwConnection);
693 else if(advf & ADVF_PRIMEFIRST)
696 IDataAdviseHolder_SendOnDataChange(iface, pDataObject, 0, advf);
699 *pdwConnection = new_conn.dwConnection;
712 TRACE(
"(%p)->(%u)\n",
This, dwConnection);
715 index = dwConnection - 1;
722 IDataObject_DUnadvise(
This->delegate,
This->remote_connections[
index]);
741 TRACE(
"(%p)->(%p)\n",
This, enum_advise);
743 IDataAdviseHolder_QueryInterface(iface, &
IID_IUnknown, (
void**)&unk);
745 IUnknown_Release(unk);
761 hr = IDataAdviseHolder_EnumAdvise(iface, &pEnum);
765 while (IEnumSTATDATA_Next(pEnum, 1, &statdata,
NULL) ==
S_OK)
768 stg.tymed = TYMED_NULL;
770 stg.pUnkForRelease =
NULL;
772 if(!(statdata.advf & ADVF_NODATA))
774 hr = IDataObject_GetData(data_obj, &statdata.formatetc, &stg);
777 IAdviseSink_OnDataChange(statdata.pAdvSink, &statdata.formatetc, &stg);
779 if(statdata.advf & ADVF_ONLYONCE)
781 IDataAdviseHolder_Unadvise(iface, statdata.dwConnection);
786 IEnumSTATDATA_Release(pEnum);
816 hr = IDataObject_DAdvise(pDelegate, &
This->connections[
index].formatetc,
824 This->delegate = pDelegate;
838 IDataObject_DUnadvise(
This->delegate,
This->remote_connections[
index]);
840 This->connections[
index].advf &= ~WINE_ADVF_REMOTE;
877 TRACE(
"(%p)\n", ppOAHolder);
879 if (ppOAHolder==
NULL)
884 if (*ppOAHolder !=
NULL)
895 TRACE(
"(%p)\n", ppDAHolder);
897 if (ppDAHolder==
NULL)
902 if (*ppDAHolder !=
NULL)
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
static HRESULT copy_formatetc(FORMATETC *dst, const FORMATETC *src)
#define HeapFree(x, y, z)
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
VOID WINAPI CoTaskMemFree(LPVOID ptr)
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
static HRESULT WINAPI EnumSTATDATA_Next(IEnumSTATDATA *iface, ULONG num, LPSTATDATA data, ULONG *fetched)
HRESULT EnumSTATDATA_Construct(IUnknown *holder, ULONG index, DWORD array_len, STATDATA *data, BOOL copy, IEnumSTATDATA **ppenum)
static HRESULT WINAPI EnumSTATDATA_QueryInterface(IEnumSTATDATA *iface, REFIID riid, void **ppv)
static EnumSTATDATA * impl_from_IEnumSTATDATA(IEnumSTATDATA *iface)
static HRESULT copy_statdata(STATDATA *dst, const STATDATA *src)
HRESULT WINAPI CreateDataAdviseHolder(IDataAdviseHolder **ppDAHolder)
static const IOleAdviseHolderVtbl oahvt
HRESULT WINAPI CreateOleAdviseHolder(IOleAdviseHolder **ppOAHolder)
static ULONG WINAPI OleAdviseHolderImpl_Release(IOleAdviseHolder *iface)
static HRESULT WINAPI DataAdviseHolder_SendOnDataChange(IDataAdviseHolder *iface, IDataObject *data_obj, DWORD dwReserved, DWORD advf)
static HRESULT WINAPI EnumSTATDATA_Clone(IEnumSTATDATA *iface, IEnumSTATDATA **ppenum)
static HRESULT WINAPI EnumSTATDATA_Reset(IEnumSTATDATA *iface)
static HRESULT WINAPI DataAdviseHolder_QueryInterface(IDataAdviseHolder *iface, REFIID riid, void **ppvObject)
static HRESULT WINAPI OleAdviseHolderImpl_Unadvise(IOleAdviseHolder *iface, DWORD dwConnection)
static HRESULT WINAPI DataAdviseHolder_EnumAdvise(IDataAdviseHolder *iface, IEnumSTATDATA **enum_advise)
static ULONG WINAPI DataAdviseHolder_Release(IDataAdviseHolder *iface)
static const IEnumSTATDATAVtbl EnumSTATDATA_VTable
static HRESULT WINAPI OleAdviseHolderImpl_SendOnSave(IOleAdviseHolder *iface)
static HRESULT WINAPI OleAdviseHolderImpl_SendOnRename(IOleAdviseHolder *iface, IMoniker *pmk)
static void release_statdata(STATDATA *data)
HRESULT DataAdviseHolder_OnConnect(IDataAdviseHolder *iface, IDataObject *pDelegate)
static const IDataAdviseHolderVtbl DataAdviseHolderImpl_VTable
static DataAdviseHolder * impl_from_IDataAdviseHolder(IDataAdviseHolder *iface)
static ULONG WINAPI EnumSTATDATA_AddRef(IEnumSTATDATA *iface)
static ULONG WINAPI DataAdviseHolder_AddRef(IDataAdviseHolder *iface)
void DataAdviseHolder_OnDisconnect(IDataAdviseHolder *iface)
static IOleAdviseHolder * OleAdviseHolderImpl_Constructor(void)
static HRESULT WINAPI EnumSTATDATA_Skip(IEnumSTATDATA *iface, ULONG num)
static HRESULT WINAPI OleAdviseHolderImpl_EnumAdvise(IOleAdviseHolder *iface, IEnumSTATDATA **enum_advise)
static HRESULT WINAPI OleAdviseHolderImpl_QueryInterface(IOleAdviseHolder *iface, REFIID iid, void **obj)
static void DataAdviseHolder_Destructor(DataAdviseHolder *ptrToDestroy)
static OleAdviseHolderImpl * impl_from_IOleAdviseHolder(IOleAdviseHolder *iface)
static IDataAdviseHolder * DataAdviseHolder_Constructor(void)
static ULONG WINAPI EnumSTATDATA_Release(IEnumSTATDATA *iface)
static void OleAdviseHolderImpl_Destructor(OleAdviseHolderImpl *This)
static HRESULT WINAPI OleAdviseHolderImpl_SendOnClose(IOleAdviseHolder *iface)
static HRESULT WINAPI DataAdviseHolder_Advise(IDataAdviseHolder *iface, IDataObject *pDataObject, FORMATETC *pFetc, DWORD advf, IAdviseSink *pAdvise, DWORD *pdwConnection)
static HRESULT WINAPI OleAdviseHolderImpl_Advise(IOleAdviseHolder *iface, IAdviseSink *pAdvise, DWORD *pdwConnection)
static HRESULT WINAPI DataAdviseHolder_Unadvise(IDataAdviseHolder *iface, DWORD dwConnection)
static ULONG WINAPI OleAdviseHolderImpl_AddRef(IOleAdviseHolder *iface)
const GUID IID_IOleAdviseHolder
const GUID IID_IDataAdviseHolder
const GUID IID_IEnumSTATDATA
#define IsEqualIID(riid1, riid2)
IDataAdviseHolder IDataAdviseHolder_iface
DWORD * remote_connections
IEnumSTATDATA IEnumSTATDATA_iface
IOleAdviseHolder IOleAdviseHolder_iface
#define CONTAINING_RECORD(address, type, field)
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
#define OLE_E_NOCONNECTION