bits: Implemented BITS_IBackgroundCopyManager_CreateJob (24/26)

Roy Shea roy at cs.hmc.edu
Mon Nov 19 18:23:59 CST 2007


---
 dlls/qmgr/qmgr.c       |   19 +++++++++++++++++--
 dlls/qmgr/tests/qmgr.c |   17 +++++++++++++++++
 2 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/dlls/qmgr/qmgr.c b/dlls/qmgr/qmgr.c
index d0b7de2..75348a9 100644
--- a/dlls/qmgr/qmgr.c
+++ b/dlls/qmgr/qmgr.c
@@ -104,8 +104,23 @@ static HRESULT WINAPI BITS_IBackgroundCopyManager_CreateJob(
         GUID *pJobId,
         IBackgroundCopyJob **ppJob)
 {
-    FIXME("Not implemented\n");
-    return E_NOTIMPL;
+    HRESULT res;
+
+    TRACE("\n");
+
+    if (!pJobId || !ppJob)
+    {
+        return E_POINTER;
+    }
+
+    res = BackgroundCopyJobConstructor(DisplayName, Type, pJobId, (LPVOID*) ppJob);
+    if (res != S_OK)
+    {
+        return res;
+    }
+
+    TRACE("Success\n");
+    return S_OK;
 }
 
 static HRESULT WINAPI BITS_IBackgroundCopyManager_GetJob(
diff --git a/dlls/qmgr/tests/qmgr.c b/dlls/qmgr/tests/qmgr.c
index e60fab9..dec353e 100644
--- a/dlls/qmgr/tests/qmgr.c
+++ b/dlls/qmgr/tests/qmgr.c
@@ -20,6 +20,8 @@
 
 #include <stdio.h>
 
+#define COBJMACROS
+
 #include "wine/test.h"
 #include "bits.h"
 
@@ -28,6 +30,12 @@ static void test_CreateInstance(void)
     HRESULT hres;
     IBackgroundCopyManager* manager = NULL;
 
+    /* Job information */
+    static const WCHAR copyNameW[] = {'T', 'e', 's', 't', 0};
+    IBackgroundCopyJob* job = NULL;
+    GUID tmpId;
+
+    /* Creating BITS instance */
     hres = CoCreateInstance(&CLSID_BackgroundCopyManager, NULL,
             CLSCTX_LOCAL_SERVER, &IID_IBackgroundCopyManager,
             (void **) &manager);
@@ -38,6 +46,15 @@ static void test_CreateInstance(void)
         return;
     }
 
+    /* Creating bits job */
+    hres = IBackgroundCopyManager_CreateJob(manager, copyNameW,
+            BG_JOB_TYPE_DOWNLOAD, &tmpId, &job);
+    ok(hres == S_OK, "CreateJob failed: %08x\n", hres);
+    if(hres != S_OK)
+    {
+        skip("Unable to create bits job.\n");
+        return;
+    }
 }
 
 START_TEST(qmgr)
-- 
1.5.3.1




More information about the wine-patches mailing list