qmgr: Update to IBackgroundCopyJob4.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2020-05-08 15:40:21 +03:00 committed by Alexandre Julliard
parent 9bf8124784
commit 60837d12a7
5 changed files with 300 additions and 359 deletions

View File

@ -27,7 +27,7 @@ typedef struct
{ {
IEnumBackgroundCopyJobs IEnumBackgroundCopyJobs_iface; IEnumBackgroundCopyJobs IEnumBackgroundCopyJobs_iface;
LONG ref; LONG ref;
IBackgroundCopyJob3 **jobs; IBackgroundCopyJob4 **jobs;
ULONG numJobs; ULONG numJobs;
ULONG indexJobs; ULONG indexJobs;
} EnumBackgroundCopyJobsImpl; } EnumBackgroundCopyJobsImpl;
@ -75,7 +75,7 @@ static ULONG WINAPI EnumBackgroundCopyJobs_Release(IEnumBackgroundCopyJobs *ifac
if (ref == 0) { if (ref == 0) {
for(i = 0; i < This->numJobs; i++) for(i = 0; i < This->numJobs; i++)
IBackgroundCopyJob3_Release(This->jobs[i]); IBackgroundCopyJob4_Release(This->jobs[i]);
HeapFree(GetProcessHeap(), 0, This->jobs); HeapFree(GetProcessHeap(), 0, This->jobs);
HeapFree(GetProcessHeap(), 0, This); HeapFree(GetProcessHeap(), 0, This);
} }
@ -89,7 +89,6 @@ static HRESULT WINAPI EnumBackgroundCopyJobs_Next(IEnumBackgroundCopyJobs *iface
EnumBackgroundCopyJobsImpl *This = impl_from_IEnumBackgroundCopyJobs(iface); EnumBackgroundCopyJobsImpl *This = impl_from_IEnumBackgroundCopyJobs(iface);
ULONG fetched; ULONG fetched;
ULONG i; ULONG i;
IBackgroundCopyJob3 *job;
TRACE("(%p)->(%d %p %p)\n", This, celt, rgelt, pceltFetched); TRACE("(%p)->(%d %p %p)\n", This, celt, rgelt, pceltFetched);
@ -111,9 +110,8 @@ static HRESULT WINAPI EnumBackgroundCopyJobs_Next(IEnumBackgroundCopyJobs *iface
/* Fill in the array of objects */ /* Fill in the array of objects */
for (i = 0; i < fetched; ++i) for (i = 0; i < fetched; ++i)
{ {
job = This->jobs[This->indexJobs++]; rgelt[i] = (IBackgroundCopyJob *)This->jobs[This->indexJobs++];
IBackgroundCopyJob3_AddRef(job); IBackgroundCopyJob_AddRef(rgelt[i]);
rgelt[i] = (IBackgroundCopyJob *)job;
} }
return fetched == celt ? S_OK : S_FALSE; return fetched == celt ? S_OK : S_FALSE;
@ -213,8 +211,8 @@ HRESULT enum_copy_job_create(BackgroundCopyManagerImpl *qmgr, IEnumBackgroundCop
i = 0; i = 0;
LIST_FOR_EACH_ENTRY(job, &qmgr->jobs, BackgroundCopyJobImpl, entryFromQmgr) LIST_FOR_EACH_ENTRY(job, &qmgr->jobs, BackgroundCopyJobImpl, entryFromQmgr)
{ {
IBackgroundCopyJob3_AddRef(&job->IBackgroundCopyJob3_iface); IBackgroundCopyJob4_AddRef(&job->IBackgroundCopyJob4_iface);
This->jobs[i++] = &job->IBackgroundCopyJob3_iface; This->jobs[i++] = &job->IBackgroundCopyJob4_iface;
} }
LeaveCriticalSection(&qmgr->cs); LeaveCriticalSection(&qmgr->cs);

View File

@ -81,7 +81,7 @@ static ULONG WINAPI BackgroundCopyFile_Release(
if (ref == 0) if (ref == 0)
{ {
IBackgroundCopyJob3_Release(&file->owner->IBackgroundCopyJob3_iface); IBackgroundCopyJob4_Release(&file->owner->IBackgroundCopyJob4_iface);
HeapFree(GetProcessHeap(), 0, file->info.LocalName); HeapFree(GetProcessHeap(), 0, file->info.LocalName);
HeapFree(GetProcessHeap(), 0, file->info.RemoteName); HeapFree(GetProcessHeap(), 0, file->info.RemoteName);
HeapFree(GetProcessHeap(), 0, file); HeapFree(GetProcessHeap(), 0, file);
@ -195,7 +195,7 @@ HRESULT BackgroundCopyFileConstructor(BackgroundCopyJobImpl *owner,
This->owner = owner; This->owner = owner;
This->read_size = 0; This->read_size = 0;
This->tempFileName[0] = 0; This->tempFileName[0] = 0;
IBackgroundCopyJob3_AddRef(&owner->IBackgroundCopyJob3_iface); IBackgroundCopyJob4_AddRef(&owner->IBackgroundCopyJob4_iface);
*file = This; *file = This;
return S_OK; return S_OK;

File diff suppressed because it is too large Load Diff

View File

@ -66,7 +66,7 @@ static HRESULT WINAPI BackgroundCopyManager_CreateJob(IBackgroundCopyManager *if
return hres; return hres;
/* Add a reference to the job to job list */ /* Add a reference to the job to job list */
*ppJob = (IBackgroundCopyJob *)&job->IBackgroundCopyJob3_iface; *ppJob = (IBackgroundCopyJob *)&job->IBackgroundCopyJob4_iface;
IBackgroundCopyJob_AddRef(*ppJob); IBackgroundCopyJob_AddRef(*ppJob);
EnterCriticalSection(&globalMgr.cs); EnterCriticalSection(&globalMgr.cs);
list_add_head(&globalMgr.jobs, &job->entryFromQmgr); list_add_head(&globalMgr.jobs, &job->entryFromQmgr);
@ -93,8 +93,8 @@ static HRESULT WINAPI BackgroundCopyManager_GetJob(IBackgroundCopyManager *iface
{ {
if (IsEqualGUID(&cur->jobId, jobID)) if (IsEqualGUID(&cur->jobId, jobID))
{ {
*job = (IBackgroundCopyJob *)&cur->IBackgroundCopyJob3_iface; *job = (IBackgroundCopyJob *)&cur->IBackgroundCopyJob4_iface;
IBackgroundCopyJob3_AddRef(&cur->IBackgroundCopyJob3_iface); IBackgroundCopyJob_AddRef(*job);
hr = S_OK; hr = S_OK;
break; break;
} }
@ -164,7 +164,7 @@ DWORD WINAPI fileTransfer(void *param)
LIST_FOR_EACH_ENTRY_SAFE(job, jobCur, &qmgr->jobs, BackgroundCopyJobImpl, entryFromQmgr) LIST_FOR_EACH_ENTRY_SAFE(job, jobCur, &qmgr->jobs, BackgroundCopyJobImpl, entryFromQmgr)
{ {
list_remove(&job->entryFromQmgr); list_remove(&job->entryFromQmgr);
IBackgroundCopyJob3_Release(&job->IBackgroundCopyJob3_iface); IBackgroundCopyJob4_Release(&job->IBackgroundCopyJob4_iface);
} }
return 0; return 0;
} }
@ -179,7 +179,7 @@ DWORD WINAPI fileTransfer(void *param)
if (job->state == BG_JOB_STATE_ACKNOWLEDGED || job->state == BG_JOB_STATE_CANCELLED) if (job->state == BG_JOB_STATE_ACKNOWLEDGED || job->state == BG_JOB_STATE_CANCELLED)
{ {
list_remove(&job->entryFromQmgr); list_remove(&job->entryFromQmgr);
IBackgroundCopyJob3_Release(&job->IBackgroundCopyJob3_iface); IBackgroundCopyJob4_Release(&job->IBackgroundCopyJob4_iface);
} }
else if (job->state == BG_JOB_STATE_QUEUED) else if (job->state == BG_JOB_STATE_QUEUED)
{ {

View File

@ -35,7 +35,7 @@
/* Background copy job vtbl and related data */ /* Background copy job vtbl and related data */
typedef struct typedef struct
{ {
IBackgroundCopyJob3 IBackgroundCopyJob3_iface; IBackgroundCopyJob4 IBackgroundCopyJob4_iface;
IBackgroundCopyJobHttpOptions IBackgroundCopyJobHttpOptions_iface; IBackgroundCopyJobHttpOptions IBackgroundCopyJobHttpOptions_iface;
LONG ref; LONG ref;
LPWSTR displayName; LPWSTR displayName;