4 * Copyright 1998 Eric Kohl
11 #include "interfaces.h"
16 #define IsEqualGUID(rguid1, rguid2) (!memcmp(rguid1, rguid2, sizeof(GUID)))
17 #define IsEqualIID(riid1, riid2) IsEqualGUID(riid1, riid2)
18 #define IsEqualCLSID(rclsid1, rclsid2) IsEqualGUID(rclsid1, rclsid2)
21 /**************************************************************************
22 * IOleAdviseHolder Implementation
24 static HRESULT WINAPI
IOleAdviseHolder_QueryInterface(LPOLEADVISEHOLDER
,REFIID
,LPVOID
*);
25 static ULONG WINAPI
IOleAdviseHolder_AddRef(LPOLEADVISEHOLDER
);
26 static ULONG WINAPI
IOleAdviseHolder_Release(LPOLEADVISEHOLDER
);
27 static HRESULT WINAPI
IOleAdviseHolder_Advise(LPOLEADVISEHOLDER
, IAdviseSink
*, DWORD
*);
28 static HRESULT WINAPI
IOleAdviseHolder_Unadvise (LPOLEADVISEHOLDER
, DWORD
);
29 static HRESULT WINAPI
IOleAdviseHolder_EnumAdvise (LPOLEADVISEHOLDER
, IEnumSTATDATA
**);
30 static HRESULT WINAPI
IOleAdviseHolder_SendOnRename (LPOLEADVISEHOLDER
, IMoniker
*);
31 static HRESULT WINAPI
IOleAdviseHolder_SendOnSave (LPOLEADVISEHOLDER
this);
32 static HRESULT WINAPI
IOleAdviseHolder_SendOnClose (LPOLEADVISEHOLDER
this);
35 /**************************************************************************
36 * IOleAdviseHolder_VTable
38 static IOleAdviseHolder_VTable oahvt
=
40 IOleAdviseHolder_QueryInterface
,
41 IOleAdviseHolder_AddRef
,
42 IOleAdviseHolder_Release
,
43 IOleAdviseHolder_Advise
,
44 IOleAdviseHolder_Unadvise
,
45 IOleAdviseHolder_EnumAdvise
,
46 IOleAdviseHolder_SendOnRename
,
47 IOleAdviseHolder_SendOnSave
,
48 IOleAdviseHolder_SendOnClose
51 /**************************************************************************
52 * IOleAdviseHolder_Constructor
55 LPOLEADVISEHOLDER
IOleAdviseHolder_Constructor()
57 LPOLEADVISEHOLDER lpoah
;
59 lpoah
= (LPOLEADVISEHOLDER
)HeapAlloc(GetProcessHeap(),0,sizeof(IOleAdviseHolder
));
61 lpoah
->lpvtbl
= &oahvt
;
62 FIXME (ole
, "(%p)->()\n", lpoah
);
67 /**************************************************************************
68 * IOleAdviseHolder_QueryInterface
71 IOleAdviseHolder_QueryInterface (LPOLEADVISEHOLDER
this, REFIID riid
, LPVOID
*ppvObj
)
74 WINE_StringFromCLSID((LPCLSID
)riid
,xriid
);
75 FIXME (ole
, "(%p)->(\n\tIID:\t%s)\n", this, xriid
);
79 if(IsEqualIID(riid
, &IID_IUnknown
)) {
83 else if(IsEqualIID(riid
, &IID_IOleAdviseHolder
)) {
84 /* IOleAdviseHolder */
85 *ppvObj
= (IOleAdviseHolder
*) this;
89 (*(LPOLEADVISEHOLDER
*)ppvObj
)->lpvtbl
->fnAddRef(this);
90 FIXME (ole
, "-- Interface: (%p)->(%p)\n", ppvObj
, *ppvObj
);
94 FIXME (ole
, "-- Interface: E_NOINTERFACE\n");
98 /******************************************************************************
99 * IOleAdviseHolder_AddRef
102 IOleAdviseHolder_AddRef (LPOLEADVISEHOLDER
this)
104 FIXME (ole
, "(%p)->(count=%lu)\n", this, this->ref
);
105 return ++(this->ref
);
108 /******************************************************************************
109 * IOleAdviseHolder_Release
112 IOleAdviseHolder_Release (LPOLEADVISEHOLDER
this)
114 FIXME (ole
, "(%p)->(count=%lu)\n", this, this->ref
);
115 if (!--(this->ref
)) {
116 FIXME (ole
, "-- destroying IOleAdviseHolder(%p)\n", this);
117 HeapFree(GetProcessHeap(),0,this);
123 /******************************************************************************
124 * IOleAdviseHolder_Advise
126 static HRESULT WINAPI
127 IOleAdviseHolder_Advise (LPOLEADVISEHOLDER
this,
128 IAdviseSink
*pAdvise
, DWORD
*pdwConnection
)
130 FIXME (ole
, "(%p)->(%p %p)\n", this, pAdvise
, pdwConnection
);
137 /******************************************************************************
138 * IOleAdviseHolder_Unadvise
140 static HRESULT WINAPI
141 IOleAdviseHolder_Unadvise (LPOLEADVISEHOLDER
this, DWORD dwConnection
)
143 FIXME (ole
, "(%p)->(%lu)\n", this, dwConnection
);
148 /******************************************************************************
149 * IOleAdviseHolder_EnumAdvise
151 static HRESULT WINAPI
152 IOleAdviseHolder_EnumAdvise (LPOLEADVISEHOLDER
this, IEnumSTATDATA
**ppenumAdvise
)
154 FIXME (ole
, "(%p)->(%p)\n", this, ppenumAdvise
);
156 *ppenumAdvise
= NULL
;
161 /******************************************************************************
162 * IOleAdviseHolder_SendOnRename
164 static HRESULT WINAPI
165 IOleAdviseHolder_SendOnRename (LPOLEADVISEHOLDER
this, IMoniker
*pmk
)
167 FIXME (ole
, "(%p)->(%p)\n", this, pmk
);
173 /******************************************************************************
174 * IOleAdviseHolder_SendOnSave
176 static HRESULT WINAPI
177 IOleAdviseHolder_SendOnSave (LPOLEADVISEHOLDER
this)
179 FIXME (ole
, "(%p)\n", this);
185 /******************************************************************************
186 * IOleAdviseHolder_SendOnClose
188 static HRESULT WINAPI
189 IOleAdviseHolder_SendOnClose (LPOLEADVISEHOLDER
this)
191 FIXME (ole
, "(%p)\n", this);
197 /***********************************************************************
201 /***********************************************************************
202 * CreateOleAdviseHolder [OLE32.59]
204 HRESULT WINAPI
CreateOleAdviseHolder32 (LPOLEADVISEHOLDER
*ppOAHolder
)
206 FIXME(ole
,"(%p): stub!\n", ppOAHolder
);
208 *ppOAHolder
= IOleAdviseHolder_Constructor ();
213 return E_OUTOFMEMORY
;