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
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)
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;
42 ref = InterlockedIncrement(&This->ref);
46 /* Attempt to provide a new interface to interact with iface */
47 static HRESULT WINAPI BITS_IBackgroundCopyManager_QueryInterface(
48 IBackgroundCopyManager* iface,
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);
68 /* Release an interface to iface */
69 static ULONG WINAPI BITS_IBackgroundCopyManager_Release(
70 IBackgroundCopyManager* iface)
72 BackgroundCopyManagerImpl * This = (BackgroundCopyManagerImpl *)iface;
77 ref = InterlockedDecrement(&This->ref);
80 BackgroundCopyManagerDestructor(This);
85 /*** IBackgroundCopyManager interface methods ***/
87 static HRESULT WINAPI BITS_IBackgroundCopyManager_CreateJob(
88 IBackgroundCopyManager* iface,
92 IBackgroundCopyJob **ppJob)
94 FIXME("Not implemented\n");
98 static HRESULT WINAPI BITS_IBackgroundCopyManager_GetJob(
99 IBackgroundCopyManager* iface,
101 IBackgroundCopyJob **ppJob)
103 FIXME("Not implemented\n");
107 static HRESULT WINAPI BITS_IBackgroundCopyManager_EnumJobs(
108 IBackgroundCopyManager* iface,
110 IEnumBackgroundCopyJobs **ppEnum)
112 FIXME("Not implemented\n");
116 static HRESULT WINAPI BITS_IBackgroundCopyManager_GetErrorDescription(
117 IBackgroundCopyManager* iface,
120 LPWSTR *pErrorDescription)
122 FIXME("Not implemented\n");
127 static const IBackgroundCopyManagerVtbl BITS_IBackgroundCopyManager_Vtbl =
129 BITS_IBackgroundCopyManager_QueryInterface,
130 BITS_IBackgroundCopyManager_AddRef,
131 BITS_IBackgroundCopyManager_Release,
132 BITS_IBackgroundCopyManager_CreateJob,
133 BITS_IBackgroundCopyManager_GetJob,
134 BITS_IBackgroundCopyManager_EnumJobs,
135 BITS_IBackgroundCopyManager_GetErrorDescription
138 /* Constructor for instances of background copy manager */
139 HRESULT BackgroundCopyManagerConstructor(IUnknown *pUnkOuter, LPVOID *ppObj)
141 BackgroundCopyManagerImpl *This;
143 TRACE("(%p,%p)\n", pUnkOuter, ppObj);
145 This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
148 return E_OUTOFMEMORY;
151 This->lpVtbl = &BITS_IBackgroundCopyManager_Vtbl;
154 *ppObj = &This->lpVtbl;