ReactOS  0.4.15-dev-1197-g8081ba9
searcher.c
Go to the documentation of this file.
1 /*
2  * IUpdateSearcher implementation
3  *
4  * Copyright 2008 Hans Leidekker
5  *
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.
10  *
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.
15  *
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
19  */
20 
21 #define COBJMACROS
22 
23 #include <stdarg.h>
24 
25 #include "windef.h"
26 #include "winbase.h"
27 #include "winuser.h"
28 #include "ole2.h"
29 #include "wuapi.h"
30 #include "wuapi_private.h"
31 
32 #include "wine/debug.h"
33 
35 
36 typedef struct _update_searcher
37 {
38  IUpdateSearcher IUpdateSearcher_iface;
41 
42 static inline update_searcher *impl_from_IUpdateSearcher( IUpdateSearcher *iface )
43 {
44  return CONTAINING_RECORD(iface, update_searcher, IUpdateSearcher_iface);
45 }
46 
48  IUpdateSearcher *iface )
49 {
52 }
53 
55  IUpdateSearcher *iface )
56 {
59  if (!refs)
60  {
61  TRACE("destroying %p\n", update_searcher);
63  }
64  return refs;
65 }
66 
68  IUpdateSearcher *iface,
69  REFIID riid,
70  void **ppvObject )
71 {
73 
74  TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject );
75 
76  if ( IsEqualGUID( riid, &IID_IUpdateSearcher ) ||
79  {
80  *ppvObject = iface;
81  }
82  else
83  {
84  FIXME("interface %s not implemented\n", debugstr_guid(riid));
85  return E_NOINTERFACE;
86  }
87  IUpdateSearcher_AddRef( iface );
88  return S_OK;
89 }
90 
92  IUpdateSearcher *iface,
93  UINT *pctinfo )
94 {
95  FIXME("\n");
96  return E_NOTIMPL;
97 }
98 
100  IUpdateSearcher *iface,
101  UINT iTInfo,
102  LCID lcid,
103  ITypeInfo **ppTInfo )
104 {
105  FIXME("\n");
106  return E_NOTIMPL;
107 }
108 
110  IUpdateSearcher *iface,
111  REFIID riid,
112  LPOLESTR *rgszNames,
113  UINT cNames,
114  LCID lcid,
115  DISPID *rgDispId )
116 {
117  FIXME("\n");
118  return E_NOTIMPL;
119 }
120 
122  IUpdateSearcher *iface,
123  DISPID dispIdMember,
124  REFIID riid,
125  LCID lcid,
126  WORD wFlags,
127  DISPPARAMS *pDispParams,
128  VARIANT *pVarResult,
129  EXCEPINFO *pExcepInfo,
130  UINT *puArgErr )
131 {
132  FIXME("\n");
133  return E_NOTIMPL;
134 }
135 
137  IUpdateSearcher *This,
138  VARIANT_BOOL *retval )
139 {
140  FIXME("\n");
141  return E_NOTIMPL;
142 }
143 
145  IUpdateSearcher *This,
147 {
148  FIXME("%p, %d\n", This, value);
149  return S_OK;
150 }
151 
153  IUpdateSearcher *This,
154  BSTR *retval )
155 {
156  FIXME("\n");
157  return E_NOTIMPL;
158 }
159 
161  IUpdateSearcher *This,
162  BSTR value )
163 {
164  FIXME("%p, %s\n", This, debugstr_w(value));
165  return E_NOTIMPL;
166 }
167 
169  IUpdateSearcher *This,
170  VARIANT_BOOL *retval )
171 {
172  FIXME("\n");
173  return E_NOTIMPL;
174 }
175 
177  IUpdateSearcher *This,
179 {
180  FIXME("\n");
181  return E_NOTIMPL;
182 }
183 
185  IUpdateSearcher *This,
186  ServerSelection *retval )
187 {
188  FIXME("\n");
189  return E_NOTIMPL;
190 }
191 
193  IUpdateSearcher *This,
195 {
196  FIXME("\n");
197  return E_NOTIMPL;
198 }
199 
201  IUpdateSearcher *This,
202  BSTR criteria,
203  IUnknown *onCompleted,
204  VARIANT state,
205  ISearchJob **retval )
206 {
207  FIXME("\n");
208  return E_NOTIMPL;
209 }
210 
212  IUpdateSearcher *This,
213  ISearchJob *searchJob,
214  ISearchResult **retval )
215 {
216  FIXME("\n");
217  return E_NOTIMPL;
218 }
219 
221  IUpdateSearcher *This,
222  BSTR unescaped,
223  BSTR *retval )
224 {
225  FIXME("\n");
226  return E_NOTIMPL;
227 }
228 
230  IUpdateSearcher *This,
231  LONG startIndex,
232  LONG count,
233  IUpdateHistoryEntryCollection **retval )
234 {
235  FIXME("\n");
236  return E_NOTIMPL;
237 }
238 
240  IUpdateSearcher *This,
241  BSTR criteria,
242  ISearchResult **retval )
243 {
244  FIXME("\n");
245  return E_NOTIMPL;
246 }
247 
249  IUpdateSearcher *This,
250  VARIANT_BOOL *retval )
251 {
252  FIXME("\n");
253  return E_NOTIMPL;
254 }
255 
257  IUpdateSearcher *This,
259 {
260  FIXME("\n");
261  return E_NOTIMPL;
262 }
263 
265  IUpdateSearcher *This,
266  LONG *retval )
267 {
268  FIXME("\n");
269  return E_NOTIMPL;
270 }
271 
273  IUpdateSearcher *This,
274  BSTR *retval )
275 {
276  FIXME("\n");
277  return E_NOTIMPL;
278 }
279 
281  IUpdateSearcher *This,
282  BSTR value )
283 {
284  FIXME("\n");
285  return E_NOTIMPL;
286 }
287 
288 static const struct IUpdateSearcherVtbl update_searcher_vtbl =
289 {
315 };
316 
318 {
319  update_searcher *searcher;
320 
321  TRACE("(%p)\n", ppObj);
322 
323  searcher = HeapAlloc( GetProcessHeap(), 0, sizeof(*searcher) );
324  if (!searcher) return E_OUTOFMEMORY;
325 
326  searcher->IUpdateSearcher_iface.lpVtbl = &update_searcher_vtbl;
327  searcher->refs = 1;
328 
329  *ppObj = &searcher->IUpdateSearcher_iface;
330 
331  TRACE("returning iface %p\n", *ppObj);
332  return S_OK;
333 }
static HRESULT WINAPI update_searcher_GetIDsOfNames(IUpdateSearcher *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: searcher.c:109
static HRESULT WINAPI update_searcher_GetTotalHistoryCount(IUpdateSearcher *This, LONG *retval)
Definition: searcher.c:264
static ULONG WINAPI update_searcher_AddRef(IUpdateSearcher *iface)
Definition: searcher.c:47
#define REFIID
Definition: guiddef.h:118
#define E_NOINTERFACE
Definition: winerror.h:2364
static HRESULT WINAPI update_searcher_get_CanAutomaticallyUpgradeService(IUpdateSearcher *This, VARIANT_BOOL *retval)
Definition: searcher.c:136
REFIID riid
Definition: precomp.h:44
GLuint GLuint GLsizei count
Definition: gl.h:1545
static HRESULT WINAPI update_searcher_get_Online(IUpdateSearcher *This, VARIANT_BOOL *retval)
Definition: searcher.c:248
WINE_DEFAULT_DEBUG_CHANNEL(wuapi)
DWORD LCID
Definition: nls.h:13
OLECHAR * BSTR
Definition: compat.h:2041
static LPOLESTR
Definition: stg_prop.c:27
short VARIANT_BOOL
Definition: compat.h:2038
static HRESULT WINAPI update_searcher_EscapeString(IUpdateSearcher *This, BSTR unescaped, BSTR *retval)
Definition: searcher.c:220
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static HRESULT WINAPI update_searcher_get_IncludePotentiallySupersededUpdates(IUpdateSearcher *This, VARIANT_BOOL *retval)
Definition: searcher.c:168
long LONG
Definition: pedump.c:60
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
enum WUApiLib::tagServerSelection ServerSelection
static HRESULT WINAPI update_searcher_get_ServiceID(IUpdateSearcher *This, BSTR *retval)
Definition: searcher.c:272
HRESULT UpdateSearcher_create(LPVOID *ppObj)
Definition: searcher.c:317
static HRESULT WINAPI update_searcher_put_ServerSelection(IUpdateSearcher *This, ServerSelection value)
Definition: searcher.c:192
#define debugstr_guid
Definition: kernel32.h:35
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
static HRESULT WINAPI update_searcher_EndSearch(IUpdateSearcher *This, ISearchJob *searchJob, ISearchResult **retval)
Definition: searcher.c:211
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:484
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:79
const GUID IID_IUnknown
#define WINAPI
Definition: msvc.h:6
unsigned short WORD
Definition: ntddk_ex.h:93
static HRESULT WINAPI update_searcher_GetTypeInfo(IUpdateSearcher *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: searcher.c:99
static HRESULT WINAPI update_searcher_put_CanAutomaticallyUpgradeService(IUpdateSearcher *This, VARIANT_BOOL value)
Definition: searcher.c:144
static HRESULT WINAPI update_searcher_get_ServerSelection(IUpdateSearcher *This, ServerSelection *retval)
Definition: searcher.c:184
const GUID IID_IDispatch
static HRESULT WINAPI update_searcher_put_ClientApplicationID(IUpdateSearcher *This, BSTR value)
Definition: searcher.c:160
IUpdateSearcher IUpdateSearcher_iface
Definition: searcher.c:38
static HRESULT WINAPI update_searcher_Invoke(IUpdateSearcher *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: searcher.c:121
#define InterlockedDecrement
Definition: armddk.h:52
static int state
Definition: maze.c:121
static update_searcher * impl_from_IUpdateSearcher(IUpdateSearcher *iface)
Definition: searcher.c:42
static HRESULT WINAPI update_searcher_get_ClientApplicationID(IUpdateSearcher *This, BSTR *retval)
Definition: searcher.c:152
static const struct IUpdateSearcherVtbl update_searcher_vtbl
Definition: searcher.c:288
REFIID LPVOID * ppvObject
Definition: precomp.h:44
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:534
struct stdole::EXCEPINFO EXCEPINFO
static VARIANTARG static DISPID
Definition: ordinal.c:49
#define S_OK
Definition: intsafe.h:51
#define InterlockedIncrement
Definition: armddk.h:53
static HRESULT WINAPI update_searcher_put_Online(IUpdateSearcher *This, VARIANT_BOOL value)
Definition: searcher.c:256
static HRESULT WINAPI update_searcher_QueryHistory(IUpdateSearcher *This, LONG startIndex, LONG count, IUpdateHistoryEntryCollection **retval)
Definition: searcher.c:229
#define E_NOTIMPL
Definition: ddrawi.h:99
static ULONG WINAPI update_searcher_Release(IUpdateSearcher *iface)
Definition: searcher.c:54
static HRESULT WINAPI update_searcher_GetTypeInfoCount(IUpdateSearcher *iface, UINT *pctinfo)
Definition: searcher.c:91
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
struct stdole::DISPPARAMS DISPPARAMS
struct _update_searcher update_searcher
unsigned int ULONG
Definition: retypes.h:1
static HRESULT WINAPI update_searcher_Search(IUpdateSearcher *This, BSTR criteria, ISearchResult **retval)
Definition: searcher.c:239
static HRESULT WINAPI update_searcher_BeginSearch(IUpdateSearcher *This, BSTR criteria, IUnknown *onCompleted, VARIANT state, ISearchJob **retval)
Definition: searcher.c:200
static HRESULT WINAPI update_searcher_QueryInterface(IUpdateSearcher *iface, REFIID riid, void **ppvObject)
Definition: searcher.c:67
#define HeapFree(x, y, z)
Definition: compat.h:483
static HRESULT WINAPI update_searcher_put_ServiceID(IUpdateSearcher *This, BSTR value)
Definition: searcher.c:280
static HRESULT WINAPI update_searcher_put_IncludePotentiallySupersededUpdates(IUpdateSearcher *This, VARIANT_BOOL value)
Definition: searcher.c:176