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
31 #include "wuapi_private.h"
33 #include "wine/debug.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(wuapi
);
37 typedef struct _update_installer
39 IUpdateInstaller IUpdateInstaller_iface
;
43 static inline update_installer
*impl_from_IUpdateInstaller( IUpdateInstaller
*iface
)
45 return CONTAINING_RECORD(iface
, update_installer
, IUpdateInstaller_iface
);
48 static ULONG WINAPI
update_installer_AddRef(
49 IUpdateInstaller
*iface
)
51 update_installer
*update_installer
= impl_from_IUpdateInstaller( iface
);
52 return InterlockedIncrement( &update_installer
->refs
);
55 static ULONG WINAPI
update_installer_Release(
56 IUpdateInstaller
*iface
)
58 update_installer
*update_installer
= impl_from_IUpdateInstaller( iface
);
59 LONG refs
= InterlockedDecrement( &update_installer
->refs
);
62 TRACE("destroying %p\n", update_installer
);
63 HeapFree( GetProcessHeap(), 0, update_installer
);
68 static HRESULT WINAPI
update_installer_QueryInterface(
69 IUpdateInstaller
*iface
,
73 update_installer
*This
= impl_from_IUpdateInstaller( iface
);
75 TRACE("%p %s %p\n", This
, debugstr_guid( riid
), ppvObject
);
77 if ( IsEqualGUID( riid
, &IID_IUpdateInstaller
) ||
78 IsEqualGUID( riid
, &IID_IDispatch
) ||
79 IsEqualGUID( riid
, &IID_IUnknown
) )
85 FIXME("interface %s not implemented\n", debugstr_guid(riid
));
88 IUpdateInstaller_AddRef( iface
);
92 static HRESULT WINAPI
update_installer_GetTypeInfoCount(
93 IUpdateInstaller
*iface
,
100 static HRESULT WINAPI
update_installer_GetTypeInfo(
101 IUpdateInstaller
*iface
,
104 ITypeInfo
**ppTInfo
)
110 static HRESULT WINAPI
update_installer_GetIDsOfNames(
111 IUpdateInstaller
*iface
,
122 static HRESULT WINAPI
update_installer_Invoke(
123 IUpdateInstaller
*iface
,
128 DISPPARAMS
*pDispParams
,
130 EXCEPINFO
*pExcepInfo
,
137 static HRESULT WINAPI
update_installer_get_ClientApplicationID(
138 IUpdateInstaller
*This
,
145 static HRESULT WINAPI
update_installer_put_ClientApplicationID(
146 IUpdateInstaller
*This
,
149 FIXME("%p, %s\n", This
, debugstr_w(value
));
153 static HRESULT WINAPI
update_installer_get_IsForced(
154 IUpdateInstaller
*This
,
155 VARIANT_BOOL
*retval
)
161 static HRESULT WINAPI
update_installer_put_IsForced(
162 IUpdateInstaller
*This
,
169 static HRESULT WINAPI
update_installer_get_ParentHwnd(
170 IUpdateInstaller
*This
,
177 static HRESULT WINAPI
update_installer_put_ParentHwnd(
178 IUpdateInstaller
*This
,
185 static HRESULT WINAPI
update_installer_put_ParentWindow(
186 IUpdateInstaller
*This
,
193 static HRESULT WINAPI
update_installer_get_ParentWindow(
194 IUpdateInstaller
*This
,
201 static HRESULT WINAPI
update_installer_get_Updates(
202 IUpdateInstaller
*This
,
203 IUpdateCollection
**retval
)
209 static HRESULT WINAPI
update_installer_put_Updates(
210 IUpdateInstaller
*This
,
211 IUpdateCollection
*value
)
217 static HRESULT WINAPI
update_installer_BeginInstall(
218 IUpdateInstaller
*This
,
219 IUnknown
*onProgressChanged
,
220 IUnknown
*onCompleted
,
222 IInstallationJob
**retval
)
228 static HRESULT WINAPI
update_installer_BeginUninstall(
229 IUpdateInstaller
*This
,
230 IUnknown
*onProgressChanged
,
231 IUnknown
*onCompleted
,
233 IInstallationJob
**retval
)
239 static HRESULT WINAPI
update_installer_EndInstall(
240 IUpdateInstaller
*This
,
241 IInstallationJob
*value
,
242 IInstallationResult
**retval
)
248 static HRESULT WINAPI
update_installer_EndUninstall(
249 IUpdateInstaller
*This
,
250 IInstallationJob
*value
,
251 IInstallationResult
**retval
)
257 static HRESULT WINAPI
update_installer_Install(
258 IUpdateInstaller
*This
,
259 IInstallationResult
**retval
)
265 static HRESULT WINAPI
update_installer_RunWizard(
266 IUpdateInstaller
*This
,
268 IInstallationResult
**retval
)
274 static HRESULT WINAPI
update_installer_get_IsBusy(
275 IUpdateInstaller
*This
,
276 VARIANT_BOOL
*retval
)
282 static HRESULT WINAPI
update_installer_Uninstall(
283 IUpdateInstaller
*This
,
284 IInstallationResult
**retval
)
290 static HRESULT WINAPI
update_installer_get_AllowSourcePrompts(
291 IUpdateInstaller
*This
,
292 VARIANT_BOOL
*retval
)
298 static HRESULT WINAPI
update_installer_put_AllowSourcePrompts(
299 IUpdateInstaller
*This
,
306 static HRESULT WINAPI
update_installer_get_RebootRequiredBeforeInstallation(
307 IUpdateInstaller
*This
,
308 VARIANT_BOOL
*retval
)
314 static const struct IUpdateInstallerVtbl update_installer_vtbl
=
316 update_installer_QueryInterface
,
317 update_installer_AddRef
,
318 update_installer_Release
,
319 update_installer_GetTypeInfoCount
,
320 update_installer_GetTypeInfo
,
321 update_installer_GetIDsOfNames
,
322 update_installer_Invoke
,
323 update_installer_get_ClientApplicationID
,
324 update_installer_put_ClientApplicationID
,
325 update_installer_get_IsForced
,
326 update_installer_put_IsForced
,
327 update_installer_get_ParentHwnd
,
328 update_installer_put_ParentHwnd
,
329 update_installer_put_ParentWindow
,
330 update_installer_get_ParentWindow
,
331 update_installer_get_Updates
,
332 update_installer_put_Updates
,
333 update_installer_BeginInstall
,
334 update_installer_BeginUninstall
,
335 update_installer_EndInstall
,
336 update_installer_EndUninstall
,
337 update_installer_Install
,
338 update_installer_RunWizard
,
339 update_installer_get_IsBusy
,
340 update_installer_Uninstall
,
341 update_installer_get_AllowSourcePrompts
,
342 update_installer_put_AllowSourcePrompts
,
343 update_installer_get_RebootRequiredBeforeInstallation
346 HRESULT
UpdateInstaller_create( LPVOID
*ppObj
)
348 update_installer
*installer
;
350 TRACE("(%p)\n", ppObj
);
352 installer
= HeapAlloc( GetProcessHeap(), 0, sizeof(*installer
) );
353 if (!installer
) return E_OUTOFMEMORY
;
355 installer
->IUpdateInstaller_iface
.lpVtbl
= &update_installer_vtbl
;
358 *ppObj
= &installer
->IUpdateInstaller_iface
;
360 TRACE("returning iface %p\n", *ppObj
);