4 * Copyright 1998 Eric Kohl
12 #include "wine/obj_base.h"
13 #include "wine/obj_storage.h"
14 #include "wine/obj_moniker.h"
15 #include "wine/obj_dataobject.h"
20 #define IsEqualGUID(rguid1, rguid2) (!memcmp(rguid1, rguid2, sizeof(GUID)))
21 #define IsEqualIID(riid1, riid2) IsEqualGUID(riid1, riid2)
22 #define IsEqualCLSID(rclsid1, rclsid2) IsEqualGUID(rclsid1, rclsid2)
25 /**************************************************************************
26 * IOleAdviseHolder Implementation
28 static HRESULT WINAPI IOleAdviseHolder_QueryInterface(LPOLEADVISEHOLDER,REFIID,LPVOID*);
29 static ULONG WINAPI IOleAdviseHolder_AddRef(LPOLEADVISEHOLDER);
30 static ULONG WINAPI IOleAdviseHolder_Release(LPOLEADVISEHOLDER);
31 static HRESULT WINAPI IOleAdviseHolder_Advise(LPOLEADVISEHOLDER, IAdviseSink*, DWORD*);
32 static HRESULT WINAPI IOleAdviseHolder_Unadvise (LPOLEADVISEHOLDER, DWORD);
33 static HRESULT WINAPI IOleAdviseHolder_EnumAdvise (LPOLEADVISEHOLDER, IEnumSTATDATA **);
34 static HRESULT WINAPI IOleAdviseHolder_SendOnRename (LPOLEADVISEHOLDER, IMoniker *);
35 static HRESULT WINAPI IOleAdviseHolder_SendOnSave (LPOLEADVISEHOLDER this);
36 static HRESULT WINAPI IOleAdviseHolder_SendOnClose (LPOLEADVISEHOLDER this);
39 /**************************************************************************
40 * IOleAdviseHolder_VTable
42 static IOleAdviseHolder_VTable oahvt =
44 IOleAdviseHolder_QueryInterface,
45 IOleAdviseHolder_AddRef,
46 IOleAdviseHolder_Release,
47 IOleAdviseHolder_Advise,
48 IOleAdviseHolder_Unadvise,
49 IOleAdviseHolder_EnumAdvise,
50 IOleAdviseHolder_SendOnRename,
51 IOleAdviseHolder_SendOnSave,
52 IOleAdviseHolder_SendOnClose
55 /**************************************************************************
56 * IOleAdviseHolder_Constructor
59 LPOLEADVISEHOLDER IOleAdviseHolder_Constructor()
61 LPOLEADVISEHOLDER lpoah;
63 lpoah= (LPOLEADVISEHOLDER)HeapAlloc(GetProcessHeap(),0,sizeof(IOleAdviseHolder));
65 lpoah->lpvtbl = &oahvt;
66 FIXME (ole, "(%p)->()\n", lpoah);
71 /**************************************************************************
72 * IOleAdviseHolder_QueryInterface
75 IOleAdviseHolder_QueryInterface (LPOLEADVISEHOLDER this, REFIID riid, LPVOID *ppvObj)
78 WINE_StringFromCLSID((LPCLSID)riid,xriid);
79 FIXME (ole, "(%p)->(\n\tIID:\t%s)\n", this, xriid);
83 if(IsEqualIID(riid, &IID_IUnknown)) {
87 else if(IsEqualIID(riid, &IID_IOleAdviseHolder)) {
88 /* IOleAdviseHolder */
89 *ppvObj = (IOleAdviseHolder*) this;
93 (*(LPOLEADVISEHOLDER*)ppvObj)->lpvtbl->fnAddRef(this);
94 FIXME (ole, "-- Interface: (%p)->(%p)\n", ppvObj, *ppvObj);
98 FIXME (ole, "-- Interface: E_NOINTERFACE\n");
102 /******************************************************************************
103 * IOleAdviseHolder_AddRef
106 IOleAdviseHolder_AddRef (LPOLEADVISEHOLDER this)
108 FIXME (ole, "(%p)->(count=%lu)\n", this, this->ref);
109 return ++(this->ref);
112 /******************************************************************************
113 * IOleAdviseHolder_Release
116 IOleAdviseHolder_Release (LPOLEADVISEHOLDER this)
118 FIXME (ole, "(%p)->(count=%lu)\n", this, this->ref);
119 if (!--(this->ref)) {
120 FIXME (ole, "-- destroying IOleAdviseHolder(%p)\n", this);
121 HeapFree(GetProcessHeap(),0,this);
127 /******************************************************************************
128 * IOleAdviseHolder_Advise
130 static HRESULT WINAPI
131 IOleAdviseHolder_Advise (LPOLEADVISEHOLDER this,
132 IAdviseSink *pAdvise, DWORD *pdwConnection)
134 FIXME (ole, "(%p)->(%p %p)\n", this, pAdvise, pdwConnection);
141 /******************************************************************************
142 * IOleAdviseHolder_Unadvise
144 static HRESULT WINAPI
145 IOleAdviseHolder_Unadvise (LPOLEADVISEHOLDER this, DWORD dwConnection)
147 FIXME (ole, "(%p)->(%lu)\n", this, dwConnection);
152 /******************************************************************************
153 * IOleAdviseHolder_EnumAdvise
155 static HRESULT WINAPI
156 IOleAdviseHolder_EnumAdvise (LPOLEADVISEHOLDER this, IEnumSTATDATA **ppenumAdvise)
158 FIXME (ole, "(%p)->(%p)\n", this, ppenumAdvise);
160 *ppenumAdvise = NULL;
165 /******************************************************************************
166 * IOleAdviseHolder_SendOnRename
168 static HRESULT WINAPI
169 IOleAdviseHolder_SendOnRename (LPOLEADVISEHOLDER this, IMoniker *pmk)
171 FIXME (ole, "(%p)->(%p)\n", this, pmk);
177 /******************************************************************************
178 * IOleAdviseHolder_SendOnSave
180 static HRESULT WINAPI
181 IOleAdviseHolder_SendOnSave (LPOLEADVISEHOLDER this)
183 FIXME (ole, "(%p)\n", this);
189 /******************************************************************************
190 * IOleAdviseHolder_SendOnClose
192 static HRESULT WINAPI
193 IOleAdviseHolder_SendOnClose (LPOLEADVISEHOLDER this)
195 FIXME (ole, "(%p)\n", this);
201 /***********************************************************************
205 /***********************************************************************
206 * CreateOleAdviseHolder [OLE32.59]
208 HRESULT WINAPI CreateOleAdviseHolder32 (LPOLEADVISEHOLDER *ppOAHolder)
210 FIXME(ole,"(%p): stub!\n", ppOAHolder);
212 *ppOAHolder = IOleAdviseHolder_Constructor ();
217 return E_OUTOFMEMORY;