comctl32: Use SetRect() instead of open coding it.
[wine.git] / dlls / wuapi / updates.c
blob4f6648c5af0a1d7bfb3c075388e9157e5756f4c4
1 /*
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 COBJMACROS
23 #include "config.h"
24 #include <stdarg.h>
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winuser.h"
29 #include "ole2.h"
30 #include "wuapi.h"
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;
40 LONG refs;
41 } automatic_updates;
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 );
60 if (!refs)
62 TRACE("destroying %p\n", automatic_updates);
63 HeapFree( GetProcessHeap(), 0, automatic_updates );
65 return refs;
68 static HRESULT WINAPI automatic_updates_QueryInterface(
69 IAutomaticUpdates *iface,
70 REFIID riid,
71 void **ppvObject )
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 ) )
81 *ppvObject = iface;
83 else
85 FIXME("interface %s not implemented\n", debugstr_guid(riid));
86 return E_NOINTERFACE;
88 IAutomaticUpdates_AddRef( iface );
89 return S_OK;
92 static HRESULT WINAPI automatic_updates_GetTypeInfoCount(
93 IAutomaticUpdates *iface,
94 UINT *pctinfo )
96 FIXME("\n");
97 return E_NOTIMPL;
100 static HRESULT WINAPI automatic_updates_GetTypeInfo(
101 IAutomaticUpdates *iface,
102 UINT iTInfo,
103 LCID lcid,
104 ITypeInfo **ppTInfo )
106 FIXME("\n");
107 return E_NOTIMPL;
110 static HRESULT WINAPI automatic_updates_GetIDsOfNames(
111 IAutomaticUpdates *iface,
112 REFIID riid,
113 LPOLESTR *rgszNames,
114 UINT cNames,
115 LCID lcid,
116 DISPID *rgDispId )
118 FIXME("\n");
119 return E_NOTIMPL;
122 static HRESULT WINAPI automatic_updates_Invoke(
123 IAutomaticUpdates *iface,
124 DISPID dispIdMember,
125 REFIID riid,
126 LCID lcid,
127 WORD wFlags,
128 DISPPARAMS *pDispParams,
129 VARIANT *pVarResult,
130 EXCEPINFO *pExcepInfo,
131 UINT *puArgErr )
133 FIXME("\n");
134 return E_NOTIMPL;
137 static HRESULT WINAPI automatic_updates_DetectNow(
138 IAutomaticUpdates *This )
140 FIXME("\n");
141 return E_NOTIMPL;
144 static HRESULT WINAPI automatic_updates_Pause(
145 IAutomaticUpdates *This )
147 FIXME("\n");
148 return S_OK;
151 static HRESULT WINAPI automatic_updates_Resume(
152 IAutomaticUpdates *This )
154 FIXME("\n");
155 return S_OK;
158 static HRESULT WINAPI automatic_updates_ShowSettingsDialog(
159 IAutomaticUpdates *This )
161 FIXME("\n");
162 return E_NOTIMPL;
165 static HRESULT WINAPI automatic_updates_EnableService(
166 IAutomaticUpdates *This )
168 FIXME("\n");
169 return E_NOTIMPL;
172 static HRESULT WINAPI automatic_updates_get_ServiceEnabled(
173 IAutomaticUpdates *This,
174 VARIANT_BOOL *retval )
176 FIXME("%p\n", retval);
177 return E_NOTIMPL;
180 static HRESULT WINAPI automatic_updates_get_Settings(
181 IAutomaticUpdates *This,
182 IAutomaticUpdatesSettings **retval )
184 FIXME("%p\n", retval);
185 return E_NOTIMPL;
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;
216 updates->refs = 1;
218 *ppObj = &updates->IAutomaticUpdates_iface;
220 TRACE("returning iface %p\n", *ppObj);
221 return S_OK;