Commit e6cbde10 authored by Roy Shea's avatar Roy Shea Committed by Alexandre Julliard

qmgr: Implement IBackgroundCopyFile_GetProgress.

parent 4866d1bd
...@@ -103,8 +103,13 @@ static HRESULT WINAPI BITS_IBackgroundCopyFile_GetProgress( ...@@ -103,8 +103,13 @@ static HRESULT WINAPI BITS_IBackgroundCopyFile_GetProgress(
IBackgroundCopyFile* iface, IBackgroundCopyFile* iface,
BG_FILE_PROGRESS *pVal) BG_FILE_PROGRESS *pVal)
{ {
FIXME("Not implemented\n"); BackgroundCopyFileImpl *This = (BackgroundCopyFileImpl *) iface;
return E_NOTIMPL;
pVal->BytesTotal = This->fileProgress.BytesTotal;
pVal->BytesTransferred = This->fileProgress.BytesTransferred;
pVal->Completed = This->fileProgress.Completed;
return S_OK;
} }
static const IBackgroundCopyFileVtbl BITS_IBackgroundCopyFile_Vtbl = static const IBackgroundCopyFileVtbl BITS_IBackgroundCopyFile_Vtbl =
...@@ -152,6 +157,10 @@ HRESULT BackgroundCopyFileConstructor(LPCWSTR remoteName, ...@@ -152,6 +157,10 @@ HRESULT BackgroundCopyFileConstructor(LPCWSTR remoteName,
This->lpVtbl = &BITS_IBackgroundCopyFile_Vtbl; This->lpVtbl = &BITS_IBackgroundCopyFile_Vtbl;
This->ref = 1; This->ref = 1;
This->fileProgress.BytesTotal = BG_SIZE_UNKNOWN;
This->fileProgress.BytesTransferred = 0;
This->fileProgress.Completed = FALSE;
*ppObj = &This->lpVtbl; *ppObj = &This->lpVtbl;
return S_OK; return S_OK;
} }
...@@ -65,6 +65,7 @@ typedef struct ...@@ -65,6 +65,7 @@ typedef struct
const IBackgroundCopyFileVtbl *lpVtbl; const IBackgroundCopyFileVtbl *lpVtbl;
LONG ref; LONG ref;
BG_FILE_INFO info; BG_FILE_INFO info;
BG_FILE_PROGRESS fileProgress;
struct list entryFromJob; struct list entryFromJob;
} BackgroundCopyFileImpl; } BackgroundCopyFileImpl;
......
...@@ -145,6 +145,24 @@ static void test_GetLocalName(void) ...@@ -145,6 +145,24 @@ static void test_GetLocalName(void)
CoTaskMemFree(name); CoTaskMemFree(name);
} }
/* Test getting the progress of a file*/
static void test_GetProgress_PreTransfer(void)
{
HRESULT hres;
BG_FILE_PROGRESS progress;
hres = IBackgroundCopyFile_GetProgress(test_file, &progress);
ok(hres == S_OK, "GetProgress failed: %08x\n", hres);
if(hres != S_OK)
{
skip("Unable to get progress of test_file.\n");
return;
}
ok(progress.BytesTotal == BG_SIZE_UNKNOWN, "Got incorrect total size: %llu\n", progress.BytesTotal);
ok(progress.BytesTransferred == 0, "Got incorrect number of transfered bytes: %llu\n", progress.BytesTransferred);
ok(progress.Completed == FALSE, "Got incorret completion status\n");
}
typedef void (*test_t)(void); typedef void (*test_t)(void);
START_TEST(file) START_TEST(file)
...@@ -152,6 +170,7 @@ START_TEST(file) ...@@ -152,6 +170,7 @@ START_TEST(file)
static const test_t tests[] = { static const test_t tests[] = {
test_GetRemoteName, test_GetRemoteName,
test_GetLocalName, test_GetLocalName,
test_GetProgress_PreTransfer,
0 0
}; };
const test_t *test; const test_t *test;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment