mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-19 13:40:26 +00:00
qmgr: Implement AddFile() with AddFileSet().
This commit is contained in:
parent
5092ecf6fe
commit
5cbd28aa51
|
@ -95,18 +95,33 @@ static HRESULT WINAPI BackgroundCopyJob_AddFileSet(
|
||||||
BG_FILE_INFO *pFileSet)
|
BG_FILE_INFO *pFileSet)
|
||||||
{
|
{
|
||||||
BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface);
|
BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface);
|
||||||
|
HRESULT hr = S_OK;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
|
|
||||||
TRACE("(%p)->(%d %p)\n", This, cFileCount, pFileSet);
|
TRACE("(%p)->(%d %p)\n", This, cFileCount, pFileSet);
|
||||||
|
|
||||||
|
EnterCriticalSection(&This->cs);
|
||||||
|
|
||||||
for (i = 0; i < cFileCount; ++i)
|
for (i = 0; i < cFileCount; ++i)
|
||||||
{
|
{
|
||||||
HRESULT hr = IBackgroundCopyJob2_AddFile(iface, pFileSet[i].RemoteName,
|
BackgroundCopyFileImpl *file;
|
||||||
pFileSet[i].LocalName);
|
|
||||||
if (FAILED(hr))
|
/* We should return E_INVALIDARG in these cases. */
|
||||||
return hr;
|
FIXME("Check for valid filenames and supported protocols\n");
|
||||||
|
|
||||||
|
hr = BackgroundCopyFileConstructor(This, pFileSet[i].RemoteName, pFileSet[i].LocalName, &file);
|
||||||
|
if (hr != S_OK) break;
|
||||||
|
|
||||||
|
/* Add a reference to the file to file list */
|
||||||
|
IBackgroundCopyFile_AddRef(&file->IBackgroundCopyFile_iface);
|
||||||
|
list_add_head(&This->files, &file->entryFromJob);
|
||||||
|
This->jobProgress.BytesTotal = BG_SIZE_UNKNOWN;
|
||||||
|
++This->jobProgress.FilesTotal;
|
||||||
}
|
}
|
||||||
return S_OK;
|
|
||||||
|
LeaveCriticalSection(&This->cs);
|
||||||
|
|
||||||
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI BackgroundCopyJob_AddFile(
|
static HRESULT WINAPI BackgroundCopyJob_AddFile(
|
||||||
|
@ -115,26 +130,13 @@ static HRESULT WINAPI BackgroundCopyJob_AddFile(
|
||||||
LPCWSTR LocalName)
|
LPCWSTR LocalName)
|
||||||
{
|
{
|
||||||
BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface);
|
BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface);
|
||||||
BackgroundCopyFileImpl *file;
|
BG_FILE_INFO file;
|
||||||
HRESULT res;
|
|
||||||
|
|
||||||
TRACE("(%p)->(%s %s)\n", This, debugstr_w(RemoteUrl), debugstr_w(LocalName));
|
TRACE("(%p)->(%s %s)\n", This, debugstr_w(RemoteUrl), debugstr_w(LocalName));
|
||||||
/* We should return E_INVALIDARG in these cases. */
|
|
||||||
FIXME("Check for valid filenames and supported protocols\n");
|
|
||||||
|
|
||||||
res = BackgroundCopyFileConstructor(This, RemoteUrl, LocalName, &file);
|
file.RemoteName = (LPWSTR)RemoteUrl;
|
||||||
if (res != S_OK)
|
file.LocalName = (LPWSTR)LocalName;
|
||||||
return res;
|
return IBackgroundCopyJob2_AddFileSet(iface, 1, &file);
|
||||||
|
|
||||||
/* Add a reference to the file to file list */
|
|
||||||
IBackgroundCopyFile_AddRef(&file->IBackgroundCopyFile_iface);
|
|
||||||
EnterCriticalSection(&This->cs);
|
|
||||||
list_add_head(&This->files, &file->entryFromJob);
|
|
||||||
This->jobProgress.BytesTotal = BG_SIZE_UNKNOWN;
|
|
||||||
++This->jobProgress.FilesTotal;
|
|
||||||
LeaveCriticalSection(&This->cs);
|
|
||||||
|
|
||||||
return S_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI BackgroundCopyJob_EnumFiles(
|
static HRESULT WINAPI BackgroundCopyJob_EnumFiles(
|
||||||
|
|
Loading…
Reference in a new issue