2 * IUpdateInstaller 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
21 #include "wuapi_private.h"
23 typedef struct _update_installer
25 IUpdateInstaller IUpdateInstaller_iface
;
29 static inline update_installer
*impl_from_IUpdateInstaller( IUpdateInstaller
*iface
)
31 return CONTAINING_RECORD(iface
, update_installer
, IUpdateInstaller_iface
);
34 static ULONG WINAPI
update_installer_AddRef(
35 IUpdateInstaller
*iface
)
37 update_installer
*update_installer
= impl_from_IUpdateInstaller( iface
);
38 return InterlockedIncrement( &update_installer
->refs
);
41 static ULONG WINAPI
update_installer_Release(
42 IUpdateInstaller
*iface
)
44 update_installer
*update_installer
= impl_from_IUpdateInstaller( iface
);
45 LONG refs
= InterlockedDecrement( &update_installer
->refs
);
48 TRACE("destroying %p\n", update_installer
);
49 HeapFree( GetProcessHeap(), 0, update_installer
);
54 static HRESULT WINAPI
update_installer_QueryInterface(
55 IUpdateInstaller
*iface
,
59 update_installer
*This
= impl_from_IUpdateInstaller( iface
);
61 TRACE("%p %s %p\n", This
, debugstr_guid( riid
), ppvObject
);
63 if ( IsEqualGUID( riid
, &IID_IUpdateInstaller
) ||
64 IsEqualGUID( riid
, &IID_IDispatch
) ||
65 IsEqualGUID( riid
, &IID_IUnknown
) )
71 FIXME("interface %s not implemented\n", debugstr_guid(riid
));
74 IUpdateInstaller_AddRef( iface
);
78 static HRESULT WINAPI
update_installer_GetTypeInfoCount(
79 IUpdateInstaller
*iface
,
86 static HRESULT WINAPI
update_installer_GetTypeInfo(
87 IUpdateInstaller
*iface
,
96 static HRESULT WINAPI
update_installer_GetIDsOfNames(
97 IUpdateInstaller
*iface
,
108 static HRESULT WINAPI
update_installer_Invoke(
109 IUpdateInstaller
*iface
,
114 DISPPARAMS
*pDispParams
,
116 EXCEPINFO
*pExcepInfo
,
123 static HRESULT WINAPI
update_installer_get_ClientApplicationID(
124 IUpdateInstaller
*This
,
131 static HRESULT WINAPI
update_installer_put_ClientApplicationID(
132 IUpdateInstaller
*This
,
135 FIXME("%p, %s\n", This
, debugstr_w(value
));
139 static HRESULT WINAPI
update_installer_get_IsForced(
140 IUpdateInstaller
*This
,
141 VARIANT_BOOL
*retval
)
147 static HRESULT WINAPI
update_installer_put_IsForced(
148 IUpdateInstaller
*This
,
155 static HRESULT WINAPI
update_installer_get_ParentHwnd(
156 IUpdateInstaller
*This
,
163 static HRESULT WINAPI
update_installer_put_ParentHwnd(
164 IUpdateInstaller
*This
,
171 static HRESULT WINAPI
update_installer_put_ParentWindow(
172 IUpdateInstaller
*This
,
179 static HRESULT WINAPI
update_installer_get_ParentWindow(
180 IUpdateInstaller
*This
,
187 static HRESULT WINAPI
update_installer_get_Updates(
188 IUpdateInstaller
*This
,
189 IUpdateCollection
**retval
)
195 static HRESULT WINAPI
update_installer_put_Updates(
196 IUpdateInstaller
*This
,
197 IUpdateCollection
*value
)
203 static HRESULT WINAPI
update_installer_BeginInstall(
204 IUpdateInstaller
*This
,
205 IUnknown
*onProgressChanged
,
206 IUnknown
*onCompleted
,
208 IInstallationJob
**retval
)
214 static HRESULT WINAPI
update_installer_BeginUninstall(
215 IUpdateInstaller
*This
,
216 IUnknown
*onProgressChanged
,
217 IUnknown
*onCompleted
,
219 IInstallationJob
**retval
)
225 static HRESULT WINAPI
update_installer_EndInstall(
226 IUpdateInstaller
*This
,
227 IInstallationJob
*value
,
228 IInstallationResult
**retval
)
234 static HRESULT WINAPI
update_installer_EndUninstall(
235 IUpdateInstaller
*This
,
236 IInstallationJob
*value
,
237 IInstallationResult
**retval
)
243 static HRESULT WINAPI
update_installer_Install(
244 IUpdateInstaller
*This
,
245 IInstallationResult
**retval
)
251 static HRESULT WINAPI
update_installer_RunWizard(
252 IUpdateInstaller
*This
,
254 IInstallationResult
**retval
)
260 static HRESULT WINAPI
update_installer_get_IsBusy(
261 IUpdateInstaller
*This
,
262 VARIANT_BOOL
*retval
)
268 static HRESULT WINAPI
update_installer_Uninstall(
269 IUpdateInstaller
*This
,
270 IInstallationResult
**retval
)
276 static HRESULT WINAPI
update_installer_get_AllowSourcePrompts(
277 IUpdateInstaller
*This
,
278 VARIANT_BOOL
*retval
)
284 static HRESULT WINAPI
update_installer_put_AllowSourcePrompts(
285 IUpdateInstaller
*This
,
292 static HRESULT WINAPI
update_installer_get_RebootRequiredBeforeInstallation(
293 IUpdateInstaller
*This
,
294 VARIANT_BOOL
*retval
)
300 static const struct IUpdateInstallerVtbl update_installer_vtbl
=
302 update_installer_QueryInterface
,
303 update_installer_AddRef
,
304 update_installer_Release
,
305 update_installer_GetTypeInfoCount
,
306 update_installer_GetTypeInfo
,
307 update_installer_GetIDsOfNames
,
308 update_installer_Invoke
,
309 update_installer_get_ClientApplicationID
,
310 update_installer_put_ClientApplicationID
,
311 update_installer_get_IsForced
,
312 update_installer_put_IsForced
,
313 update_installer_get_ParentHwnd
,
314 update_installer_put_ParentHwnd
,
315 update_installer_put_ParentWindow
,
316 update_installer_get_ParentWindow
,
317 update_installer_get_Updates
,
318 update_installer_put_Updates
,
319 update_installer_BeginInstall
,
320 update_installer_BeginUninstall
,
321 update_installer_EndInstall
,
322 update_installer_EndUninstall
,
323 update_installer_Install
,
324 update_installer_RunWizard
,
325 update_installer_get_IsBusy
,
326 update_installer_Uninstall
,
327 update_installer_get_AllowSourcePrompts
,
328 update_installer_put_AllowSourcePrompts
,
329 update_installer_get_RebootRequiredBeforeInstallation
332 HRESULT
UpdateInstaller_create( LPVOID
*ppObj
)
334 update_installer
*installer
;
336 TRACE("(%p)\n", ppObj
);
338 installer
= HeapAlloc( GetProcessHeap(), 0, sizeof(*installer
) );
339 if (!installer
) return E_OUTOFMEMORY
;
341 installer
->IUpdateInstaller_iface
.lpVtbl
= &update_installer_vtbl
;
344 *ppObj
= &installer
->IUpdateInstaller_iface
;
346 TRACE("returning iface %p\n", *ppObj
);