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 #define WIN32_NO_STATUS
31 //#include "winuser.h"
35 #include <wine/debug.h>
37 WINE_DEFAULT_DEBUG_CHANNEL(wuapi
);
39 typedef struct _update_installer
41 IUpdateInstaller IUpdateInstaller_iface
;
45 static inline update_installer
*impl_from_IUpdateInstaller( IUpdateInstaller
*iface
)
47 return CONTAINING_RECORD(iface
, update_installer
, IUpdateInstaller_iface
);
50 static ULONG WINAPI
update_installer_AddRef(
51 IUpdateInstaller
*iface
)
53 update_installer
*update_installer
= impl_from_IUpdateInstaller( iface
);
54 return InterlockedIncrement( &update_installer
->refs
);
57 static ULONG WINAPI
update_installer_Release(
58 IUpdateInstaller
*iface
)
60 update_installer
*update_installer
= impl_from_IUpdateInstaller( iface
);
61 LONG refs
= InterlockedDecrement( &update_installer
->refs
);
64 TRACE("destroying %p\n", update_installer
);
65 HeapFree( GetProcessHeap(), 0, update_installer
);
70 static HRESULT WINAPI
update_installer_QueryInterface(
71 IUpdateInstaller
*iface
,
75 update_installer
*This
= impl_from_IUpdateInstaller( iface
);
77 TRACE("%p %s %p\n", This
, debugstr_guid( riid
), ppvObject
);
79 if ( IsEqualGUID( riid
, &IID_IUpdateInstaller
) ||
80 IsEqualGUID( riid
, &IID_IDispatch
) ||
81 IsEqualGUID( riid
, &IID_IUnknown
) )
87 FIXME("interface %s not implemented\n", debugstr_guid(riid
));
90 IUpdateInstaller_AddRef( iface
);
94 static HRESULT WINAPI
update_installer_GetTypeInfoCount(
95 IUpdateInstaller
*iface
,
102 static HRESULT WINAPI
update_installer_GetTypeInfo(
103 IUpdateInstaller
*iface
,
106 ITypeInfo
**ppTInfo
)
112 static HRESULT WINAPI
update_installer_GetIDsOfNames(
113 IUpdateInstaller
*iface
,
124 static HRESULT WINAPI
update_installer_Invoke(
125 IUpdateInstaller
*iface
,
130 DISPPARAMS
*pDispParams
,
132 EXCEPINFO
*pExcepInfo
,
139 static HRESULT WINAPI
update_installer_get_ClientApplicationID(
140 IUpdateInstaller
*This
,
147 static HRESULT WINAPI
update_installer_put_ClientApplicationID(
148 IUpdateInstaller
*This
,
151 FIXME("%p, %s\n", This
, debugstr_w(value
));
155 static HRESULT WINAPI
update_installer_get_IsForced(
156 IUpdateInstaller
*This
,
157 VARIANT_BOOL
*retval
)
163 static HRESULT WINAPI
update_installer_put_IsForced(
164 IUpdateInstaller
*This
,
171 static HRESULT WINAPI
update_installer_get_ParentHwnd(
172 IUpdateInstaller
*This
,
179 static HRESULT WINAPI
update_installer_put_ParentHwnd(
180 IUpdateInstaller
*This
,
187 static HRESULT WINAPI
update_installer_put_ParentWindow(
188 IUpdateInstaller
*This
,
195 static HRESULT WINAPI
update_installer_get_ParentWindow(
196 IUpdateInstaller
*This
,
203 static HRESULT WINAPI
update_installer_get_Updates(
204 IUpdateInstaller
*This
,
205 IUpdateCollection
**retval
)
211 static HRESULT WINAPI
update_installer_put_Updates(
212 IUpdateInstaller
*This
,
213 IUpdateCollection
*value
)
219 static HRESULT WINAPI
update_installer_BeginInstall(
220 IUpdateInstaller
*This
,
221 IUnknown
*onProgressChanged
,
222 IUnknown
*onCompleted
,
224 IInstallationJob
**retval
)
230 static HRESULT WINAPI
update_installer_BeginUninstall(
231 IUpdateInstaller
*This
,
232 IUnknown
*onProgressChanged
,
233 IUnknown
*onCompleted
,
235 IInstallationJob
**retval
)
241 static HRESULT WINAPI
update_installer_EndInstall(
242 IUpdateInstaller
*This
,
243 IInstallationJob
*value
,
244 IInstallationResult
**retval
)
250 static HRESULT WINAPI
update_installer_EndUninstall(
251 IUpdateInstaller
*This
,
252 IInstallationJob
*value
,
253 IInstallationResult
**retval
)
259 static HRESULT WINAPI
update_installer_Install(
260 IUpdateInstaller
*This
,
261 IInstallationResult
**retval
)
267 static HRESULT WINAPI
update_installer_RunWizard(
268 IUpdateInstaller
*This
,
270 IInstallationResult
**retval
)
276 static HRESULT WINAPI
update_installer_get_IsBusy(
277 IUpdateInstaller
*This
,
278 VARIANT_BOOL
*retval
)
284 static HRESULT WINAPI
update_installer_Uninstall(
285 IUpdateInstaller
*This
,
286 IInstallationResult
**retval
)
292 static HRESULT WINAPI
update_installer_get_AllowSourcePrompts(
293 IUpdateInstaller
*This
,
294 VARIANT_BOOL
*retval
)
300 static HRESULT WINAPI
update_installer_put_AllowSourcePrompts(
301 IUpdateInstaller
*This
,
308 static HRESULT WINAPI
update_installer_get_RebootRequiredBeforeInstallation(
309 IUpdateInstaller
*This
,
310 VARIANT_BOOL
*retval
)
316 static const struct IUpdateInstallerVtbl update_installer_vtbl
=
318 update_installer_QueryInterface
,
319 update_installer_AddRef
,
320 update_installer_Release
,
321 update_installer_GetTypeInfoCount
,
322 update_installer_GetTypeInfo
,
323 update_installer_GetIDsOfNames
,
324 update_installer_Invoke
,
325 update_installer_get_ClientApplicationID
,
326 update_installer_put_ClientApplicationID
,
327 update_installer_get_IsForced
,
328 update_installer_put_IsForced
,
329 update_installer_get_ParentHwnd
,
330 update_installer_put_ParentHwnd
,
331 update_installer_put_ParentWindow
,
332 update_installer_get_ParentWindow
,
333 update_installer_get_Updates
,
334 update_installer_put_Updates
,
335 update_installer_BeginInstall
,
336 update_installer_BeginUninstall
,
337 update_installer_EndInstall
,
338 update_installer_EndUninstall
,
339 update_installer_Install
,
340 update_installer_RunWizard
,
341 update_installer_get_IsBusy
,
342 update_installer_Uninstall
,
343 update_installer_get_AllowSourcePrompts
,
344 update_installer_put_AllowSourcePrompts
,
345 update_installer_get_RebootRequiredBeforeInstallation
348 HRESULT
UpdateInstaller_create( IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
350 update_installer
*installer
;
352 TRACE("(%p,%p)\n", pUnkOuter
, ppObj
);
354 installer
= HeapAlloc( GetProcessHeap(), 0, sizeof(*installer
) );
355 if (!installer
) return E_OUTOFMEMORY
;
357 installer
->IUpdateInstaller_iface
.lpVtbl
= &update_installer_vtbl
;
360 *ppObj
= &installer
->IUpdateInstaller_iface
;
362 TRACE("returning iface %p\n", *ppObj
);