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
32 #include "wine/debug.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(wuapi
);
36 typedef struct _automatic_updates
38 const struct IAutomaticUpdatesVtbl
*vtbl
;
42 static inline automatic_updates
*impl_from_IAutomaticUpdates( IAutomaticUpdates
*iface
)
44 return (automatic_updates
*)((char*)iface
- FIELD_OFFSET( automatic_updates
, vtbl
));
47 static ULONG WINAPI
automatic_updates_AddRef(
48 IAutomaticUpdates
*iface
)
50 automatic_updates
*automatic_updates
= impl_from_IAutomaticUpdates( iface
);
51 return InterlockedIncrement( &automatic_updates
->refs
);
54 static ULONG WINAPI
automatic_updates_Release(
55 IAutomaticUpdates
*iface
)
57 automatic_updates
*automatic_updates
= impl_from_IAutomaticUpdates( iface
);
58 LONG refs
= InterlockedDecrement( &automatic_updates
->refs
);
61 TRACE("destroying %p\n", automatic_updates
);
62 HeapFree( GetProcessHeap(), 0, automatic_updates
);
67 static HRESULT WINAPI
automatic_updates_QueryInterface(
68 IAutomaticUpdates
*iface
,
72 automatic_updates
*This
= impl_from_IAutomaticUpdates( iface
);
74 TRACE("%p %s %p\n", This
, debugstr_guid( riid
), ppvObject
);
76 if ( IsEqualGUID( riid
, &IID_IAutomaticUpdates
) ||
77 IsEqualGUID( riid
, &IID_IDispatch
) ||
78 IsEqualGUID( riid
, &IID_IUnknown
) )
84 FIXME("interface %s not implemented\n", debugstr_guid(riid
));
87 IAutomaticUpdates_AddRef( iface
);
91 static HRESULT WINAPI
automatic_updates_GetTypeInfoCount(
92 IAutomaticUpdates
*iface
,
99 static HRESULT WINAPI
automatic_updates_GetTypeInfo(
100 IAutomaticUpdates
*iface
,
103 ITypeInfo
**ppTInfo
)
109 static HRESULT WINAPI
automatic_updates_GetIDsOfNames(
110 IAutomaticUpdates
*iface
,
121 static HRESULT WINAPI
automatic_updates_Invoke(
122 IAutomaticUpdates
*iface
,
127 DISPPARAMS
*pDispParams
,
129 EXCEPINFO
*pExcepInfo
,
136 static HRESULT WINAPI
automatic_updates_DetectNow(
137 IAutomaticUpdates
*This
)
143 static HRESULT WINAPI
automatic_updates_Pause(
144 IAutomaticUpdates
*This
)
150 static HRESULT WINAPI
automatic_updates_Resume(
151 IAutomaticUpdates
*This
)
157 static HRESULT WINAPI
automatic_updates_ShowSettingsDialog(
158 IAutomaticUpdates
*This
)
164 static HRESULT WINAPI
automatic_updates_EnableService(
165 IAutomaticUpdates
*This
)
171 static HRESULT WINAPI
automatic_updates_get_ServiceEnabled(
172 IAutomaticUpdates
*This
,
173 VARIANT_BOOL
*retval
)
175 FIXME("%p\n", retval
);
179 static HRESULT WINAPI
automatic_updates_get_Settings(
180 IAutomaticUpdates
*This
,
181 IAutomaticUpdatesSettings
**retval
)
183 FIXME("%p\n", retval
);
187 static const struct IAutomaticUpdatesVtbl automatic_updates_vtbl
=
189 automatic_updates_QueryInterface
,
190 automatic_updates_AddRef
,
191 automatic_updates_Release
,
192 automatic_updates_GetTypeInfoCount
,
193 automatic_updates_GetTypeInfo
,
194 automatic_updates_GetIDsOfNames
,
195 automatic_updates_Invoke
,
196 automatic_updates_DetectNow
,
197 automatic_updates_Pause
,
198 automatic_updates_Resume
,
199 automatic_updates_ShowSettingsDialog
,
200 automatic_updates_get_Settings
,
201 automatic_updates_get_ServiceEnabled
,
202 automatic_updates_EnableService
205 HRESULT
AutomaticUpdates_create( IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
207 automatic_updates
*updates
;
209 TRACE("(%p,%p)\n", pUnkOuter
, ppObj
);
211 updates
= HeapAlloc( GetProcessHeap(), 0, sizeof(*updates
) );
212 if (!updates
) return E_OUTOFMEMORY
;
214 updates
->vtbl
= &automatic_updates_vtbl
;
217 *ppObj
= &updates
->vtbl
;
219 TRACE("returning iface %p\n", *ppObj
);