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
31 #include "wuapi_private.h"
33 #include "wine/debug.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(wuapi
);
37 typedef struct _update_searcher
39 IUpdateSearcher IUpdateSearcher_iface
;
43 static inline update_searcher
*impl_from_IUpdateSearcher( IUpdateSearcher
*iface
)
45 return CONTAINING_RECORD(iface
, update_searcher
, IUpdateSearcher_iface
);
48 static ULONG WINAPI
update_searcher_AddRef(
49 IUpdateSearcher
*iface
)
51 update_searcher
*update_searcher
= impl_from_IUpdateSearcher( iface
);
52 return InterlockedIncrement( &update_searcher
->refs
);
55 static ULONG WINAPI
update_searcher_Release(
56 IUpdateSearcher
*iface
)
58 update_searcher
*update_searcher
= impl_from_IUpdateSearcher( iface
);
59 LONG refs
= InterlockedDecrement( &update_searcher
->refs
);
62 TRACE("destroying %p\n", update_searcher
);
63 HeapFree( GetProcessHeap(), 0, update_searcher
);
68 static HRESULT WINAPI
update_searcher_QueryInterface(
69 IUpdateSearcher
*iface
,
73 update_searcher
*This
= impl_from_IUpdateSearcher( iface
);
75 TRACE("%p %s %p\n", This
, debugstr_guid( riid
), ppvObject
);
77 if ( IsEqualGUID( riid
, &IID_IUpdateSearcher
) ||
78 IsEqualGUID( riid
, &IID_IDispatch
) ||
79 IsEqualGUID( riid
, &IID_IUnknown
) )
85 FIXME("interface %s not implemented\n", debugstr_guid(riid
));
88 IUpdateSearcher_AddRef( iface
);
92 static HRESULT WINAPI
update_searcher_GetTypeInfoCount(
93 IUpdateSearcher
*iface
,
100 static HRESULT WINAPI
update_searcher_GetTypeInfo(
101 IUpdateSearcher
*iface
,
104 ITypeInfo
**ppTInfo
)
110 static HRESULT WINAPI
update_searcher_GetIDsOfNames(
111 IUpdateSearcher
*iface
,
122 static HRESULT WINAPI
update_searcher_Invoke(
123 IUpdateSearcher
*iface
,
128 DISPPARAMS
*pDispParams
,
130 EXCEPINFO
*pExcepInfo
,
137 static HRESULT WINAPI
update_searcher_get_CanAutomaticallyUpgradeService(
138 IUpdateSearcher
*This
,
139 VARIANT_BOOL
*retval
)
145 static HRESULT WINAPI
update_searcher_put_CanAutomaticallyUpgradeService(
146 IUpdateSearcher
*This
,
149 FIXME("%p, %d\n", This
, value
);
153 static HRESULT WINAPI
update_searcher_get_ClientApplicationID(
154 IUpdateSearcher
*This
,
161 static HRESULT WINAPI
update_searcher_put_ClientApplicationID(
162 IUpdateSearcher
*This
,
165 FIXME("%p, %s\n", This
, debugstr_w(value
));
169 static HRESULT WINAPI
update_searcher_get_IncludePotentiallySupersededUpdates(
170 IUpdateSearcher
*This
,
171 VARIANT_BOOL
*retval
)
177 static HRESULT WINAPI
update_searcher_put_IncludePotentiallySupersededUpdates(
178 IUpdateSearcher
*This
,
185 static HRESULT WINAPI
update_searcher_get_ServerSelection(
186 IUpdateSearcher
*This
,
187 ServerSelection
*retval
)
193 static HRESULT WINAPI
update_searcher_put_ServerSelection(
194 IUpdateSearcher
*This
,
195 ServerSelection value
)
201 static HRESULT WINAPI
update_searcher_BeginSearch(
202 IUpdateSearcher
*This
,
204 IUnknown
*onCompleted
,
206 ISearchJob
**retval
)
212 static HRESULT WINAPI
update_searcher_EndSearch(
213 IUpdateSearcher
*This
,
214 ISearchJob
*searchJob
,
215 ISearchResult
**retval
)
221 static HRESULT WINAPI
update_searcher_EscapeString(
222 IUpdateSearcher
*This
,
230 static HRESULT WINAPI
update_searcher_QueryHistory(
231 IUpdateSearcher
*This
,
234 IUpdateHistoryEntryCollection
**retval
)
240 static HRESULT WINAPI
update_searcher_Search(
241 IUpdateSearcher
*This
,
243 ISearchResult
**retval
)
249 static HRESULT WINAPI
update_searcher_get_Online(
250 IUpdateSearcher
*This
,
251 VARIANT_BOOL
*retval
)
257 static HRESULT WINAPI
update_searcher_put_Online(
258 IUpdateSearcher
*This
,
265 static HRESULT WINAPI
update_searcher_GetTotalHistoryCount(
266 IUpdateSearcher
*This
,
273 static HRESULT WINAPI
update_searcher_get_ServiceID(
274 IUpdateSearcher
*This
,
281 static HRESULT WINAPI
update_searcher_put_ServiceID(
282 IUpdateSearcher
*This
,
289 static const struct IUpdateSearcherVtbl update_searcher_vtbl
=
291 update_searcher_QueryInterface
,
292 update_searcher_AddRef
,
293 update_searcher_Release
,
294 update_searcher_GetTypeInfoCount
,
295 update_searcher_GetTypeInfo
,
296 update_searcher_GetIDsOfNames
,
297 update_searcher_Invoke
,
298 update_searcher_get_CanAutomaticallyUpgradeService
,
299 update_searcher_put_CanAutomaticallyUpgradeService
,
300 update_searcher_get_ClientApplicationID
,
301 update_searcher_put_ClientApplicationID
,
302 update_searcher_get_IncludePotentiallySupersededUpdates
,
303 update_searcher_put_IncludePotentiallySupersededUpdates
,
304 update_searcher_get_ServerSelection
,
305 update_searcher_put_ServerSelection
,
306 update_searcher_BeginSearch
,
307 update_searcher_EndSearch
,
308 update_searcher_EscapeString
,
309 update_searcher_QueryHistory
,
310 update_searcher_Search
,
311 update_searcher_get_Online
,
312 update_searcher_put_Online
,
313 update_searcher_GetTotalHistoryCount
,
314 update_searcher_get_ServiceID
,
315 update_searcher_put_ServiceID
318 HRESULT
UpdateSearcher_create( LPVOID
*ppObj
)
320 update_searcher
*searcher
;
322 TRACE("(%p)\n", ppObj
);
324 searcher
= HeapAlloc( GetProcessHeap(), 0, sizeof(*searcher
) );
325 if (!searcher
) return E_OUTOFMEMORY
;
327 searcher
->IUpdateSearcher_iface
.lpVtbl
= &update_searcher_vtbl
;
330 *ppObj
= &searcher
->IUpdateSearcher_iface
;
332 TRACE("returning iface %p\n", *ppObj
);