2 * IAutomaticUpdates 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 _automatic_updates
39 IAutomaticUpdates IAutomaticUpdates_iface
;
43 static inline automatic_updates
*impl_from_IAutomaticUpdates( IAutomaticUpdates
*iface
)
45 return CONTAINING_RECORD(iface
, automatic_updates
, IAutomaticUpdates_iface
);
48 static ULONG WINAPI
automatic_updates_AddRef(
49 IAutomaticUpdates
*iface
)
51 automatic_updates
*automatic_updates
= impl_from_IAutomaticUpdates( iface
);
52 return InterlockedIncrement( &automatic_updates
->refs
);
55 static ULONG WINAPI
automatic_updates_Release(
56 IAutomaticUpdates
*iface
)
58 automatic_updates
*automatic_updates
= impl_from_IAutomaticUpdates( iface
);
59 LONG refs
= InterlockedDecrement( &automatic_updates
->refs
);
62 TRACE("destroying %p\n", automatic_updates
);
63 HeapFree( GetProcessHeap(), 0, automatic_updates
);
68 static HRESULT WINAPI
automatic_updates_QueryInterface(
69 IAutomaticUpdates
*iface
,
73 automatic_updates
*This
= impl_from_IAutomaticUpdates( iface
);
75 TRACE("%p %s %p\n", This
, debugstr_guid( riid
), ppvObject
);
77 if ( IsEqualGUID( riid
, &IID_IAutomaticUpdates
) ||
78 IsEqualGUID( riid
, &IID_IDispatch
) ||
79 IsEqualGUID( riid
, &IID_IUnknown
) )
85 FIXME("interface %s not implemented\n", debugstr_guid(riid
));
88 IAutomaticUpdates_AddRef( iface
);
92 static HRESULT WINAPI
automatic_updates_GetTypeInfoCount(
93 IAutomaticUpdates
*iface
,
100 static HRESULT WINAPI
automatic_updates_GetTypeInfo(
101 IAutomaticUpdates
*iface
,
104 ITypeInfo
**ppTInfo
)
110 static HRESULT WINAPI
automatic_updates_GetIDsOfNames(
111 IAutomaticUpdates
*iface
,
122 static HRESULT WINAPI
automatic_updates_Invoke(
123 IAutomaticUpdates
*iface
,
128 DISPPARAMS
*pDispParams
,
130 EXCEPINFO
*pExcepInfo
,
137 static HRESULT WINAPI
automatic_updates_DetectNow(
138 IAutomaticUpdates
*This
)
144 static HRESULT WINAPI
automatic_updates_Pause(
145 IAutomaticUpdates
*This
)
151 static HRESULT WINAPI
automatic_updates_Resume(
152 IAutomaticUpdates
*This
)
158 static HRESULT WINAPI
automatic_updates_ShowSettingsDialog(
159 IAutomaticUpdates
*This
)
165 static HRESULT WINAPI
automatic_updates_EnableService(
166 IAutomaticUpdates
*This
)
172 static HRESULT WINAPI
automatic_updates_get_ServiceEnabled(
173 IAutomaticUpdates
*This
,
174 VARIANT_BOOL
*retval
)
176 FIXME("%p\n", retval
);
180 static HRESULT WINAPI
automatic_updates_get_Settings(
181 IAutomaticUpdates
*This
,
182 IAutomaticUpdatesSettings
**retval
)
184 FIXME("%p\n", retval
);
188 static const struct IAutomaticUpdatesVtbl automatic_updates_vtbl
=
190 automatic_updates_QueryInterface
,
191 automatic_updates_AddRef
,
192 automatic_updates_Release
,
193 automatic_updates_GetTypeInfoCount
,
194 automatic_updates_GetTypeInfo
,
195 automatic_updates_GetIDsOfNames
,
196 automatic_updates_Invoke
,
197 automatic_updates_DetectNow
,
198 automatic_updates_Pause
,
199 automatic_updates_Resume
,
200 automatic_updates_ShowSettingsDialog
,
201 automatic_updates_get_Settings
,
202 automatic_updates_get_ServiceEnabled
,
203 automatic_updates_EnableService
206 HRESULT
AutomaticUpdates_create( LPVOID
*ppObj
)
208 automatic_updates
*updates
;
210 TRACE("(%p)\n", ppObj
);
212 updates
= HeapAlloc( GetProcessHeap(), 0, sizeof(*updates
) );
213 if (!updates
) return E_OUTOFMEMORY
;
215 updates
->IAutomaticUpdates_iface
.lpVtbl
= &automatic_updates_vtbl
;
218 *ppObj
= &updates
->IAutomaticUpdates_iface
;
220 TRACE("returning iface %p\n", *ppObj
);