2 * IUpdateSearcher implementation
4 * Copyright 2008 Hans Leidekker
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
32 #include "wine/debug.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(wuapi);
36 typedef struct _update_searcher
38 IUpdateSearcher IUpdateSearcher_iface;
42 static inline update_searcher *impl_from_IUpdateSearcher( IUpdateSearcher *iface )
44 return CONTAINING_RECORD(iface, update_searcher, IUpdateSearcher_iface);
47 static ULONG WINAPI update_searcher_AddRef(
48 IUpdateSearcher *iface )
50 update_searcher *update_searcher = impl_from_IUpdateSearcher( iface );
51 return InterlockedIncrement( &update_searcher->refs );
54 static ULONG WINAPI update_searcher_Release(
55 IUpdateSearcher *iface )
57 update_searcher *update_searcher = impl_from_IUpdateSearcher( iface );
58 LONG refs = InterlockedDecrement( &update_searcher->refs );
61 TRACE("destroying %p\n", update_searcher);
62 HeapFree( GetProcessHeap(), 0, update_searcher );
67 static HRESULT WINAPI update_searcher_QueryInterface(
68 IUpdateSearcher *iface,
72 update_searcher *This = impl_from_IUpdateSearcher( iface );
74 TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject );
76 if ( IsEqualGUID( riid, &IID_IUpdateSearcher ) ||
77 IsEqualGUID( riid, &IID_IDispatch ) ||
78 IsEqualGUID( riid, &IID_IUnknown ) )
84 FIXME("interface %s not implemented\n", debugstr_guid(riid));
87 IUpdateSearcher_AddRef( iface );
91 static HRESULT WINAPI update_searcher_GetTypeInfoCount(
92 IUpdateSearcher *iface,
99 static HRESULT WINAPI update_searcher_GetTypeInfo(
100 IUpdateSearcher *iface,
103 ITypeInfo **ppTInfo )
109 static HRESULT WINAPI update_searcher_GetIDsOfNames(
110 IUpdateSearcher *iface,
121 static HRESULT WINAPI update_searcher_Invoke(
122 IUpdateSearcher *iface,
127 DISPPARAMS *pDispParams,
129 EXCEPINFO *pExcepInfo,
136 static HRESULT WINAPI update_searcher_get_CanAutomaticallyUpgradeService(
137 IUpdateSearcher *This,
138 VARIANT_BOOL *retval )
144 static HRESULT WINAPI update_searcher_put_CanAutomaticallyUpgradeService(
145 IUpdateSearcher *This,
148 FIXME("%p, %d\n", This, value);
152 static HRESULT WINAPI update_searcher_get_ClientApplicationID(
153 IUpdateSearcher *This,
160 static HRESULT WINAPI update_searcher_put_ClientApplicationID(
161 IUpdateSearcher *This,
164 FIXME("%p, %s\n", This, debugstr_w(value));
168 static HRESULT WINAPI update_searcher_get_IncludePotentiallySupersededUpdates(
169 IUpdateSearcher *This,
170 VARIANT_BOOL *retval )
176 static HRESULT WINAPI update_searcher_put_IncludePotentiallySupersededUpdates(
177 IUpdateSearcher *This,
184 static HRESULT WINAPI update_searcher_get_ServerSelection(
185 IUpdateSearcher *This,
186 ServerSelection *retval )
192 static HRESULT WINAPI update_searcher_put_ServerSelection(
193 IUpdateSearcher *This,
194 ServerSelection value )
200 static HRESULT WINAPI update_searcher_BeginSearch(
201 IUpdateSearcher *This,
203 IUnknown *onCompleted,
205 ISearchJob **retval )
211 static HRESULT WINAPI update_searcher_EndSearch(
212 IUpdateSearcher *This,
213 ISearchJob *searchJob,
214 ISearchResult **retval )
220 static const struct IUpdateSearcherVtbl update_searcher_vtbl =
222 update_searcher_QueryInterface,
223 update_searcher_AddRef,
224 update_searcher_Release,
225 update_searcher_GetTypeInfoCount,
226 update_searcher_GetTypeInfo,
227 update_searcher_GetIDsOfNames,
228 update_searcher_Invoke,
229 update_searcher_get_CanAutomaticallyUpgradeService,
230 update_searcher_put_CanAutomaticallyUpgradeService,
231 update_searcher_get_ClientApplicationID,
232 update_searcher_put_ClientApplicationID,
233 update_searcher_get_IncludePotentiallySupersededUpdates,
234 update_searcher_put_IncludePotentiallySupersededUpdates,
235 update_searcher_get_ServerSelection,
236 update_searcher_put_ServerSelection,
237 update_searcher_BeginSearch,
238 update_searcher_EndSearch
241 HRESULT UpdateSearcher_create( IUnknown *pUnkOuter, LPVOID *ppObj )
243 update_searcher *searcher;
245 TRACE("(%p,%p)\n", pUnkOuter, ppObj);
247 searcher = HeapAlloc( GetProcessHeap(), 0, sizeof(*searcher) );
248 if (!searcher) return E_OUTOFMEMORY;
250 searcher->IUpdateSearcher_iface.lpVtbl = &update_searcher_vtbl;
253 *ppObj = &searcher->IUpdateSearcher_iface;
255 TRACE("returning iface %p\n", *ppObj);