ReactOS  0.4.15-dev-1197-g8081ba9
installer.c
Go to the documentation of this file.
1 /*
2  * IUpdateInstaller 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_installer
37 {
38  IUpdateInstaller IUpdateInstaller_iface;
41 
42 static inline update_installer *impl_from_IUpdateInstaller( IUpdateInstaller *iface )
43 {
44  return CONTAINING_RECORD(iface, update_installer, IUpdateInstaller_iface);
45 }
46 
48  IUpdateInstaller *iface )
49 {
52 }
53 
55  IUpdateInstaller *iface )
56 {
59  if (!refs)
60  {
61  TRACE("destroying %p\n", update_installer);
63  }
64  return refs;
65 }
66 
68  IUpdateInstaller *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_IUpdateInstaller ) ||
79  {
80  *ppvObject = iface;
81  }
82  else
83  {
84  FIXME("interface %s not implemented\n", debugstr_guid(riid));
85  return E_NOINTERFACE;
86  }
87  IUpdateInstaller_AddRef( iface );
88  return S_OK;
89 }
90 
92  IUpdateInstaller *iface,
93  UINT *pctinfo )
94 {
95  FIXME("\n");
96  return E_NOTIMPL;
97 }
98 
100  IUpdateInstaller *iface,
101  UINT iTInfo,
102  LCID lcid,
103  ITypeInfo **ppTInfo )
104 {
105  FIXME("\n");
106  return E_NOTIMPL;
107 }
108 
110  IUpdateInstaller *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  IUpdateInstaller *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  IUpdateInstaller *This,
138  BSTR *retval )
139 {
140  FIXME("\n");
141  return E_NOTIMPL;
142 }
143 
145  IUpdateInstaller *This,
146  BSTR value )
147 {
148  FIXME("%p, %s\n", This, debugstr_w(value));
149  return E_NOTIMPL;
150 }
151 
153  IUpdateInstaller *This,
154  VARIANT_BOOL *retval )
155 {
156  FIXME("\n");
157  return E_NOTIMPL;
158 }
159 
161  IUpdateInstaller *This,
163 {
164  FIXME("\n");
165  return E_NOTIMPL;
166 }
167 
169  IUpdateInstaller *This,
170  HWND *retval )
171 {
172  FIXME("\n");
173  return E_NOTIMPL;
174 }
175 
177  IUpdateInstaller *This,
178  HWND value )
179 {
180  FIXME("\n");
181  return E_NOTIMPL;
182 }
183 
185  IUpdateInstaller *This,
186  IUnknown *value )
187 {
188  FIXME("\n");
189  return E_NOTIMPL;
190 }
191 
193  IUpdateInstaller *This,
194  IUnknown **retval )
195 {
196  FIXME("\n");
197  return E_NOTIMPL;
198 }
199 
201  IUpdateInstaller *This,
202  IUpdateCollection **retval )
203 {
204  FIXME("\n");
205  return E_NOTIMPL;
206 }
207 
209  IUpdateInstaller *This,
210  IUpdateCollection *value )
211 {
212  FIXME("\n");
213  return E_NOTIMPL;
214 }
215 
217  IUpdateInstaller *This,
218  IUnknown *onProgressChanged,
219  IUnknown *onCompleted,
220  VARIANT state,
221  IInstallationJob **retval )
222 {
223  FIXME("\n");
224  return E_NOTIMPL;
225 }
226 
228  IUpdateInstaller *This,
229  IUnknown *onProgressChanged,
230  IUnknown *onCompleted,
231  VARIANT state,
232  IInstallationJob **retval )
233 {
234  FIXME("\n");
235  return E_NOTIMPL;
236 }
237 
239  IUpdateInstaller *This,
240  IInstallationJob *value,
241  IInstallationResult **retval )
242 {
243  FIXME("\n");
244  return E_NOTIMPL;
245 }
246 
248  IUpdateInstaller *This,
249  IInstallationJob *value,
250  IInstallationResult **retval )
251 {
252  FIXME("\n");
253  return E_NOTIMPL;
254 }
255 
257  IUpdateInstaller *This,
258  IInstallationResult **retval )
259 {
260  FIXME("\n");
261  return E_NOTIMPL;
262 }
263 
265  IUpdateInstaller *This,
266  BSTR dialogTitle,
267  IInstallationResult **retval )
268 {
269  FIXME("\n");
270  return E_NOTIMPL;
271 }
272 
274  IUpdateInstaller *This,
275  VARIANT_BOOL *retval )
276 {
277  FIXME("\n");
278  return E_NOTIMPL;
279 }
280 
282  IUpdateInstaller *This,
283  IInstallationResult **retval )
284 {
285  FIXME("\n");
286  return E_NOTIMPL;
287 }
288 
290  IUpdateInstaller *This,
291  VARIANT_BOOL *retval )
292 {
293  FIXME("\n");
294  return E_NOTIMPL;
295 }
296 
298  IUpdateInstaller *This,
300 {
301  FIXME("\n");
302  return E_NOTIMPL;
303 }
304 
306  IUpdateInstaller *This,
307  VARIANT_BOOL *retval )
308 {
309  FIXME("\n");
310  return E_NOTIMPL;
311 }
312 
313 static const struct IUpdateInstallerVtbl update_installer_vtbl =
314 {
343 };
344 
346 {
347  update_installer *installer;
348 
349  TRACE("(%p)\n", ppObj);
350 
351  installer = HeapAlloc( GetProcessHeap(), 0, sizeof(*installer) );
352  if (!installer) return E_OUTOFMEMORY;
353 
354  installer->IUpdateInstaller_iface.lpVtbl = &update_installer_vtbl;
355  installer->refs = 1;
356 
357  *ppObj = &installer->IUpdateInstaller_iface;
358 
359  TRACE("returning iface %p\n", *ppObj);
360  return S_OK;
361 }
static HRESULT WINAPI update_installer_get_IsForced(IUpdateInstaller *This, VARIANT_BOOL *retval)
Definition: installer.c:152
static HRESULT WINAPI update_installer_get_Updates(IUpdateInstaller *This, IUpdateCollection **retval)
Definition: installer.c:200
static HRESULT WINAPI update_installer_GetIDsOfNames(IUpdateInstaller *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: installer.c:109
#define REFIID
Definition: guiddef.h:118
#define E_NOINTERFACE
Definition: winerror.h:2364
static HRESULT WINAPI update_installer_get_AllowSourcePrompts(IUpdateInstaller *This, VARIANT_BOOL *retval)
Definition: installer.c:289
HRESULT UpdateInstaller_create(LPVOID *ppObj)
Definition: installer.c:345
REFIID riid
Definition: precomp.h:44
static HRESULT WINAPI update_installer_put_Updates(IUpdateInstaller *This, IUpdateCollection *value)
Definition: installer.c:208
DWORD LCID
Definition: nls.h:13
OLECHAR * BSTR
Definition: compat.h:2041
static HRESULT WINAPI update_installer_get_ParentHwnd(IUpdateInstaller *This, HWND *retval)
Definition: installer.c:168
static HRESULT WINAPI update_installer_get_RebootRequiredBeforeInstallation(IUpdateInstaller *This, VARIANT_BOOL *retval)
Definition: installer.c:305
static LPOLESTR
Definition: stg_prop.c:27
short VARIANT_BOOL
Definition: compat.h:2038
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
IUpdateInstaller IUpdateInstaller_iface
Definition: installer.c:38
static HRESULT WINAPI update_installer_EndInstall(IUpdateInstaller *This, IInstallationJob *value, IInstallationResult **retval)
Definition: installer.c:238
long LONG
Definition: pedump.c:60
static HRESULT WINAPI update_installer_put_AllowSourcePrompts(IUpdateInstaller *This, VARIANT_BOOL value)
Definition: installer.c:297
static HRESULT WINAPI update_installer_put_ParentWindow(IUpdateInstaller *This, IUnknown *value)
Definition: installer.c:184
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
struct _update_installer update_installer
#define debugstr_guid
Definition: kernel32.h:35
static ULONG WINAPI update_installer_Release(IUpdateInstaller *iface)
Definition: installer.c:54
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
#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
static HRESULT WINAPI update_installer_get_ParentWindow(IUpdateInstaller *This, IUnknown **retval)
Definition: installer.c:192
static HRESULT WINAPI update_installer_Uninstall(IUpdateInstaller *This, IInstallationResult **retval)
Definition: installer.c:281
const GUID IID_IUnknown
static HRESULT WINAPI update_installer_put_IsForced(IUpdateInstaller *This, VARIANT_BOOL value)
Definition: installer.c:160
#define WINAPI
Definition: msvc.h:6
static HRESULT WINAPI update_installer_GetTypeInfoCount(IUpdateInstaller *iface, UINT *pctinfo)
Definition: installer.c:91
unsigned short WORD
Definition: ntddk_ex.h:93
static HRESULT WINAPI update_installer_GetTypeInfo(IUpdateInstaller *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: installer.c:99
static HRESULT WINAPI update_installer_put_ParentHwnd(IUpdateInstaller *This, HWND value)
Definition: installer.c:176
const GUID IID_IDispatch
static HRESULT WINAPI update_installer_RunWizard(IUpdateInstaller *This, BSTR dialogTitle, IInstallationResult **retval)
Definition: installer.c:264
#define InterlockedDecrement
Definition: armddk.h:52
static const struct IUpdateInstallerVtbl update_installer_vtbl
Definition: installer.c:313
static int state
Definition: maze.c:121
REFIID LPVOID * ppvObject
Definition: precomp.h:44
static update_installer * impl_from_IUpdateInstaller(IUpdateInstaller *iface)
Definition: installer.c:42
WINE_DEFAULT_DEBUG_CHANNEL(wuapi)
_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_installer_Install(IUpdateInstaller *This, IInstallationResult **retval)
Definition: installer.c:256
static HRESULT WINAPI update_installer_BeginUninstall(IUpdateInstaller *This, IUnknown *onProgressChanged, IUnknown *onCompleted, VARIANT state, IInstallationJob **retval)
Definition: installer.c:227
#define E_NOTIMPL
Definition: ddrawi.h:99
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static HRESULT WINAPI update_installer_get_IsBusy(IUpdateInstaller *This, VARIANT_BOOL *retval)
Definition: installer.c:273
static HRESULT WINAPI update_installer_get_ClientApplicationID(IUpdateInstaller *This, BSTR *retval)
Definition: installer.c:136
static HRESULT WINAPI update_installer_put_ClientApplicationID(IUpdateInstaller *This, BSTR value)
Definition: installer.c:144
static ULONG WINAPI update_installer_AddRef(IUpdateInstaller *iface)
Definition: installer.c:47
struct stdole::DISPPARAMS DISPPARAMS
unsigned int ULONG
Definition: retypes.h:1
static HRESULT WINAPI update_installer_QueryInterface(IUpdateInstaller *iface, REFIID riid, void **ppvObject)
Definition: installer.c:67
static HRESULT WINAPI update_installer_BeginInstall(IUpdateInstaller *This, IUnknown *onProgressChanged, IUnknown *onCompleted, VARIANT state, IInstallationJob **retval)
Definition: installer.c:216
static HRESULT WINAPI update_installer_EndUninstall(IUpdateInstaller *This, IInstallationJob *value, IInstallationResult **retval)
Definition: installer.c:247
#define HeapFree(x, y, z)
Definition: compat.h:483
static HRESULT WINAPI update_installer_Invoke(IUpdateInstaller *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: installer.c:121