msi: Read the disk prompt source list property from the user-unmanaged context.
[wine.git] / dlls / qmgr / qmgr.c
blobe2741590d96e778c8c279cf746e1358ab031f648
1 /*
2 * Queue Manager (BITS) core functions
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 /* Destructor for instances of background copy manager */
27 static void BackgroundCopyManagerDestructor(BackgroundCopyManagerImpl *This)
29 TRACE("%p\n", This);
30 HeapFree(GetProcessHeap(), 0, This);
33 /* Add a reference to the iface pointer */
34 static ULONG WINAPI BITS_IBackgroundCopyManager_AddRef(
35 IBackgroundCopyManager* iface)
37 BackgroundCopyManagerImpl * This = (BackgroundCopyManagerImpl *)iface;
38 ULONG ref;
40 TRACE("\n");
42 ref = InterlockedIncrement(&This->ref);
43 return ref;
46 /* Attempt to provide a new interface to interact with iface */
47 static HRESULT WINAPI BITS_IBackgroundCopyManager_QueryInterface(
48 IBackgroundCopyManager* iface,
49 REFIID riid,
50 LPVOID *ppvObject)
52 BackgroundCopyManagerImpl * This = (BackgroundCopyManagerImpl *)iface;
54 TRACE("IID: %s\n", debugstr_guid(riid));
56 if (IsEqualGUID(riid, &IID_IUnknown) ||
57 IsEqualGUID(riid, &IID_IBackgroundCopyManager))
59 *ppvObject = &This->lpVtbl;
60 BITS_IBackgroundCopyManager_AddRef(iface);
61 return S_OK;
64 *ppvObject = NULL;
65 return E_NOINTERFACE;
68 /* Release an interface to iface */
69 static ULONG WINAPI BITS_IBackgroundCopyManager_Release(
70 IBackgroundCopyManager* iface)
72 BackgroundCopyManagerImpl * This = (BackgroundCopyManagerImpl *)iface;
73 ULONG ref;
75 TRACE("\n");
77 ref = InterlockedDecrement(&This->ref);
78 if (ref == 0)
80 BackgroundCopyManagerDestructor(This);
82 return ref;
85 /*** IBackgroundCopyManager interface methods ***/
87 static HRESULT WINAPI BITS_IBackgroundCopyManager_CreateJob(
88 IBackgroundCopyManager* iface,
89 LPCWSTR DisplayName,
90 BG_JOB_TYPE Type,
91 GUID *pJobId,
92 IBackgroundCopyJob **ppJob)
94 TRACE("\n");
95 return BackgroundCopyJobConstructor(DisplayName, Type, pJobId,
96 (LPVOID *) ppJob);
99 static HRESULT WINAPI BITS_IBackgroundCopyManager_GetJob(
100 IBackgroundCopyManager* iface,
101 REFGUID jobID,
102 IBackgroundCopyJob **ppJob)
104 FIXME("Not implemented\n");
105 return E_NOTIMPL;
108 static HRESULT WINAPI BITS_IBackgroundCopyManager_EnumJobs(
109 IBackgroundCopyManager* iface,
110 DWORD dwFlags,
111 IEnumBackgroundCopyJobs **ppEnum)
113 FIXME("Not implemented\n");
114 return E_NOTIMPL;
117 static HRESULT WINAPI BITS_IBackgroundCopyManager_GetErrorDescription(
118 IBackgroundCopyManager* iface,
119 HRESULT hResult,
120 DWORD LanguageId,
121 LPWSTR *pErrorDescription)
123 FIXME("Not implemented\n");
124 return E_NOTIMPL;
128 static const IBackgroundCopyManagerVtbl BITS_IBackgroundCopyManager_Vtbl =
130 BITS_IBackgroundCopyManager_QueryInterface,
131 BITS_IBackgroundCopyManager_AddRef,
132 BITS_IBackgroundCopyManager_Release,
133 BITS_IBackgroundCopyManager_CreateJob,
134 BITS_IBackgroundCopyManager_GetJob,
135 BITS_IBackgroundCopyManager_EnumJobs,
136 BITS_IBackgroundCopyManager_GetErrorDescription
139 /* Constructor for instances of background copy manager */
140 HRESULT BackgroundCopyManagerConstructor(IUnknown *pUnkOuter, LPVOID *ppObj)
142 BackgroundCopyManagerImpl *This;
144 TRACE("(%p,%p)\n", pUnkOuter, ppObj);
146 This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
147 if (!This)
149 return E_OUTOFMEMORY;
152 This->lpVtbl = &BITS_IBackgroundCopyManager_Vtbl;
153 This->ref = 1;
155 *ppObj = &This->lpVtbl;
156 return S_OK;