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
32 #include "wine/debug.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(wuapi
);
36 typedef struct _update_installer
38 IUpdateInstaller IUpdateInstaller_iface
;
42 static inline update_installer
*impl_from_IUpdateInstaller( IUpdateInstaller
*iface
)
44 return CONTAINING_RECORD(iface
, update_installer
, IUpdateInstaller_iface
);
47 static ULONG WINAPI
update_installer_AddRef(
48 IUpdateInstaller
*iface
)
50 update_installer
*update_installer
= impl_from_IUpdateInstaller( iface
);
51 return InterlockedIncrement( &update_installer
->refs
);
54 static ULONG WINAPI
update_installer_Release(
55 IUpdateInstaller
*iface
)
57 update_installer
*update_installer
= impl_from_IUpdateInstaller( iface
);
58 LONG refs
= InterlockedDecrement( &update_installer
->refs
);
61 TRACE("destroying %p\n", update_installer
);
62 HeapFree( GetProcessHeap(), 0, update_installer
);
67 static HRESULT WINAPI
update_installer_QueryInterface(
68 IUpdateInstaller
*iface
,
72 update_installer
*This
= impl_from_IUpdateInstaller( iface
);
74 TRACE("%p %s %p\n", This
, debugstr_guid( riid
), ppvObject
);
76 if ( IsEqualGUID( riid
, &IID_IUpdateInstaller
) ||
77 IsEqualGUID( riid
, &IID_IDispatch
) ||
78 IsEqualGUID( riid
, &IID_IUnknown
) )
84 FIXME("interface %s not implemented\n", debugstr_guid(riid
));
87 IUpdateInstaller_AddRef( iface
);
91 static HRESULT WINAPI
update_installer_GetTypeInfoCount(
92 IUpdateInstaller
*iface
,
99 static HRESULT WINAPI
update_installer_GetTypeInfo(
100 IUpdateInstaller
*iface
,
103 ITypeInfo
**ppTInfo
)
109 static HRESULT WINAPI
update_installer_GetIDsOfNames(
110 IUpdateInstaller
*iface
,
121 static HRESULT WINAPI
update_installer_Invoke(
122 IUpdateInstaller
*iface
,
127 DISPPARAMS
*pDispParams
,
129 EXCEPINFO
*pExcepInfo
,
136 static HRESULT WINAPI
update_installer_get_ClientApplicationID(
137 IUpdateInstaller
*This
,
144 static HRESULT WINAPI
update_installer_put_ClientApplicationID(
145 IUpdateInstaller
*This
,
148 FIXME("%p, %s\n", This
, debugstr_w(value
));
152 static HRESULT WINAPI
update_installer_get_IsForced(
153 IUpdateInstaller
*This
,
154 VARIANT_BOOL
*retval
)
160 static HRESULT WINAPI
update_installer_put_IsForced(
161 IUpdateInstaller
*This
,
168 static HRESULT WINAPI
update_installer_get_ParentHwnd(
169 IUpdateInstaller
*This
,
176 static HRESULT WINAPI
update_installer_put_ParentHwnd(
177 IUpdateInstaller
*This
,
184 static HRESULT WINAPI
update_installer_put_ParentWindow(
185 IUpdateInstaller
*This
,
192 static HRESULT WINAPI
update_installer_get_ParentWindow(
193 IUpdateInstaller
*This
,
200 static HRESULT WINAPI
update_installer_get_Updates(
201 IUpdateInstaller
*This
,
202 IUpdateCollection
**retval
)
208 static HRESULT WINAPI
update_installer_put_Updates(
209 IUpdateInstaller
*This
,
210 IUpdateCollection
*value
)
216 static HRESULT WINAPI
update_installer_BeginInstall(
217 IUpdateInstaller
*This
,
218 IUnknown
*onProgressChanged
,
219 IUnknown
*onCompleted
,
221 IInstallationJob
**retval
)
227 static HRESULT WINAPI
update_installer_BeginUninstall(
228 IUpdateInstaller
*This
,
229 IUnknown
*onProgressChanged
,
230 IUnknown
*onCompleted
,
232 IInstallationJob
**retval
)
238 static HRESULT WINAPI
update_installer_EndInstall(
239 IUpdateInstaller
*This
,
240 IInstallationJob
*value
,
241 IInstallationResult
**retval
)
247 static HRESULT WINAPI
update_installer_EndUninstall(
248 IUpdateInstaller
*This
,
249 IInstallationJob
*value
,
250 IInstallationResult
**retval
)
256 static HRESULT WINAPI
update_installer_Install(
257 IUpdateInstaller
*This
,
258 IInstallationResult
**retval
)
264 static HRESULT WINAPI
update_installer_RunWizard(
265 IUpdateInstaller
*This
,
267 IInstallationResult
**retval
)
273 static HRESULT WINAPI
update_installer_get_IsBusy(
274 IUpdateInstaller
*This
,
275 VARIANT_BOOL
*retval
)
281 static HRESULT WINAPI
update_installer_Uninstall(
282 IUpdateInstaller
*This
,
283 IInstallationResult
**retval
)
289 static HRESULT WINAPI
update_installer_get_AllowSourcePrompts(
290 IUpdateInstaller
*This
,
291 VARIANT_BOOL
*retval
)
297 static HRESULT WINAPI
update_installer_put_AllowSourcePrompts(
298 IUpdateInstaller
*This
,
305 static HRESULT WINAPI
update_installer_get_RebootRequiredBeforeInstallation(
306 IUpdateInstaller
*This
,
307 VARIANT_BOOL
*retval
)
313 static const struct IUpdateInstallerVtbl update_installer_vtbl
=
315 update_installer_QueryInterface
,
316 update_installer_AddRef
,
317 update_installer_Release
,
318 update_installer_GetTypeInfoCount
,
319 update_installer_GetTypeInfo
,
320 update_installer_GetIDsOfNames
,
321 update_installer_Invoke
,
322 update_installer_get_ClientApplicationID
,
323 update_installer_put_ClientApplicationID
,
324 update_installer_get_IsForced
,
325 update_installer_put_IsForced
,
326 update_installer_get_ParentHwnd
,
327 update_installer_put_ParentHwnd
,
328 update_installer_put_ParentWindow
,
329 update_installer_get_ParentWindow
,
330 update_installer_get_Updates
,
331 update_installer_put_Updates
,
332 update_installer_BeginInstall
,
333 update_installer_BeginUninstall
,
334 update_installer_EndInstall
,
335 update_installer_EndUninstall
,
336 update_installer_Install
,
337 update_installer_RunWizard
,
338 update_installer_get_IsBusy
,
339 update_installer_Uninstall
,
340 update_installer_get_AllowSourcePrompts
,
341 update_installer_put_AllowSourcePrompts
,
342 update_installer_get_RebootRequiredBeforeInstallation
345 HRESULT
UpdateInstaller_create( IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
347 update_installer
*installer
;
349 TRACE("(%p,%p)\n", pUnkOuter
, ppObj
);
351 installer
= HeapAlloc( GetProcessHeap(), 0, sizeof(*installer
) );
352 if (!installer
) return E_OUTOFMEMORY
;
354 installer
->IUpdateInstaller_iface
.lpVtbl
= &update_installer_vtbl
;
357 *ppObj
= &installer
->IUpdateInstaller_iface
;
359 TRACE("returning iface %p\n", *ppObj
);