ReactOS  0.4.15-dev-1197-g8081ba9
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 
36 typedef struct _automatic_updates
37 {
38  IAutomaticUpdates IAutomaticUpdates_iface;
41 
42 static 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,
69  REFIID riid,
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 
187 static 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 }
WINE_DEFAULT_DEBUG_CHANNEL(wuapi)
#define REFIID
Definition: guiddef.h:118
#define E_NOINTERFACE
Definition: winerror.h:2364
static HRESULT WINAPI automatic_updates_GetIDsOfNames(IAutomaticUpdates *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: updates.c:109
REFIID riid
Definition: precomp.h:44
static HRESULT WINAPI automatic_updates_Pause(IAutomaticUpdates *This)
Definition: updates.c:143
static HRESULT WINAPI automatic_updates_ShowSettingsDialog(IAutomaticUpdates *This)
Definition: updates.c:157
struct _automatic_updates automatic_updates
DWORD LCID
Definition: nls.h:13
static LPOLESTR
Definition: stg_prop.c:27
IAutomaticUpdates IAutomaticUpdates_iface
Definition: updates.c:38
short VARIANT_BOOL
Definition: compat.h:2038
static HRESULT WINAPI automatic_updates_QueryInterface(IAutomaticUpdates *iface, REFIID riid, void **ppvObject)
Definition: updates.c:67
static HRESULT WINAPI automatic_updates_GetTypeInfo(IAutomaticUpdates *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: updates.c:99
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static HRESULT WINAPI automatic_updates_EnableService(IAutomaticUpdates *This)
Definition: updates.c:164
long LONG
Definition: pedump.c:60
#define FIXME(fmt,...)
Definition: debug.h:111
#define debugstr_guid
Definition: kernel32.h:35
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
static HRESULT WINAPI automatic_updates_GetTypeInfoCount(IAutomaticUpdates *iface, UINT *pctinfo)
Definition: updates.c:91
static ULONG WINAPI automatic_updates_Release(IAutomaticUpdates *iface)
Definition: updates.c:54
#define TRACE(s)
Definition: solgame.cpp:4
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
#define GetProcessHeap()
Definition: compat.h:484
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static HRESULT WINAPI automatic_updates_get_Settings(IAutomaticUpdates *This, IAutomaticUpdatesSettings **retval)
Definition: updates.c:179
LONG HRESULT
Definition: typedefs.h:79
const GUID IID_IUnknown
#define WINAPI
Definition: msvc.h:6
unsigned short WORD
Definition: ntddk_ex.h:93
static ULONG WINAPI automatic_updates_AddRef(IAutomaticUpdates *iface)
Definition: updates.c:47
const GUID IID_IDispatch
#define InterlockedDecrement
Definition: armddk.h:52
REFIID LPVOID * ppvObject
Definition: precomp.h:44
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:534
struct stdole::EXCEPINFO EXCEPINFO
static VARIANTARG static DISPID
Definition: ordinal.c:49
#define S_OK
Definition: intsafe.h:51
static HRESULT WINAPI automatic_updates_get_ServiceEnabled(IAutomaticUpdates *This, VARIANT_BOOL *retval)
Definition: updates.c:171
#define InterlockedIncrement
Definition: armddk.h:53
#define E_NOTIMPL
Definition: ddrawi.h:99
static const struct IAutomaticUpdatesVtbl automatic_updates_vtbl
Definition: updates.c:187
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static automatic_updates * impl_from_IAutomaticUpdates(IAutomaticUpdates *iface)
Definition: updates.c:42
struct stdole::DISPPARAMS DISPPARAMS
unsigned int ULONG
Definition: retypes.h:1
HRESULT AutomaticUpdates_create(LPVOID *ppObj)
Definition: updates.c:205
static HRESULT WINAPI automatic_updates_DetectNow(IAutomaticUpdates *This)
Definition: updates.c:136
static HRESULT WINAPI automatic_updates_Resume(IAutomaticUpdates *This)
Definition: updates.c:150
#define HeapFree(x, y, z)
Definition: compat.h:483