msi: Read the disk prompt source list property from the user-unmanaged context.
[wine.git] / dlls / qmgr / job.c
blob8357b87d65b7b46aa621115c1d40751407e814b1
1 /*
2 * Background Copy Job Interface for BITS
4 * Copyright 2007 Google (Roy Shea)
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 #include "qmgr.h"
22 #include "wine/debug.h"
24 WINE_DEFAULT_DEBUG_CHANNEL(qmgr);
26 static void BackgroundCopyJobDestructor(BackgroundCopyJobImpl *This)
28 HeapFree(GetProcessHeap(), 0, This->displayName);
29 HeapFree(GetProcessHeap(), 0, This);
32 static ULONG WINAPI BITS_IBackgroundCopyJob_AddRef(IBackgroundCopyJob* iface)
34 BackgroundCopyJobImpl *This = (BackgroundCopyJobImpl *) iface;
35 return InterlockedIncrement(&This->ref);
38 static HRESULT WINAPI BITS_IBackgroundCopyJob_QueryInterface(
39 IBackgroundCopyJob* iface, REFIID riid, LPVOID *ppvObject)
41 BackgroundCopyJobImpl *This = (BackgroundCopyJobImpl *) iface;
42 TRACE("IID: %s\n", debugstr_guid(riid));
44 if (IsEqualGUID(riid, &IID_IUnknown)
45 || IsEqualGUID(riid, &IID_IBackgroundCopyJob))
47 *ppvObject = &This->lpVtbl;
48 BITS_IBackgroundCopyJob_AddRef(iface);
49 return S_OK;
52 *ppvObject = NULL;
53 return E_NOINTERFACE;
56 static ULONG WINAPI BITS_IBackgroundCopyJob_Release(IBackgroundCopyJob* iface)
58 BackgroundCopyJobImpl *This = (BackgroundCopyJobImpl *) iface;
59 ULONG ref = InterlockedDecrement(&This->ref);
61 if (ref == 0)
62 BackgroundCopyJobDestructor(This);
64 return ref;
67 /*** IBackgroundCopyJob methods ***/
69 static HRESULT WINAPI BITS_IBackgroundCopyJob_AddFileSet(
70 IBackgroundCopyJob* iface,
71 ULONG cFileCount,
72 BG_FILE_INFO *pFileSet)
74 FIXME("Not implemented\n");
75 return E_NOTIMPL;
78 static HRESULT WINAPI BITS_IBackgroundCopyJob_AddFile(
79 IBackgroundCopyJob* iface,
80 LPCWSTR RemoteUrl,
81 LPCWSTR LocalName)
83 FIXME("Not implemented\n");
84 return E_NOTIMPL;
87 static HRESULT WINAPI BITS_IBackgroundCopyJob_EnumFiles(
88 IBackgroundCopyJob* iface,
89 IEnumBackgroundCopyFiles **pEnum)
91 FIXME("Not implemented\n");
92 return E_NOTIMPL;
95 static HRESULT WINAPI BITS_IBackgroundCopyJob_Suspend(
96 IBackgroundCopyJob* iface)
98 FIXME("Not implemented\n");
99 return E_NOTIMPL;
102 static HRESULT WINAPI BITS_IBackgroundCopyJob_Resume(
103 IBackgroundCopyJob* iface)
105 FIXME("Not implemented\n");
106 return E_NOTIMPL;
109 static HRESULT WINAPI BITS_IBackgroundCopyJob_Cancel(
110 IBackgroundCopyJob* iface)
112 FIXME("Not implemented\n");
113 return E_NOTIMPL;
116 static HRESULT WINAPI BITS_IBackgroundCopyJob_Complete(
117 IBackgroundCopyJob* iface)
119 FIXME("Not implemented\n");
120 return E_NOTIMPL;
123 static HRESULT WINAPI BITS_IBackgroundCopyJob_GetId(
124 IBackgroundCopyJob* iface,
125 GUID *pVal)
127 BackgroundCopyJobImpl *This = (BackgroundCopyJobImpl *) iface;
128 memcpy(pVal, &This->jobId, sizeof *pVal);
129 return S_OK;
132 static HRESULT WINAPI BITS_IBackgroundCopyJob_GetType(
133 IBackgroundCopyJob* iface,
134 BG_JOB_TYPE *pVal)
136 FIXME("Not implemented\n");
137 return E_NOTIMPL;
140 static HRESULT WINAPI BITS_IBackgroundCopyJob_GetProgress(
141 IBackgroundCopyJob* iface,
142 BG_JOB_PROGRESS *pVal)
144 FIXME("Not implemented\n");
145 return E_NOTIMPL;
148 static HRESULT WINAPI BITS_IBackgroundCopyJob_GetTimes(
149 IBackgroundCopyJob* iface,
150 BG_JOB_TIMES *pVal)
152 FIXME("Not implemented\n");
153 return E_NOTIMPL;
156 static HRESULT WINAPI BITS_IBackgroundCopyJob_GetState(
157 IBackgroundCopyJob* iface,
158 BG_JOB_STATE *pVal)
160 FIXME("Not implemented\n");
161 return E_NOTIMPL;
164 static HRESULT WINAPI BITS_IBackgroundCopyJob_GetError(
165 IBackgroundCopyJob* iface,
166 IBackgroundCopyError **ppError)
168 FIXME("Not implemented\n");
169 return E_NOTIMPL;
172 static HRESULT WINAPI BITS_IBackgroundCopyJob_GetOwner(
173 IBackgroundCopyJob* iface,
174 LPWSTR *pVal)
176 FIXME("Not implemented\n");
177 return E_NOTIMPL;
180 static HRESULT WINAPI BITS_IBackgroundCopyJob_SetDisplayName(
181 IBackgroundCopyJob* iface,
182 LPCWSTR Val)
184 FIXME("Not implemented\n");
185 return E_NOTIMPL;
188 static HRESULT WINAPI BITS_IBackgroundCopyJob_GetDisplayName(
189 IBackgroundCopyJob* iface,
190 LPWSTR *pVal)
192 FIXME("Not implemented\n");
193 return E_NOTIMPL;
196 static HRESULT WINAPI BITS_IBackgroundCopyJob_SetDescription(
197 IBackgroundCopyJob* iface,
198 LPCWSTR Val)
200 FIXME("Not implemented\n");
201 return E_NOTIMPL;
204 static HRESULT WINAPI BITS_IBackgroundCopyJob_GetDescription(
205 IBackgroundCopyJob* iface,
206 LPWSTR *pVal)
208 FIXME("Not implemented\n");
209 return E_NOTIMPL;
212 static HRESULT WINAPI BITS_IBackgroundCopyJob_SetPriority(
213 IBackgroundCopyJob* iface,
214 BG_JOB_PRIORITY Val)
216 FIXME("Not implemented\n");
217 return E_NOTIMPL;
220 static HRESULT WINAPI BITS_IBackgroundCopyJob_GetPriority(
221 IBackgroundCopyJob* iface,
222 BG_JOB_PRIORITY *pVal)
224 FIXME("Not implemented\n");
225 return E_NOTIMPL;
228 static HRESULT WINAPI BITS_IBackgroundCopyJob_SetNotifyFlags(
229 IBackgroundCopyJob* iface,
230 ULONG Val)
232 FIXME("Not implemented\n");
233 return E_NOTIMPL;
236 static HRESULT WINAPI BITS_IBackgroundCopyJob_GetNotifyFlags(
237 IBackgroundCopyJob* iface,
238 ULONG *pVal)
240 FIXME("Not implemented\n");
241 return E_NOTIMPL;
244 static HRESULT WINAPI BITS_IBackgroundCopyJob_SetNotifyInterface(
245 IBackgroundCopyJob* iface,
246 IUnknown *Val)
248 FIXME("Not implemented\n");
249 return E_NOTIMPL;
252 static HRESULT WINAPI BITS_IBackgroundCopyJob_GetNotifyInterface(
253 IBackgroundCopyJob* iface,
254 IUnknown **pVal)
256 FIXME("Not implemented\n");
257 return E_NOTIMPL;
260 static HRESULT WINAPI BITS_IBackgroundCopyJob_SetMinimumRetryDelay(
261 IBackgroundCopyJob* iface,
262 ULONG Seconds)
264 FIXME("Not implemented\n");
265 return E_NOTIMPL;
268 static HRESULT WINAPI BITS_IBackgroundCopyJob_GetMinimumRetryDelay(
269 IBackgroundCopyJob* iface,
270 ULONG *Seconds)
272 FIXME("Not implemented\n");
273 return E_NOTIMPL;
276 static HRESULT WINAPI BITS_IBackgroundCopyJob_SetNoProgressTimeout(
277 IBackgroundCopyJob* iface,
278 ULONG Seconds)
280 FIXME("Not implemented\n");
281 return E_NOTIMPL;
284 static HRESULT WINAPI BITS_IBackgroundCopyJob_GetNoProgressTimeout(
285 IBackgroundCopyJob* iface,
286 ULONG *Seconds)
288 FIXME("Not implemented\n");
289 return E_NOTIMPL;
292 static HRESULT WINAPI BITS_IBackgroundCopyJob_GetErrorCount(
293 IBackgroundCopyJob* iface,
294 ULONG *Errors)
296 FIXME("Not implemented\n");
297 return E_NOTIMPL;
300 static HRESULT WINAPI BITS_IBackgroundCopyJob_SetProxySettings(
301 IBackgroundCopyJob* iface,
302 BG_JOB_PROXY_USAGE ProxyUsage,
303 const WCHAR *ProxyList,
304 const WCHAR *ProxyBypassList)
306 FIXME("Not implemented\n");
307 return E_NOTIMPL;
310 static HRESULT WINAPI BITS_IBackgroundCopyJob_GetProxySettings(
311 IBackgroundCopyJob* iface,
312 BG_JOB_PROXY_USAGE *pProxyUsage,
313 LPWSTR *pProxyList,
314 LPWSTR *pProxyBypassList)
316 FIXME("Not implemented\n");
317 return E_NOTIMPL;
320 static HRESULT WINAPI BITS_IBackgroundCopyJob_TakeOwnership(
321 IBackgroundCopyJob* iface)
323 FIXME("Not implemented\n");
324 return E_NOTIMPL;
328 static const IBackgroundCopyJobVtbl BITS_IBackgroundCopyJob_Vtbl =
330 BITS_IBackgroundCopyJob_QueryInterface,
331 BITS_IBackgroundCopyJob_AddRef,
332 BITS_IBackgroundCopyJob_Release,
333 BITS_IBackgroundCopyJob_AddFileSet,
334 BITS_IBackgroundCopyJob_AddFile,
335 BITS_IBackgroundCopyJob_EnumFiles,
336 BITS_IBackgroundCopyJob_Suspend,
337 BITS_IBackgroundCopyJob_Resume,
338 BITS_IBackgroundCopyJob_Cancel,
339 BITS_IBackgroundCopyJob_Complete,
340 BITS_IBackgroundCopyJob_GetId,
341 BITS_IBackgroundCopyJob_GetType,
342 BITS_IBackgroundCopyJob_GetProgress,
343 BITS_IBackgroundCopyJob_GetTimes,
344 BITS_IBackgroundCopyJob_GetState,
345 BITS_IBackgroundCopyJob_GetError,
346 BITS_IBackgroundCopyJob_GetOwner,
347 BITS_IBackgroundCopyJob_SetDisplayName,
348 BITS_IBackgroundCopyJob_GetDisplayName,
349 BITS_IBackgroundCopyJob_SetDescription,
350 BITS_IBackgroundCopyJob_GetDescription,
351 BITS_IBackgroundCopyJob_SetPriority,
352 BITS_IBackgroundCopyJob_GetPriority,
353 BITS_IBackgroundCopyJob_SetNotifyFlags,
354 BITS_IBackgroundCopyJob_GetNotifyFlags,
355 BITS_IBackgroundCopyJob_SetNotifyInterface,
356 BITS_IBackgroundCopyJob_GetNotifyInterface,
357 BITS_IBackgroundCopyJob_SetMinimumRetryDelay,
358 BITS_IBackgroundCopyJob_GetMinimumRetryDelay,
359 BITS_IBackgroundCopyJob_SetNoProgressTimeout,
360 BITS_IBackgroundCopyJob_GetNoProgressTimeout,
361 BITS_IBackgroundCopyJob_GetErrorCount,
362 BITS_IBackgroundCopyJob_SetProxySettings,
363 BITS_IBackgroundCopyJob_GetProxySettings,
364 BITS_IBackgroundCopyJob_TakeOwnership,
367 HRESULT BackgroundCopyJobConstructor(LPCWSTR displayName, BG_JOB_TYPE type,
368 GUID *pJobId, LPVOID *ppObj)
370 HRESULT hr;
371 BackgroundCopyJobImpl *This;
372 int n;
374 TRACE("(%s,%d,%p)\n", debugstr_w(displayName), type, ppObj);
376 This = HeapAlloc(GetProcessHeap(), 0, sizeof *This);
377 if (!This)
378 return E_OUTOFMEMORY;
380 This->lpVtbl = &BITS_IBackgroundCopyJob_Vtbl;
381 This->ref = 1;
382 This->type = type;
384 n = (lstrlenW(displayName) + 1) * sizeof *displayName;
385 This->displayName = HeapAlloc(GetProcessHeap(), 0, n);
386 if (!This->displayName)
388 HeapFree(GetProcessHeap(), 0, This);
389 return E_OUTOFMEMORY;
391 memcpy(This->displayName, displayName, n);
393 hr = CoCreateGuid(&This->jobId);
394 if (FAILED(hr))
396 HeapFree(GetProcessHeap(), 0, This->displayName);
397 HeapFree(GetProcessHeap(), 0, This);
398 return hr;
400 memcpy(pJobId, &This->jobId, sizeof(GUID));
402 *ppObj = &This->lpVtbl;
403 return S_OK;