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 #define WIN32_NO_STATUS
31 //#include "winuser.h"
35 #include <wine/debug.h>
37 WINE_DEFAULT_DEBUG_CHANNEL(wuapi
);
39 typedef struct _automatic_updates
41 IAutomaticUpdates IAutomaticUpdates_iface
;
45 static inline automatic_updates
*impl_from_IAutomaticUpdates( IAutomaticUpdates
*iface
)
47 return CONTAINING_RECORD(iface
, automatic_updates
, IAutomaticUpdates_iface
);
50 static ULONG WINAPI
automatic_updates_AddRef(
51 IAutomaticUpdates
*iface
)
53 automatic_updates
*automatic_updates
= impl_from_IAutomaticUpdates( iface
);
54 return InterlockedIncrement( &automatic_updates
->refs
);
57 static ULONG WINAPI
automatic_updates_Release(
58 IAutomaticUpdates
*iface
)
60 automatic_updates
*automatic_updates
= impl_from_IAutomaticUpdates( iface
);
61 LONG refs
= InterlockedDecrement( &automatic_updates
->refs
);
64 TRACE("destroying %p\n", automatic_updates
);
65 HeapFree( GetProcessHeap(), 0, automatic_updates
);
70 static HRESULT WINAPI
automatic_updates_QueryInterface(
71 IAutomaticUpdates
*iface
,
75 automatic_updates
*This
= impl_from_IAutomaticUpdates( iface
);
77 TRACE("%p %s %p\n", This
, debugstr_guid( riid
), ppvObject
);
79 if ( IsEqualGUID( riid
, &IID_IAutomaticUpdates
) ||
80 IsEqualGUID( riid
, &IID_IDispatch
) ||
81 IsEqualGUID( riid
, &IID_IUnknown
) )
87 FIXME("interface %s not implemented\n", debugstr_guid(riid
));
90 IAutomaticUpdates_AddRef( iface
);
94 static HRESULT WINAPI
automatic_updates_GetTypeInfoCount(
95 IAutomaticUpdates
*iface
,
102 static HRESULT WINAPI
automatic_updates_GetTypeInfo(
103 IAutomaticUpdates
*iface
,
106 ITypeInfo
**ppTInfo
)
112 static HRESULT WINAPI
automatic_updates_GetIDsOfNames(
113 IAutomaticUpdates
*iface
,
124 static HRESULT WINAPI
automatic_updates_Invoke(
125 IAutomaticUpdates
*iface
,
130 DISPPARAMS
*pDispParams
,
132 EXCEPINFO
*pExcepInfo
,
139 static HRESULT WINAPI
automatic_updates_DetectNow(
140 IAutomaticUpdates
*This
)
146 static HRESULT WINAPI
automatic_updates_Pause(
147 IAutomaticUpdates
*This
)
153 static HRESULT WINAPI
automatic_updates_Resume(
154 IAutomaticUpdates
*This
)
160 static HRESULT WINAPI
automatic_updates_ShowSettingsDialog(
161 IAutomaticUpdates
*This
)
167 static HRESULT WINAPI
automatic_updates_EnableService(
168 IAutomaticUpdates
*This
)
174 static HRESULT WINAPI
automatic_updates_get_ServiceEnabled(
175 IAutomaticUpdates
*This
,
176 VARIANT_BOOL
*retval
)
178 FIXME("%p\n", retval
);
182 static HRESULT WINAPI
automatic_updates_get_Settings(
183 IAutomaticUpdates
*This
,
184 IAutomaticUpdatesSettings
**retval
)
186 FIXME("%p\n", retval
);
190 static const struct IAutomaticUpdatesVtbl automatic_updates_vtbl
=
192 automatic_updates_QueryInterface
,
193 automatic_updates_AddRef
,
194 automatic_updates_Release
,
195 automatic_updates_GetTypeInfoCount
,
196 automatic_updates_GetTypeInfo
,
197 automatic_updates_GetIDsOfNames
,
198 automatic_updates_Invoke
,
199 automatic_updates_DetectNow
,
200 automatic_updates_Pause
,
201 automatic_updates_Resume
,
202 automatic_updates_ShowSettingsDialog
,
203 automatic_updates_get_Settings
,
204 automatic_updates_get_ServiceEnabled
,
205 automatic_updates_EnableService
208 HRESULT
AutomaticUpdates_create( IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
210 automatic_updates
*updates
;
212 TRACE("(%p,%p)\n", pUnkOuter
, ppObj
);
214 updates
= HeapAlloc( GetProcessHeap(), 0, sizeof(*updates
) );
215 if (!updates
) return E_OUTOFMEMORY
;
217 updates
->IAutomaticUpdates_iface
.lpVtbl
= &automatic_updates_vtbl
;
220 *ppObj
= &updates
->IAutomaticUpdates_iface
;
222 TRACE("returning iface %p\n", *ppObj
);