4 * Copyright 1998 Eric Kohl
11 #include "interfaces.h"
17 #define IsEqualGUID(rguid1, rguid2) (!memcmp(rguid1, rguid2, sizeof(GUID)))
18 #define IsEqualIID(riid1, riid2) IsEqualGUID(riid1, riid2)
19 #define IsEqualCLSID(rclsid1, rclsid2) IsEqualGUID(rclsid1, rclsid2)
22 /**************************************************************************
23 * IOleAdviseHolder Implementation
25 static HRESULT WINAPI
IOleAdviseHolder_QueryInterface(LPOLEADVISEHOLDER
,REFIID
,LPVOID
*);
26 static ULONG WINAPI
IOleAdviseHolder_AddRef(LPOLEADVISEHOLDER
);
27 static ULONG WINAPI
IOleAdviseHolder_Release(LPOLEADVISEHOLDER
);
28 static HRESULT WINAPI
IOleAdviseHolder_Advise(LPOLEADVISEHOLDER
, IAdviseSink
*, DWORD
*);
29 static HRESULT WINAPI
IOleAdviseHolder_Unadvise (LPOLEADVISEHOLDER
, DWORD
);
30 static HRESULT WINAPI
IOleAdviseHolder_EnumAdvise (LPOLEADVISEHOLDER
, IEnumSTATDATA
**);
31 static HRESULT WINAPI
IOleAdviseHolder_SendOnRename (LPOLEADVISEHOLDER
, IMoniker
*);
32 static HRESULT WINAPI
IOleAdviseHolder_SendOnSave (LPOLEADVISEHOLDER
this);
33 static HRESULT WINAPI
IOleAdviseHolder_SendOnClose (LPOLEADVISEHOLDER
this);
36 /**************************************************************************
37 * IOleAdviseHolder_VTable
39 static IOleAdviseHolder_VTable oahvt
=
41 IOleAdviseHolder_QueryInterface
,
42 IOleAdviseHolder_AddRef
,
43 IOleAdviseHolder_Release
,
44 IOleAdviseHolder_Advise
,
45 IOleAdviseHolder_Unadvise
,
46 IOleAdviseHolder_EnumAdvise
,
47 IOleAdviseHolder_SendOnRename
,
48 IOleAdviseHolder_SendOnSave
,
49 IOleAdviseHolder_SendOnClose
52 /**************************************************************************
53 * IOleAdviseHolder_Constructor
56 LPOLEADVISEHOLDER
IOleAdviseHolder_Constructor()
58 LPOLEADVISEHOLDER lpoah
;
60 lpoah
= (LPOLEADVISEHOLDER
)HeapAlloc(GetProcessHeap(),0,sizeof(IOleAdviseHolder
));
62 lpoah
->lpvtbl
= &oahvt
;
63 FIXME (ole
, "(%p)->()\n", lpoah
);
68 /**************************************************************************
69 * IOleAdviseHolder_QueryInterface
72 IOleAdviseHolder_QueryInterface (LPOLEADVISEHOLDER
this, REFIID riid
, LPVOID
*ppvObj
)
75 WINE_StringFromCLSID((LPCLSID
)riid
,xriid
);
76 FIXME (ole
, "(%p)->(\n\tIID:\t%s)\n", this, xriid
);
80 if(IsEqualIID(riid
, &IID_IUnknown
)) {
84 else if(IsEqualIID(riid
, &IID_IOleAdviseHolder
)) {
85 /* IOleAdviseHolder */
86 *ppvObj
= (IOleAdviseHolder
*) this;
90 (*(LPOLEADVISEHOLDER
*)ppvObj
)->lpvtbl
->fnAddRef(this);
91 FIXME (ole
, "-- Interface: (%p)->(%p)\n", ppvObj
, *ppvObj
);
95 FIXME (ole
, "-- Interface: E_NOINTERFACE\n");
99 /******************************************************************************
100 * IOleAdviseHolder_AddRef
103 IOleAdviseHolder_AddRef (LPOLEADVISEHOLDER
this)
105 FIXME (ole
, "(%p)->(count=%lu)\n", this, this->ref
);
106 return ++(this->ref
);
109 /******************************************************************************
110 * IOleAdviseHolder_Release
113 IOleAdviseHolder_Release (LPOLEADVISEHOLDER
this)
115 FIXME (ole
, "(%p)->(count=%lu)\n", this, this->ref
);
116 if (!--(this->ref
)) {
117 FIXME (ole
, "-- destroying IOleAdviseHolder(%p)\n", this);
118 HeapFree(GetProcessHeap(),0,this);
124 /******************************************************************************
125 * IOleAdviseHolder_Advise
127 static HRESULT WINAPI
128 IOleAdviseHolder_Advise (LPOLEADVISEHOLDER
this,
129 IAdviseSink
*pAdvise
, DWORD
*pdwConnection
)
131 FIXME (ole
, "(%p)->(%p %p)\n", this, pAdvise
, pdwConnection
);
138 /******************************************************************************
139 * IOleAdviseHolder_Unadvise
141 static HRESULT WINAPI
142 IOleAdviseHolder_Unadvise (LPOLEADVISEHOLDER
this, DWORD dwConnection
)
144 FIXME (ole
, "(%p)->(%lu)\n", this, dwConnection
);
149 /******************************************************************************
150 * IOleAdviseHolder_EnumAdvise
152 static HRESULT WINAPI
153 IOleAdviseHolder_EnumAdvise (LPOLEADVISEHOLDER
this, IEnumSTATDATA
**ppenumAdvise
)
155 FIXME (ole
, "(%p)->(%p)\n", this, ppenumAdvise
);
157 *ppenumAdvise
= NULL
;
162 /******************************************************************************
163 * IOleAdviseHolder_SendOnRename
165 static HRESULT WINAPI
166 IOleAdviseHolder_SendOnRename (LPOLEADVISEHOLDER
this, IMoniker
*pmk
)
168 FIXME (ole
, "(%p)->(%p)\n", this, pmk
);
174 /******************************************************************************
175 * IOleAdviseHolder_SendOnSave
177 static HRESULT WINAPI
178 IOleAdviseHolder_SendOnSave (LPOLEADVISEHOLDER
this)
180 FIXME (ole
, "(%p)\n", this);
186 /******************************************************************************
187 * IOleAdviseHolder_SendOnClose
189 static HRESULT WINAPI
190 IOleAdviseHolder_SendOnClose (LPOLEADVISEHOLDER
this)
192 FIXME (ole
, "(%p)\n", this);
198 /***********************************************************************
202 /***********************************************************************
203 * CreateOleAdviseHolder [OLE32.59]
205 HRESULT WINAPI
CreateOleAdviseHolder32 (LPOLEADVISEHOLDER
*ppOAHolder
)
207 FIXME(ole
,"(%p): stub!\n", ppOAHolder
);
209 *ppOAHolder
= IOleAdviseHolder_Constructor ();
214 return E_OUTOFMEMORY
;