ReactOS 0.4.15-dev-7660-g0086d05
updates.c
Go to the documentation of this file.
1/*
2 * IAutomaticUpdates implementation
3 *
4 * Copyright 2008 Hans Leidekker
5 *
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.
10 *
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.
15 *
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
19 */
20
21#define COBJMACROS
22
23#include <stdarg.h>
24
25#include "windef.h"
26#include "winbase.h"
27#include "winuser.h"
28#include "ole2.h"
29#include "wuapi.h"
30#include "wuapi_private.h"
31
32#include "wine/debug.h"
33
35
36typedef struct _automatic_updates
37{
38 IAutomaticUpdates IAutomaticUpdates_iface;
41
42static inline automatic_updates *impl_from_IAutomaticUpdates( IAutomaticUpdates *iface )
43{
44 return CONTAINING_RECORD(iface, automatic_updates, IAutomaticUpdates_iface);
45}
46
48 IAutomaticUpdates *iface )
49{
52}
53
55 IAutomaticUpdates *iface )
56{
59 if (!refs)
60 {
61 TRACE("destroying %p\n", automatic_updates);
63 }
64 return refs;
65}
66
68 IAutomaticUpdates *iface,
70 void **ppvObject )
71{
73
74 TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject );
75
76 if ( IsEqualGUID( riid, &IID_IAutomaticUpdates ) ||
79 {
80 *ppvObject = iface;
81 }
82 else
83 {
84 FIXME("interface %s not implemented\n", debugstr_guid(riid));
85 return E_NOINTERFACE;
86 }
87 IAutomaticUpdates_AddRef( iface );
88 return S_OK;
89}
90
92 IAutomaticUpdates *iface,
93 UINT *pctinfo )
94{
95 FIXME("\n");
96 return E_NOTIMPL;
97}
98
100 IAutomaticUpdates *iface,
101 UINT iTInfo,
102 LCID lcid,
103 ITypeInfo **ppTInfo )
104{
105 FIXME("\n");
106 return E_NOTIMPL;
107}
108
110 IAutomaticUpdates *iface,
111 REFIID riid,
112 LPOLESTR *rgszNames,
113 UINT cNames,
114 LCID lcid,
115 DISPID *rgDispId )
116{
117 FIXME("\n");
118 return E_NOTIMPL;
119}
120
122 IAutomaticUpdates *iface,
123 DISPID dispIdMember,
124 REFIID riid,
125 LCID lcid,
126 WORD wFlags,
127 DISPPARAMS *pDispParams,
128 VARIANT *pVarResult,
129 EXCEPINFO *pExcepInfo,
130 UINT *puArgErr )
131{
132 FIXME("\n");
133 return E_NOTIMPL;
134}
135
137 IAutomaticUpdates *This )
138{
139 FIXME("\n");
140 return E_NOTIMPL;
141}
142
144 IAutomaticUpdates *This )
145{
146 FIXME("\n");
147 return S_OK;
148}
149
151 IAutomaticUpdates *This )
152{
153 FIXME("\n");
154 return S_OK;
155}
156
158 IAutomaticUpdates *This )
159{
160 FIXME("\n");
161 return E_NOTIMPL;
162}
163
165 IAutomaticUpdates *This )
166{
167 FIXME("\n");
168 return E_NOTIMPL;
169}
170
172 IAutomaticUpdates *This,
173 VARIANT_BOOL *retval )
174{
175 FIXME("%p\n", retval);
176 return E_NOTIMPL;
177}
178
180 IAutomaticUpdates *This,
181 IAutomaticUpdatesSettings **retval )
182{
183 FIXME("%p\n", retval);
184 return E_NOTIMPL;
185}
186
187static const struct IAutomaticUpdatesVtbl automatic_updates_vtbl =
188{
203};
204
206{
207 automatic_updates *updates;
208
209 TRACE("(%p)\n", ppObj);
210
211 updates = HeapAlloc( GetProcessHeap(), 0, sizeof(*updates) );
212 if (!updates) return E_OUTOFMEMORY;
213
215 updates->refs = 1;
216
217 *ppObj = &updates->IAutomaticUpdates_iface;
218
219 TRACE("returning iface %p\n", *ppObj);
220 return S_OK;
221}
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
const GUID IID_IUnknown
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_NOTIMPL
Definition: ddrawi.h:99
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
short VARIANT_BOOL
Definition: compat.h:2290
unsigned short WORD
Definition: ntddk_ex.h:93
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define debugstr_guid
Definition: kernel32.h:35
static LPOLESTR
Definition: stg_prop.c:27
static VARIANTARG static DISPID
Definition: ordinal.c:52
unsigned int UINT
Definition: ndis.h:50
const GUID IID_IDispatch
long LONG
Definition: pedump.c:60
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
DWORD LCID
Definition: nls.h:13
#define TRACE(s)
Definition: solgame.cpp:4
IAutomaticUpdates IAutomaticUpdates_iface
Definition: updates.c:38
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
static HRESULT WINAPI automatic_updates_QueryInterface(IAutomaticUpdates *iface, REFIID riid, void **ppvObject)
Definition: updates.c:67
static HRESULT WINAPI automatic_updates_GetTypeInfoCount(IAutomaticUpdates *iface, UINT *pctinfo)
Definition: updates.c:91
static automatic_updates * impl_from_IAutomaticUpdates(IAutomaticUpdates *iface)
Definition: updates.c:42
static HRESULT WINAPI automatic_updates_GetIDsOfNames(IAutomaticUpdates *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: updates.c:109
static ULONG WINAPI automatic_updates_Release(IAutomaticUpdates *iface)
Definition: updates.c:54
static HRESULT WINAPI automatic_updates_ShowSettingsDialog(IAutomaticUpdates *This)
Definition: updates.c:157
static HRESULT WINAPI automatic_updates_EnableService(IAutomaticUpdates *This)
Definition: updates.c:164
static HRESULT WINAPI automatic_updates_Pause(IAutomaticUpdates *This)
Definition: updates.c:143
HRESULT AutomaticUpdates_create(LPVOID *ppObj)
Definition: updates.c:205
static HRESULT WINAPI automatic_updates_DetectNow(IAutomaticUpdates *This)
Definition: updates.c:136
struct _automatic_updates automatic_updates
static HRESULT WINAPI automatic_updates_get_Settings(IAutomaticUpdates *This, IAutomaticUpdatesSettings **retval)
Definition: updates.c:179
static const struct IAutomaticUpdatesVtbl automatic_updates_vtbl
Definition: updates.c:187
static HRESULT WINAPI automatic_updates_Resume(IAutomaticUpdates *This)
Definition: updates.c:150
static HRESULT WINAPI automatic_updates_Invoke(IAutomaticUpdates *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: updates.c:121
static HRESULT WINAPI automatic_updates_get_ServiceEnabled(IAutomaticUpdates *This, VARIANT_BOOL *retval)
Definition: updates.c:171
static HRESULT WINAPI automatic_updates_GetTypeInfo(IAutomaticUpdates *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: updates.c:99
static ULONG WINAPI automatic_updates_AddRef(IAutomaticUpdates *iface)
Definition: updates.c:47
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:531
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:2364