Commit 76c3f0cf authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

qmgr: Implement Get/SetNotifyFlags().

parent 5889f822
......@@ -410,8 +410,17 @@ static HRESULT WINAPI BackgroundCopyJob_SetNotifyFlags(
ULONG Val)
{
BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface);
FIXME("(%p)->(%d): stub\n", This, Val);
return E_NOTIMPL;
static const ULONG valid_flags = BG_NOTIFY_JOB_TRANSFERRED |
BG_NOTIFY_JOB_ERROR |
BG_NOTIFY_DISABLE |
BG_NOTIFY_JOB_MODIFICATION |
BG_NOTIFY_FILE_TRANSFERRED;
TRACE("(%p)->(0x%x)\n", This, Val);
if (Val & ~valid_flags) return E_NOTIMPL;
This->notify_flags = Val;
return S_OK;
}
static HRESULT WINAPI BackgroundCopyJob_GetNotifyFlags(
......@@ -419,8 +428,14 @@ static HRESULT WINAPI BackgroundCopyJob_GetNotifyFlags(
ULONG *pVal)
{
BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface);
FIXME("(%p)->(%p): stub\n", This, pVal);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, pVal);
if (!pVal) return E_INVALIDARG;
*pVal = This->notify_flags;
return S_OK;
}
static HRESULT WINAPI BackgroundCopyJob_SetNotifyInterface(
......@@ -689,6 +704,7 @@ HRESULT BackgroundCopyJobConstructor(LPCWSTR displayName, BG_JOB_TYPE type, GUID
This->state = BG_JOB_STATE_SUSPENDED;
This->description = NULL;
This->notify_flags = BG_NOTIFY_JOB_ERROR | BG_NOTIFY_JOB_TRANSFERRED;
*job = This;
......
......@@ -43,6 +43,7 @@ typedef struct
struct list files;
BG_JOB_PROGRESS jobProgress;
BG_JOB_STATE state;
ULONG notify_flags;
/* Protects file list, and progress */
CRITICAL_SECTION cs;
struct list entryFromQmgr;
......
......@@ -414,6 +414,18 @@ static void test_CompleteLocalURL(void)
HeapFree(GetProcessHeap(), 0, urlB);
}
static void test_NotifyFlags(void)
{
ULONG flags;
HRESULT hr;
/* check default flags */
flags = 0;
hr = IBackgroundCopyJob_GetNotifyFlags(test_job, &flags);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(flags == (BG_NOTIFY_JOB_ERROR | BG_NOTIFY_JOB_TRANSFERRED), "flags 0x%08x\n", flags);
}
typedef void (*test_t)(void);
START_TEST(job)
......@@ -425,6 +437,7 @@ START_TEST(job)
test_GetProgress_preTransfer,
test_GetState,
test_ResumeEmpty,
test_NotifyFlags,
0
};
static const test_t tests_bits20[] = {
......
......@@ -29,6 +29,7 @@ cpp_quote("#define BG_NOTIFY_JOB_TRANSFERRED 0x0001")
cpp_quote("#define BG_NOTIFY_JOB_ERROR 0x0002")
cpp_quote("#define BG_NOTIFY_DISABLE 0x0004")
cpp_quote("#define BG_NOTIFY_JOB_MODIFICATION 0x0008")
cpp_quote("#define BG_NOTIFY_FILE_TRANSFERRED 0x0010")
cpp_quote("#ifdef WINE_NO_UNICODE_MACROS")
cpp_quote("#undef EnumJobs")
......
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