Roy Shea : qmgr: Implement the IUnknown interface for IEnumBackgroundCopyJobs.

Alexandre Julliard julliard at winehq.org
Tue Feb 26 05:45:24 CST 2008


Module: wine
Branch: master
Commit: 00a3dceb75ccccc9589af81ac92be25ac21e6bf3
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=00a3dceb75ccccc9589af81ac92be25ac21e6bf3

Author: Roy Shea <roy at cs.hmc.edu>
Date:   Mon Feb 25 17:42:46 2008 -0800

qmgr: Implement the IUnknown interface for IEnumBackgroundCopyJobs.

---

 dlls/qmgr/Makefile.in |    1 +
 dlls/qmgr/enum_jobs.c |  122 +++++++++++++++++++++++++++++++++++++++++++++++++
 dlls/qmgr/qmgr.h      |    9 ++++
 3 files changed, 132 insertions(+), 0 deletions(-)

diff --git a/dlls/qmgr/Makefile.in b/dlls/qmgr/Makefile.in
index 4da1e65..ccd5ef6 100644
--- a/dlls/qmgr/Makefile.in
+++ b/dlls/qmgr/Makefile.in
@@ -7,6 +7,7 @@ IMPORTS   = advpack ole32 advapi32 kernel32
 EXTRALIBS = -luuid
 
 C_SRCS = \
+	enum_jobs.c \
 	factory.c \
 	job.c \
 	qmgr.c \
diff --git a/dlls/qmgr/enum_jobs.c b/dlls/qmgr/enum_jobs.c
new file mode 100644
index 0000000..7aa9346
--- /dev/null
+++ b/dlls/qmgr/enum_jobs.c
@@ -0,0 +1,122 @@
+/*
+ * Queue Manager (BITS) Job Enumerator
+ *
+ * Copyright 2007 Google (Roy Shea)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "qmgr.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(qmgr);
+
+static void EnumBackgroundCopyJobsDestructor(EnumBackgroundCopyJobsImpl *This)
+{
+    HeapFree(GetProcessHeap(), 0, This);
+}
+
+static ULONG WINAPI BITS_IEnumBackgroundCopyJobs_AddRef(
+    IEnumBackgroundCopyJobs* iface)
+{
+    EnumBackgroundCopyJobsImpl *This = (EnumBackgroundCopyJobsImpl *) iface;
+    return InterlockedIncrement(&This->ref);
+}
+
+static HRESULT WINAPI BITS_IEnumBackgroundCopyJobs_QueryInterface(
+    IEnumBackgroundCopyJobs* iface,
+    REFIID riid,
+    void **ppvObject)
+{
+    EnumBackgroundCopyJobsImpl *This = (EnumBackgroundCopyJobsImpl *) iface;
+    TRACE("IID: %s\n", debugstr_guid(riid));
+
+    if (IsEqualGUID(riid, &IID_IUnknown)
+        || IsEqualGUID(riid, &IID_IEnumBackgroundCopyJobs))
+    {
+        *ppvObject = &This->lpVtbl;
+        BITS_IEnumBackgroundCopyJobs_AddRef(iface);
+        return S_OK;
+    }
+
+    *ppvObject = NULL;
+    return E_NOINTERFACE;
+}
+
+static ULONG WINAPI BITS_IEnumBackgroundCopyJobs_Release(
+    IEnumBackgroundCopyJobs* iface)
+{
+    EnumBackgroundCopyJobsImpl *This = (EnumBackgroundCopyJobsImpl *) iface;
+    ULONG ref = InterlockedDecrement(&This->ref);
+
+    if (ref == 0)
+        EnumBackgroundCopyJobsDestructor(This);
+
+    return ref;
+}
+
+/*** IEnumBackgroundCopyJobs methods ***/
+static HRESULT WINAPI BITS_IEnumBackgroundCopyJobs_Next(
+    IEnumBackgroundCopyJobs* iface,
+    ULONG celt,
+    IBackgroundCopyJob **rgelt,
+    ULONG *pceltFetched)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IEnumBackgroundCopyJobs_Skip(
+    IEnumBackgroundCopyJobs* iface,
+    ULONG celt)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IEnumBackgroundCopyJobs_Reset(
+    IEnumBackgroundCopyJobs* iface)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IEnumBackgroundCopyJobs_Clone(
+    IEnumBackgroundCopyJobs* iface,
+    IEnumBackgroundCopyJobs **ppenum)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IEnumBackgroundCopyJobs_GetCount(
+    IEnumBackgroundCopyJobs* iface,
+    ULONG *puCount)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static const IEnumBackgroundCopyJobsVtbl BITS_IEnumBackgroundCopyJobs_Vtbl =
+{
+    BITS_IEnumBackgroundCopyJobs_QueryInterface,
+    BITS_IEnumBackgroundCopyJobs_AddRef,
+    BITS_IEnumBackgroundCopyJobs_Release,
+    BITS_IEnumBackgroundCopyJobs_Next,
+    BITS_IEnumBackgroundCopyJobs_Skip,
+    BITS_IEnumBackgroundCopyJobs_Reset,
+    BITS_IEnumBackgroundCopyJobs_Clone,
+    BITS_IEnumBackgroundCopyJobs_GetCount
+};
diff --git a/dlls/qmgr/qmgr.h b/dlls/qmgr/qmgr.h
index 178fda1..1719492 100644
--- a/dlls/qmgr/qmgr.h
+++ b/dlls/qmgr/qmgr.h
@@ -39,6 +39,13 @@ typedef struct
     GUID jobId;
 } BackgroundCopyJobImpl;
 
+/* Enum background copy jobs vtbl and related data */
+typedef struct
+{
+    const IEnumBackgroundCopyJobsVtbl *lpVtbl;
+    LONG ref;
+} EnumBackgroundCopyJobsImpl;
+
 /* Background copy manager vtbl and related data */
 typedef struct
 {
@@ -56,6 +63,8 @@ extern ClassFactoryImpl BITS_ClassFactory;
 HRESULT BackgroundCopyManagerConstructor(IUnknown *pUnkOuter, LPVOID *ppObj);
 HRESULT BackgroundCopyJobConstructor(LPCWSTR displayName, BG_JOB_TYPE type,
                                      GUID *pJobId, LPVOID *ppObj);
+HRESULT EnumBackgroundCopyJobsConstructor(LPVOID *ppObj,
+                                          IBackgroundCopyManager* copyManager);
 
 /* Little helper functions */
 static inline char *




More information about the wine-cvs mailing list