Nikolay Sivov : qmgr: Implement IBackgroundCopyManager::GetJob().

Alexandre Julliard julliard at winehq.org
Fri Jan 10 14:44:57 CST 2014


Module: wine
Branch: stable
Commit: 85d317bf195f6d470076fc7ad9dd7209390a7888
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=85d317bf195f6d470076fc7ad9dd7209390a7888

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Mon Nov 25 10:43:29 2013 +0400

qmgr: Implement IBackgroundCopyManager::GetJob().

(cherry picked from commit 421a26a9a855b36f1f92bd30db892afcffced048)

---

 dlls/qmgr/qmgr.c |   30 +++++++++++++++++++++++++++---
 1 file changed, 27 insertions(+), 3 deletions(-)

diff --git a/dlls/qmgr/qmgr.c b/dlls/qmgr/qmgr.c
index bb66410..adbc94b 100644
--- a/dlls/qmgr/qmgr.c
+++ b/dlls/qmgr/qmgr.c
@@ -74,10 +74,34 @@ static HRESULT WINAPI BITS_IBackgroundCopyManager_CreateJob(IBackgroundCopyManag
 }
 
 static HRESULT WINAPI BITS_IBackgroundCopyManager_GetJob(IBackgroundCopyManager *iface,
-        REFGUID jobID, IBackgroundCopyJob **ppJob)
+        REFGUID jobID, IBackgroundCopyJob **job)
 {
-    FIXME("Not implemented\n");
-    return E_NOTIMPL;
+    BackgroundCopyManagerImpl *qmgr = &globalMgr;
+    HRESULT hr = BG_E_NOT_FOUND;
+    BackgroundCopyJobImpl *cur;
+
+    TRACE("(%s %p)\n", debugstr_guid(jobID), job);
+
+    if (!job || !jobID) return E_INVALIDARG;
+
+    *job = NULL;
+
+    EnterCriticalSection(&qmgr->cs);
+
+    LIST_FOR_EACH_ENTRY(cur, &qmgr->jobs, BackgroundCopyJobImpl, entryFromQmgr)
+    {
+        if (IsEqualGUID(&cur->jobId, jobID))
+        {
+            *job = (IBackgroundCopyJob*)&cur->IBackgroundCopyJob2_iface;
+            IBackgroundCopyJob2_AddRef(&cur->IBackgroundCopyJob2_iface);
+            hr = S_OK;
+            break;
+        }
+    }
+
+    LeaveCriticalSection(&qmgr->cs);
+
+    return hr;
 }
 
 static HRESULT WINAPI BITS_IBackgroundCopyManager_EnumJobs(IBackgroundCopyManager *iface,




More information about the wine-cvs mailing list