dpnet: Assign to structs instead of using memcpy.
[wine.git] / dlls / qmgr / enum_jobs.c
blob54ecaabf6aa6482ae8502ba2b5fca4c9b6ec78cd
1 /*
2 * Queue Manager (BITS) Job Enumerator
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 EnumBackgroundCopyJobsDestructor(EnumBackgroundCopyJobsImpl *This)
28 HeapFree(GetProcessHeap(), 0, This);
31 static ULONG WINAPI BITS_IEnumBackgroundCopyJobs_AddRef(
32 IEnumBackgroundCopyJobs* iface)
34 EnumBackgroundCopyJobsImpl *This = (EnumBackgroundCopyJobsImpl *) iface;
35 return InterlockedIncrement(&This->ref);
38 static HRESULT WINAPI BITS_IEnumBackgroundCopyJobs_QueryInterface(
39 IEnumBackgroundCopyJobs* iface,
40 REFIID riid,
41 void **ppvObject)
43 EnumBackgroundCopyJobsImpl *This = (EnumBackgroundCopyJobsImpl *) iface;
44 TRACE("IID: %s\n", debugstr_guid(riid));
46 if (IsEqualGUID(riid, &IID_IUnknown)
47 || IsEqualGUID(riid, &IID_IEnumBackgroundCopyJobs))
49 *ppvObject = &This->lpVtbl;
50 BITS_IEnumBackgroundCopyJobs_AddRef(iface);
51 return S_OK;
54 *ppvObject = NULL;
55 return E_NOINTERFACE;
58 static ULONG WINAPI BITS_IEnumBackgroundCopyJobs_Release(
59 IEnumBackgroundCopyJobs* iface)
61 EnumBackgroundCopyJobsImpl *This = (EnumBackgroundCopyJobsImpl *) iface;
62 ULONG ref = InterlockedDecrement(&This->ref);
64 if (ref == 0)
65 EnumBackgroundCopyJobsDestructor(This);
67 return ref;
70 /*** IEnumBackgroundCopyJobs methods ***/
71 static HRESULT WINAPI BITS_IEnumBackgroundCopyJobs_Next(
72 IEnumBackgroundCopyJobs* iface,
73 ULONG celt,
74 IBackgroundCopyJob **rgelt,
75 ULONG *pceltFetched)
77 FIXME("Not implemented\n");
78 return E_NOTIMPL;
81 static HRESULT WINAPI BITS_IEnumBackgroundCopyJobs_Skip(
82 IEnumBackgroundCopyJobs* iface,
83 ULONG celt)
85 FIXME("Not implemented\n");
86 return E_NOTIMPL;
89 static HRESULT WINAPI BITS_IEnumBackgroundCopyJobs_Reset(
90 IEnumBackgroundCopyJobs* iface)
92 FIXME("Not implemented\n");
93 return E_NOTIMPL;
96 static HRESULT WINAPI BITS_IEnumBackgroundCopyJobs_Clone(
97 IEnumBackgroundCopyJobs* iface,
98 IEnumBackgroundCopyJobs **ppenum)
100 FIXME("Not implemented\n");
101 return E_NOTIMPL;
104 static HRESULT WINAPI BITS_IEnumBackgroundCopyJobs_GetCount(
105 IEnumBackgroundCopyJobs* iface,
106 ULONG *puCount)
108 FIXME("Not implemented\n");
109 return E_NOTIMPL;
112 static const IEnumBackgroundCopyJobsVtbl BITS_IEnumBackgroundCopyJobs_Vtbl =
114 BITS_IEnumBackgroundCopyJobs_QueryInterface,
115 BITS_IEnumBackgroundCopyJobs_AddRef,
116 BITS_IEnumBackgroundCopyJobs_Release,
117 BITS_IEnumBackgroundCopyJobs_Next,
118 BITS_IEnumBackgroundCopyJobs_Skip,
119 BITS_IEnumBackgroundCopyJobs_Reset,
120 BITS_IEnumBackgroundCopyJobs_Clone,
121 BITS_IEnumBackgroundCopyJobs_GetCount
124 HRESULT EnumBackgroundCopyJobsConstructor(LPVOID *ppObj,
125 IBackgroundCopyManager* copyManager)
127 EnumBackgroundCopyJobsImpl *This;
129 TRACE("%p, %p)\n", ppObj, copyManager);
131 This = HeapAlloc(GetProcessHeap(), 0, sizeof *This);
132 if (!This)
133 return E_OUTOFMEMORY;
134 This->lpVtbl = &BITS_IEnumBackgroundCopyJobs_Vtbl;
135 This->ref = 1;
137 *ppObj = &This->lpVtbl;
138 return S_OK;