bits: Added stub implementation of the BackgroundCopyJob interfaces (22/27)

Roy Shea roy at cs.hmc.edu
Fri Nov 16 18:20:38 CST 2007


---
 dlls/qmgr/Makefile.in    |    1 +
 dlls/qmgr/job.c          |  396 ++++++++++++++++++++++++++++++++++++++++++++++
 dlls/qmgr/qmgr_private.h |   10 ++
 3 files changed, 407 insertions(+), 0 deletions(-)
 create mode 100644 dlls/qmgr/job.c

diff --git a/dlls/qmgr/Makefile.in b/dlls/qmgr/Makefile.in
index 0eb37d7..ccf85be 100644
--- a/dlls/qmgr/Makefile.in
+++ b/dlls/qmgr/Makefile.in
@@ -7,6 +7,7 @@ IMPORTS   = kernel32 advapi32 ole32 user32
 EXTRALIBS = -luuid
 
 C_SRCS = \
+	job.c \
 	factory.c \
 	qmgr_main.c \
 	qmgr_service.c \
diff --git a/dlls/qmgr/job.c b/dlls/qmgr/job.c
new file mode 100644
index 0000000..94f10a3
--- /dev/null
+++ b/dlls/qmgr/job.c
@@ -0,0 +1,396 @@
+/*
+ * Background Copy Job Interface for BITS
+ *
+ * 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_private.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(qmgr);
+
+/*** IUnknown interface methods ***/
+
+/* Add a reference to the iface pointer */
+static ULONG WINAPI BITS_IBackgroundCopyJob_AddRef(
+        IBackgroundCopyJob* iface)
+{
+    ICOM_THIS_MULTI(BackgroundCopyJobImpl, lpVtbl, iface);
+    ULONG ref;
+
+    TRACE("\n");
+
+    if (This == NULL)
+    {
+        return E_POINTER;
+    }
+
+    ref = InterlockedIncrement(&This->ref);
+    if (ref == 1)
+    {
+        InterlockedIncrement(&dll_ref);
+    }
+    return ref;
+}
+
+/* Attempt to provide a new interface to interact with iface */
+static HRESULT WINAPI BITS_IBackgroundCopyJob_QueryInterface(
+        IBackgroundCopyJob* iface,
+        REFIID riid,
+        LPVOID *ppvObject)
+{
+    ICOM_THIS_MULTI(BackgroundCopyJobImpl, lpVtbl, iface);
+    TRACE("\n\tIID:\t%s\n",debugstr_guid(riid));
+
+    if (This == NULL || ppvObject == NULL)
+    {
+        return E_POINTER;
+    }
+
+    if (IsEqualGUID(riid, &IID_IUnknown) ||
+            IsEqualGUID(riid, &IID_IBackgroundCopyJob))
+    {
+        *ppvObject = &This->lpVtbl;
+        BITS_IBackgroundCopyJob_AddRef(iface);
+        return S_OK;
+    }
+
+    return E_NOINTERFACE;
+}
+
+/* Release an interface to iface */
+static ULONG WINAPI BITS_IBackgroundCopyJob_Release(
+        IBackgroundCopyJob* iface)
+{
+    ICOM_THIS_MULTI(BackgroundCopyJobImpl, lpVtbl, iface);
+    ULONG ref;
+
+    TRACE("\n");
+
+    if (This == NULL)
+    {
+        return E_POINTER;
+    }
+
+    ref = InterlockedDecrement(&This->ref);
+    if (ref == 0)
+    {
+        HeapFree(GetProcessHeap(), 0, This->displayName);
+        HeapFree(GetProcessHeap(), 0, This);
+        InterlockedDecrement(&dll_ref);
+    }
+    return ref;
+}
+
+/*** IBackgroundCopyJob methods ***/
+static HRESULT WINAPI BITS_IBackgroundCopyJob_AddFileSet(
+        IBackgroundCopyJob* iface,
+        ULONG cFileCount,
+        BG_FILE_INFO *pFileSet)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_AddFile(
+        IBackgroundCopyJob* iface,
+        LPCWSTR RemoteUrl,
+        LPCWSTR LocalName)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_EnumFiles(
+        IBackgroundCopyJob* iface,
+        IEnumBackgroundCopyFiles **pEnum)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_Suspend(
+        IBackgroundCopyJob* iface)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_Resume(
+        IBackgroundCopyJob* iface)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_Cancel(
+        IBackgroundCopyJob* iface)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_Complete(
+        IBackgroundCopyJob* iface)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_GetId(
+        IBackgroundCopyJob* iface,
+        GUID *pVal)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_GetType(
+        IBackgroundCopyJob* iface,
+        BG_JOB_TYPE *pVal)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_GetProgress(
+        IBackgroundCopyJob* iface,
+        BG_JOB_PROGRESS *pVal)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_GetTimes(
+        IBackgroundCopyJob* iface,
+        BG_JOB_TIMES *pVal)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_GetState(
+        IBackgroundCopyJob* iface,
+        BG_JOB_STATE *pVal)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_GetError(
+        IBackgroundCopyJob* iface,
+        IBackgroundCopyError **ppError)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_GetOwner(
+        IBackgroundCopyJob* iface,
+        LPWSTR *pVal)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_SetDisplayName(
+        IBackgroundCopyJob* iface,
+        LPCWSTR Val)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_GetDisplayName(
+        IBackgroundCopyJob* iface,
+        LPWSTR *pVal)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_SetDescription(
+        IBackgroundCopyJob* iface,
+        LPCWSTR Val)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_GetDescription(
+        IBackgroundCopyJob* iface,
+        LPWSTR *pVal)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_SetPriority(
+        IBackgroundCopyJob* iface,
+        BG_JOB_PRIORITY Val)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_GetPriority(
+        IBackgroundCopyJob* iface,
+        BG_JOB_PRIORITY *pVal)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_SetNotifyFlags(
+        IBackgroundCopyJob* iface,
+        ULONG Val)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_GetNotifyFlags(
+        IBackgroundCopyJob* iface,
+        ULONG *pVal)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_SetNotifyInterface(
+        IBackgroundCopyJob* iface,
+        IUnknown *Val)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_GetNotifyInterface(
+        IBackgroundCopyJob* iface,
+        IUnknown **pVal)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_SetMinimumRetryDelay(
+        IBackgroundCopyJob* iface,
+        ULONG Seconds)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_GetMinimumRetryDelay(
+        IBackgroundCopyJob* iface,
+        ULONG *Seconds)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_SetNoProgressTimeout(
+        IBackgroundCopyJob* iface,
+        ULONG Seconds)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_GetNoProgressTimeout(
+        IBackgroundCopyJob* iface,
+        ULONG *Seconds)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_GetErrorCount(
+        IBackgroundCopyJob* iface,
+        ULONG *Errors)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_SetProxySettings(
+        IBackgroundCopyJob* iface,
+        BG_JOB_PROXY_USAGE ProxyUsage,
+        const WCHAR *ProxyList,
+        const WCHAR *ProxyBypassList)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_GetProxySettings(
+        IBackgroundCopyJob* iface,
+        BG_JOB_PROXY_USAGE *pProxyUsage,
+        LPWSTR *pProxyList,
+        LPWSTR *pProxyBypassList)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BITS_IBackgroundCopyJob_TakeOwnership(
+        IBackgroundCopyJob* iface)
+{
+    FIXME("Not implemented\n");
+    return E_NOTIMPL;
+}
+
+
+static const IBackgroundCopyJobVtbl BITS_IBackgroundCopyJob_Vtbl =
+{
+    BITS_IBackgroundCopyJob_QueryInterface,
+    BITS_IBackgroundCopyJob_AddRef,
+    BITS_IBackgroundCopyJob_Release,
+    BITS_IBackgroundCopyJob_AddFileSet,
+    BITS_IBackgroundCopyJob_AddFile,
+    BITS_IBackgroundCopyJob_EnumFiles,
+    BITS_IBackgroundCopyJob_Suspend,
+    BITS_IBackgroundCopyJob_Resume,
+    BITS_IBackgroundCopyJob_Cancel,
+    BITS_IBackgroundCopyJob_Complete,
+    BITS_IBackgroundCopyJob_GetId,
+    BITS_IBackgroundCopyJob_GetType,
+    BITS_IBackgroundCopyJob_GetProgress,
+    BITS_IBackgroundCopyJob_GetTimes,
+    BITS_IBackgroundCopyJob_GetState,
+    BITS_IBackgroundCopyJob_GetError,
+    BITS_IBackgroundCopyJob_GetOwner,
+    BITS_IBackgroundCopyJob_SetDisplayName,
+    BITS_IBackgroundCopyJob_GetDisplayName,
+    BITS_IBackgroundCopyJob_SetDescription,
+    BITS_IBackgroundCopyJob_GetDescription,
+    BITS_IBackgroundCopyJob_SetPriority,
+    BITS_IBackgroundCopyJob_GetPriority,
+    BITS_IBackgroundCopyJob_SetNotifyFlags,
+    BITS_IBackgroundCopyJob_GetNotifyFlags,
+    BITS_IBackgroundCopyJob_SetNotifyInterface,
+    BITS_IBackgroundCopyJob_GetNotifyInterface,
+    BITS_IBackgroundCopyJob_SetMinimumRetryDelay,
+    BITS_IBackgroundCopyJob_GetMinimumRetryDelay,
+    BITS_IBackgroundCopyJob_SetNoProgressTimeout,
+    BITS_IBackgroundCopyJob_GetNoProgressTimeout,
+    BITS_IBackgroundCopyJob_GetErrorCount,
+    BITS_IBackgroundCopyJob_SetProxySettings,
+    BITS_IBackgroundCopyJob_GetProxySettings,
+    BITS_IBackgroundCopyJob_TakeOwnership,
+};
+
diff --git a/dlls/qmgr/qmgr_private.h b/dlls/qmgr/qmgr_private.h
index c3b085b..f93ece9 100644
--- a/dlls/qmgr/qmgr_private.h
+++ b/dlls/qmgr/qmgr_private.h
@@ -43,6 +43,16 @@ typedef struct
     LONG ref;
 } ClassFactoryImpl;
 
+/* Background copy job vtbl and related data */
+typedef struct
+{
+    const IBackgroundCopyJobVtbl *lpVtbl;
+    LONG ref;
+    LPWSTR displayName;
+    BG_JOB_TYPE type;
+    GUID jobId;
+} BackgroundCopyJobImpl;
+
 /* Background copy manager vtbl and related data */
 typedef struct
 {
-- 
1.5.3.1




More information about the wine-patches mailing list