bits: Implemented BITS_IBackgroundCopyJob_GetId (26/27)

Roy Shea roy at cs.hmc.edu
Fri Nov 16 18:21:26 CST 2007


---
 dlls/qmgr/job.c       |   11 +++++++++--
 dlls/qmgr/tests/job.c |   25 +++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/dlls/qmgr/job.c b/dlls/qmgr/job.c
index 966909d..8a1765f 100644
--- a/dlls/qmgr/job.c
+++ b/dlls/qmgr/job.c
@@ -155,8 +155,15 @@ static HRESULT WINAPI BITS_IBackgroundCopyJob_GetId(
         IBackgroundCopyJob* iface,
         GUID *pVal)
 {
-    FIXME("Not implemented\n");
-    return E_NOTIMPL;
+    ICOM_THIS_MULTI(BackgroundCopyJobImpl, lpVtbl, iface);
+
+    if (!pVal)
+    {
+        return E_POINTER;
+    }
+
+    memcpy(pVal, &This->jobId, sizeof(GUID));
+    return S_OK;
 }
 
 static HRESULT WINAPI BITS_IBackgroundCopyJob_GetType(
diff --git a/dlls/qmgr/tests/job.c b/dlls/qmgr/tests/job.c
index 29f043c..efbb9f6 100644
--- a/dlls/qmgr/tests/job.c
+++ b/dlls/qmgr/tests/job.c
@@ -64,9 +64,34 @@ static void teardown(void)
     IBackgroundCopyManager_Release(test_job);
 }
 
+/* Test that the jobId is properly set */
+static void test_GetId(void)
+{
+    HRESULT hres;
+    GUID tmpId;
+
+    if (!setup())
+    {
+        skip("Unable to setup test\n");
+        return;
+    }
+
+    hres = IBackgroundCopyJob_GetId(test_job, &tmpId);
+    ok(hres == S_OK, "GetId failed: %08x\n", hres);
+    if(hres != S_OK)
+    {
+        skip("Unable to get ID of test_job.\n");
+        teardown();
+        return;
+    }
+    ok(memcmp(&tmpId, &test_jobId, sizeof(GUID)) == 0, "Got incorrect GUID\n");
+    teardown();
+}
+
 START_TEST(job)
 {
     CoInitialize(NULL);
+    test_GetId();
     CoUninitialize();
 }
 
-- 
1.5.3.1




More information about the wine-patches mailing list