ReactOS 0.4.15-dev-7953-g1f49173
downloader.c
Go to the documentation of this file.
1/*
2 * IUpdateDownloader 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 "initguid.h"
30#include "wuapi.h"
31#include "wuapi_private.h"
32
33#include "wine/debug.h"
34
36
37typedef struct _update_downloader
38{
39 IUpdateDownloader IUpdateDownloader_iface;
42
43static inline update_downloader *impl_from_IUpdateDownloader( IUpdateDownloader *iface )
44{
45 return CONTAINING_RECORD(iface, update_downloader, IUpdateDownloader_iface);
46}
47
49 IUpdateDownloader *iface )
50{
53}
54
56 IUpdateDownloader *iface )
57{
60 if (!refs)
61 {
62 TRACE("destroying %p\n", update_downloader);
64 }
65 return refs;
66}
67
69 IUpdateDownloader *iface,
71 void **ppvObject )
72{
74
75 TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject );
76
77 if ( IsEqualGUID( riid, &IID_IUpdateDownloader ) ||
80 {
81 *ppvObject = iface;
82 }
83 else
84 {
85 FIXME("interface %s not implemented\n", debugstr_guid(riid));
86 return E_NOINTERFACE;
87 }
88 IUpdateDownloader_AddRef( iface );
89 return S_OK;
90}
91
93 IUpdateDownloader *iface,
94 UINT *pctinfo )
95{
96 FIXME("\n");
97 return E_NOTIMPL;
98}
99
101 IUpdateDownloader *iface,
102 UINT iTInfo,
103 LCID lcid,
104 ITypeInfo **ppTInfo )
105{
106 FIXME("\n");
107 return E_NOTIMPL;
108}
109
111 IUpdateDownloader *iface,
112 REFIID riid,
113 LPOLESTR *rgszNames,
114 UINT cNames,
115 LCID lcid,
116 DISPID *rgDispId )
117{
118 FIXME("\n");
119 return E_NOTIMPL;
120}
121
123 IUpdateDownloader *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 )
132{
133 FIXME("\n");
134 return E_NOTIMPL;
135}
136
138 IUpdateDownloader *This,
139 VARIANT_BOOL *retval )
140{
141 FIXME("\n");
142 return E_NOTIMPL;
143}
144
146 IUpdateDownloader *This,
148{
149 FIXME("%p, %d\n", This, value);
150 return S_OK;
151}
152
154 IUpdateDownloader *This,
155 BSTR *retval )
156{
157 FIXME("\n");
158 return E_NOTIMPL;
159}
160
162 IUpdateDownloader *This,
163 BSTR value )
164{
165 FIXME("%p, %s\n", This, debugstr_w(value));
166 return E_NOTIMPL;
167}
168
170 IUpdateDownloader *This,
171 DownloadPriority *retval )
172{
173 FIXME("\n");
174 return E_NOTIMPL;
175}
176
178 IUpdateDownloader *This,
179 DownloadPriority value )
180{
181 FIXME("\n");
182 return E_NOTIMPL;
183}
184
186 IUpdateDownloader *This,
187 IUpdateCollection **retval )
188{
189 FIXME("\n");
190 return E_NOTIMPL;
191}
192
194 IUpdateDownloader *This,
195 IUpdateCollection *value )
196{
197 FIXME("\n");
198 return E_NOTIMPL;
199}
200
202 IUpdateDownloader *This,
203 IUnknown *onProgressChanged,
204 IUnknown *onCompleted,
206 IDownloadJob **retval )
207{
208 FIXME("\n");
209 return E_NOTIMPL;
210}
211
213 IUpdateDownloader *This,
214 IDownloadResult **retval )
215{
216 FIXME("\n");
217 return E_NOTIMPL;
218}
219
221 IUpdateDownloader *This,
222 IDownloadJob *value,
223 IDownloadResult **retval )
224{
225 FIXME("\n");
226 return E_NOTIMPL;
227}
228
229static const struct IUpdateDownloaderVtbl update_downloader_vtbl =
230{
249};
250
252{
253 update_downloader *downloader;
254
255 TRACE("(%p)\n", ppObj);
256
257 downloader = HeapAlloc( GetProcessHeap(), 0, sizeof(*downloader) );
258 if (!downloader) return E_OUTOFMEMORY;
259
261 downloader->refs = 1;
262
263 *ppObj = &downloader->IUpdateDownloader_iface;
264
265 TRACE("returning iface %p\n", *ppObj);
266 return S_OK;
267}
static int state
Definition: maze.c:121
#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
OLECHAR * BSTR
Definition: compat.h:2293
#define HeapFree(x, y, z)
Definition: compat.h:735
short VARIANT_BOOL
Definition: compat.h:2290
static const struct IUpdateDownloaderVtbl update_downloader_vtbl
Definition: downloader.c:229
static HRESULT WINAPI update_downloader_Invoke(IUpdateDownloader *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: downloader.c:122
static HRESULT WINAPI update_downloader_put_ClientApplicationID(IUpdateDownloader *This, BSTR value)
Definition: downloader.c:161
static ULONG WINAPI update_downloader_AddRef(IUpdateDownloader *iface)
Definition: downloader.c:48
static HRESULT WINAPI update_downloader_put_IsForced(IUpdateDownloader *This, VARIANT_BOOL value)
Definition: downloader.c:145
static HRESULT WINAPI update_downloader_GetIDsOfNames(IUpdateDownloader *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: downloader.c:110
static HRESULT WINAPI update_downloader_BeginDownload(IUpdateDownloader *This, IUnknown *onProgressChanged, IUnknown *onCompleted, VARIANT state, IDownloadJob **retval)
Definition: downloader.c:201
static HRESULT WINAPI update_downloader_get_ClientApplicationID(IUpdateDownloader *This, BSTR *retval)
Definition: downloader.c:153
static HRESULT WINAPI update_downloader_Download(IUpdateDownloader *This, IDownloadResult **retval)
Definition: downloader.c:212
static HRESULT WINAPI update_downloader_EndDownload(IUpdateDownloader *This, IDownloadJob *value, IDownloadResult **retval)
Definition: downloader.c:220
static update_downloader * impl_from_IUpdateDownloader(IUpdateDownloader *iface)
Definition: downloader.c:43
static HRESULT WINAPI update_downloader_put_Updates(IUpdateDownloader *This, IUpdateCollection *value)
Definition: downloader.c:193
static HRESULT WINAPI update_downloader_put_Priority(IUpdateDownloader *This, DownloadPriority value)
Definition: downloader.c:177
static HRESULT WINAPI update_downloader_get_Priority(IUpdateDownloader *This, DownloadPriority *retval)
Definition: downloader.c:169
static HRESULT WINAPI update_downloader_QueryInterface(IUpdateDownloader *iface, REFIID riid, void **ppvObject)
Definition: downloader.c:68
HRESULT UpdateDownloader_create(LPVOID *ppObj)
Definition: downloader.c:251
struct _update_downloader update_downloader
static ULONG WINAPI update_downloader_Release(IUpdateDownloader *iface)
Definition: downloader.c:55
static HRESULT WINAPI update_downloader_GetTypeInfo(IUpdateDownloader *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: downloader.c:100
static HRESULT WINAPI update_downloader_get_IsForced(IUpdateDownloader *This, VARIANT_BOOL *retval)
Definition: downloader.c:137
static HRESULT WINAPI update_downloader_get_Updates(IUpdateDownloader *This, IUpdateCollection **retval)
Definition: downloader.c:185
static HRESULT WINAPI update_downloader_GetTypeInfoCount(IUpdateDownloader *iface, UINT *pctinfo)
Definition: downloader.c:92
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
#define debugstr_w
Definition: kernel32.h:32
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
IUpdateDownloader IUpdateDownloader_iface
Definition: downloader.c:39
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
Definition: pdh_main.c:94
_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