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
21 #include "wuapi_private.h"
23 typedef struct _automatic_updates
25 IAutomaticUpdates IAutomaticUpdates_iface
;
29 static inline automatic_updates
*impl_from_IAutomaticUpdates( IAutomaticUpdates
*iface
)
31 return CONTAINING_RECORD(iface
, automatic_updates
, IAutomaticUpdates_iface
);
34 static ULONG WINAPI
automatic_updates_AddRef(
35 IAutomaticUpdates
*iface
)
37 automatic_updates
*automatic_updates
= impl_from_IAutomaticUpdates( iface
);
38 return InterlockedIncrement( &automatic_updates
->refs
);
41 static ULONG WINAPI
automatic_updates_Release(
42 IAutomaticUpdates
*iface
)
44 automatic_updates
*automatic_updates
= impl_from_IAutomaticUpdates( iface
);
45 LONG refs
= InterlockedDecrement( &automatic_updates
->refs
);
48 TRACE("destroying %p\n", automatic_updates
);
49 HeapFree( GetProcessHeap(), 0, automatic_updates
);
54 static HRESULT WINAPI
automatic_updates_QueryInterface(
55 IAutomaticUpdates
*iface
,
59 automatic_updates
*This
= impl_from_IAutomaticUpdates( iface
);
61 TRACE("%p %s %p\n", This
, debugstr_guid( riid
), ppvObject
);
63 if ( IsEqualGUID( riid
, &IID_IAutomaticUpdates
) ||
64 IsEqualGUID( riid
, &IID_IDispatch
) ||
65 IsEqualGUID( riid
, &IID_IUnknown
) )
71 FIXME("interface %s not implemented\n", debugstr_guid(riid
));
74 IAutomaticUpdates_AddRef( iface
);
78 static HRESULT WINAPI
automatic_updates_GetTypeInfoCount(
79 IAutomaticUpdates
*iface
,
86 static HRESULT WINAPI
automatic_updates_GetTypeInfo(
87 IAutomaticUpdates
*iface
,
96 static HRESULT WINAPI
automatic_updates_GetIDsOfNames(
97 IAutomaticUpdates
*iface
,
108 static HRESULT WINAPI
automatic_updates_Invoke(
109 IAutomaticUpdates
*iface
,
114 DISPPARAMS
*pDispParams
,
116 EXCEPINFO
*pExcepInfo
,
123 static HRESULT WINAPI
automatic_updates_DetectNow(
124 IAutomaticUpdates
*This
)
130 static HRESULT WINAPI
automatic_updates_Pause(
131 IAutomaticUpdates
*This
)
137 static HRESULT WINAPI
automatic_updates_Resume(
138 IAutomaticUpdates
*This
)
144 static HRESULT WINAPI
automatic_updates_ShowSettingsDialog(
145 IAutomaticUpdates
*This
)
151 static HRESULT WINAPI
automatic_updates_EnableService(
152 IAutomaticUpdates
*This
)
158 static HRESULT WINAPI
automatic_updates_get_ServiceEnabled(
159 IAutomaticUpdates
*This
,
160 VARIANT_BOOL
*retval
)
162 FIXME("%p\n", retval
);
166 static HRESULT WINAPI
automatic_updates_get_Settings(
167 IAutomaticUpdates
*This
,
168 IAutomaticUpdatesSettings
**retval
)
170 FIXME("%p\n", retval
);
174 static const struct IAutomaticUpdatesVtbl automatic_updates_vtbl
=
176 automatic_updates_QueryInterface
,
177 automatic_updates_AddRef
,
178 automatic_updates_Release
,
179 automatic_updates_GetTypeInfoCount
,
180 automatic_updates_GetTypeInfo
,
181 automatic_updates_GetIDsOfNames
,
182 automatic_updates_Invoke
,
183 automatic_updates_DetectNow
,
184 automatic_updates_Pause
,
185 automatic_updates_Resume
,
186 automatic_updates_ShowSettingsDialog
,
187 automatic_updates_get_Settings
,
188 automatic_updates_get_ServiceEnabled
,
189 automatic_updates_EnableService
192 HRESULT
AutomaticUpdates_create( LPVOID
*ppObj
)
194 automatic_updates
*updates
;
196 TRACE("(%p)\n", ppObj
);
198 updates
= HeapAlloc( GetProcessHeap(), 0, sizeof(*updates
) );
199 if (!updates
) return E_OUTOFMEMORY
;
201 updates
->IAutomaticUpdates_iface
.lpVtbl
= &automatic_updates_vtbl
;
204 *ppObj
= &updates
->IAutomaticUpdates_iface
;
206 TRACE("returning iface %p\n", *ppObj
);