-- v4: taskschd: Implement IRepetitionPattern_put_StopAtDurationEnd().
From: Vijay Kiran Kamuju infyquest@gmail.com
--- dlls/taskschd/task.c | 180 +++++++++++++++++++++++++++++++- dlls/taskschd/tests/scheduler.c | 37 +++++++ 2 files changed, 215 insertions(+), 2 deletions(-)
diff --git a/dlls/taskschd/task.c b/dlls/taskschd/task.c index a3378a99117..1e3b992f0e3 100644 --- a/dlls/taskschd/task.c +++ b/dlls/taskschd/task.c @@ -34,9 +34,170 @@
WINE_DEFAULT_DEBUG_CHANNEL(taskschd);
+typedef struct { + IRepetitionPattern IRepetitionPattern_iface; + LONG ref; +} RepetitionPattern; + +static inline RepetitionPattern *impl_from_IRepetitionPattern(IRepetitionPattern *iface) +{ + return CONTAINING_RECORD(iface, RepetitionPattern, IRepetitionPattern_iface); +} + +static HRESULT WINAPI RepetitionPattern_QueryInterface(IRepetitionPattern *iface, REFIID riid, void **ppv) +{ + if (!riid || !ppv) return E_INVALIDARG; + + TRACE("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv); + + if(IsEqualGUID(&IID_IUnknown, riid) || + IsEqualGUID(&IID_IDispatch, riid) || + IsEqualGUID(&IID_IRepetitionPattern, riid)) + { + IRepetitionPattern_AddRef(iface); + *ppv = iface; + return S_OK; + } + + FIXME("unsupported riid %s\n", debugstr_guid(riid)); + *ppv = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI RepetitionPattern_AddRef(IRepetitionPattern *iface) +{ + RepetitionPattern *This = impl_from_IRepetitionPattern(iface); + LONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) ref=%ld\n", This, ref); + + return ref; +} + +static ULONG WINAPI RepetitionPattern_Release(IRepetitionPattern *iface) +{ + RepetitionPattern *This = impl_from_IRepetitionPattern(iface); + LONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) ref=%ld\n", This, ref); + + if(!ref) + { + TRACE("destroying %p\n", iface); + free(This); + } + + return ref; +} + +static HRESULT WINAPI RepetitionPattern_GetTypeInfoCount(IRepetitionPattern *iface, UINT *count) +{ + RepetitionPattern *This = impl_from_IRepetitionPattern(iface); + FIXME("(%p)->(%p)\n", This, count); + return E_NOTIMPL; +} + +static HRESULT WINAPI RepetitionPattern_GetTypeInfo(IRepetitionPattern *iface, UINT index, LCID lcid, ITypeInfo **info) +{ + RepetitionPattern *This = impl_from_IRepetitionPattern(iface); + FIXME("(%p)->(%u %lu %p)\n", This, index, lcid, info); + return E_NOTIMPL; +} + +static HRESULT WINAPI RepetitionPattern_GetIDsOfNames(IRepetitionPattern *iface, REFIID riid, LPOLESTR *names, + UINT count, LCID lcid, DISPID *dispid) +{ + RepetitionPattern *This = impl_from_IRepetitionPattern(iface); + FIXME("(%p)->(%s %p %u %lu %p)\n", This, debugstr_guid(riid), names, count, lcid, dispid); + return E_NOTIMPL; +} + +static HRESULT WINAPI RepetitionPattern_Invoke(IRepetitionPattern *iface, DISPID dispid, REFIID riid, LCID lcid, WORD flags, + DISPPARAMS *params, VARIANT *result, EXCEPINFO *excepinfo, UINT *argerr) +{ + RepetitionPattern *This = impl_from_IRepetitionPattern(iface); + FIXME("(%p)->(%ld %s %lx %x %p %p %p %p)\n", This, dispid, debugstr_guid(riid), lcid, flags, + params, result, excepinfo, argerr); + return E_NOTIMPL; +} + +static HRESULT WINAPI RepetitionPattern_get_Duration(IRepetitionPattern *iface, BSTR *duration) +{ + RepetitionPattern *This = impl_from_IRepetitionPattern(iface); + FIXME("(%p)->(%p)\n", This, duration); + return E_NOTIMPL; +} + +static HRESULT WINAPI RepetitionPattern_put_Duration(IRepetitionPattern *iface, BSTR duration) +{ + RepetitionPattern *This = impl_from_IRepetitionPattern(iface); + FIXME("(%p)->(%s)\n", This, debugstr_w(duration)); + return E_NOTIMPL; +} + +static HRESULT WINAPI RepetitionPattern_get_Interval(IRepetitionPattern *iface, BSTR *interval) +{ + RepetitionPattern *This = impl_from_IRepetitionPattern(iface); + FIXME("(%p)->(%p)\n", This, interval); + return E_NOTIMPL; +} + +static HRESULT WINAPI RepetitionPattern_put_Interval(IRepetitionPattern *iface, BSTR interval) +{ + RepetitionPattern *This = impl_from_IRepetitionPattern(iface); + FIXME("(%p)->(%s)\n", This, debugstr_w(interval)); + return E_NOTIMPL; +} + +static HRESULT WINAPI RepetitionPattern_get_StopAtDurationEnd(IRepetitionPattern *iface, VARIANT_BOOL *stop) +{ + RepetitionPattern *This = impl_from_IRepetitionPattern(iface); + FIXME("(%p)->(%p)\n", This, stop); + return E_NOTIMPL; +} + +static HRESULT WINAPI RepetitionPattern_put_StopAtDurationEnd(IRepetitionPattern *iface, VARIANT_BOOL stop) +{ + RepetitionPattern *This = impl_from_IRepetitionPattern(iface); + FIXME("(%p)->(%x)\n", This, stop); + return E_NOTIMPL; +} + +static const IRepetitionPatternVtbl RepetitionPattern_vtbl = { + RepetitionPattern_QueryInterface, + RepetitionPattern_AddRef, + RepetitionPattern_Release, + RepetitionPattern_GetTypeInfoCount, + RepetitionPattern_GetTypeInfo, + RepetitionPattern_GetIDsOfNames, + RepetitionPattern_Invoke, + RepetitionPattern_get_Duration, + RepetitionPattern_put_Duration, + RepetitionPattern_get_Interval, + RepetitionPattern_put_Interval, + RepetitionPattern_get_StopAtDurationEnd, + RepetitionPattern_put_StopAtDurationEnd +}; + +static HRESULT RepetitionPattern_create(IRepetitionPattern **pattern) +{ + RepetitionPattern *rep_pattern; + + rep_pattern = malloc(sizeof(*rep_pattern)); + if (!rep_pattern) + return E_OUTOFMEMORY; + + rep_pattern->IRepetitionPattern_iface.lpVtbl = &RepetitionPattern_vtbl; + rep_pattern->ref = 1; + + *pattern = &rep_pattern->IRepetitionPattern_iface; + return S_OK; +} + typedef struct { IDailyTrigger IDailyTrigger_iface; LONG ref; + IRepetitionPattern *repeat; short interval; WCHAR *start_boundary; WCHAR *end_boundary; @@ -92,6 +253,8 @@ static ULONG WINAPI DailyTrigger_Release(IDailyTrigger *iface) if(!ref) { TRACE("destroying %p\n", iface); + if (This->repeat) + IRepetitionPattern_Release(This->repeat); free(This->start_boundary); free(This->end_boundary); free(This); @@ -155,8 +318,21 @@ static HRESULT WINAPI DailyTrigger_put_Id(IDailyTrigger *iface, BSTR id) static HRESULT WINAPI DailyTrigger_get_Repetition(IDailyTrigger *iface, IRepetitionPattern **repeat) { DailyTrigger *This = impl_from_IDailyTrigger(iface); - FIXME("(%p)->(%p)\n", This, repeat); - return E_NOTIMPL; + HRESULT hr; + + TRACE("(%p)->(%p)\n", This, repeat); + + if (!repeat) return E_POINTER; + + if (!This->repeat) + { + hr = RepetitionPattern_create(&This->repeat); + if (hr != S_OK) return hr; + } + + IRepetitionPattern_AddRef(This->repeat); + *repeat = This->repeat; + return S_OK; }
static HRESULT WINAPI DailyTrigger_put_Repetition(IDailyTrigger *iface, IRepetitionPattern *repeat) diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c index f9c209f1d84..2b51a20959d 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -1314,6 +1314,37 @@ static void change_settings(ITaskDefinition *taskdef, struct settings *test) ITaskSettings_Release(set); }
+static void test_repetition_pattern(IRepetitionPattern *pattern) +{ + BSTR duration, interval; + VARIANT_BOOL stopatend; + HRESULT hr; + + hr = IRepetitionPattern_get_Duration(pattern, NULL); + todo_wine ok(hr == E_POINTER, "get_Duration failed: %08lx\n", hr); + + hr = IRepetitionPattern_get_Interval(pattern, NULL); + todo_wine ok(hr == E_POINTER, "get_Interval failed: %08lx\n", hr); + + duration = (BSTR)0xdeadbeef; + hr = IRepetitionPattern_get_Duration(pattern, &duration); + todo_wine ok(hr == S_OK, "get_Duration failed: %08lx\n", hr); + todo_wine ok(duration == NULL, "duration not set\n"); + + interval = (BSTR)0xdeadbeef; + hr = IRepetitionPattern_get_Interval(pattern, &interval); + todo_wine ok(hr == S_OK, "get_Interval failed: %08lx\n", hr); + todo_wine ok(interval == NULL, "interval not set\n"); + + hr = IRepetitionPattern_get_StopAtDurationEnd(pattern, NULL); + todo_wine ok(hr == E_POINTER, "get_Enabled failed: %08lx\n", hr); + + stopatend = VARIANT_TRUE; + hr = IRepetitionPattern_get_StopAtDurationEnd(pattern, &stopatend); + todo_wine ok(hr == S_OK, "get_StopAtDurationEnd failed: %08lx\n", hr); + todo_wine ok(stopatend == VARIANT_FALSE, "got %d\n", stopatend); +} + static void test_daily_trigger(ITrigger *trigger) { static const struct @@ -1332,6 +1363,7 @@ static void test_daily_trigger(ITrigger *trigger) {L"invalid", L"invalid", S_OK}, }; IDailyTrigger *daily_trigger; + IRepetitionPattern *rep_pattern = NULL; BSTR start_boundary, end_boundary; VARIANT_BOOL enabled; short interval; @@ -1341,6 +1373,11 @@ static void test_daily_trigger(ITrigger *trigger) hr = ITrigger_QueryInterface(trigger, &IID_IDailyTrigger, (void**)&daily_trigger); ok(hr == S_OK, "Could not get IDailyTrigger iface: %08lx\n", hr);
+ hr = IDailyTrigger_get_Repetition(daily_trigger, &rep_pattern); + ok(hr == S_OK, "get_Repetition failed: %08lx\n", hr); + + if (hr == S_OK) test_repetition_pattern(rep_pattern); + interval = -1; hr = IDailyTrigger_get_DaysInterval(daily_trigger, &interval); ok(hr == S_OK, "get_DaysInterval failed: %08lx\n", hr);
From: Vijay Kiran Kamuju infyquest@gmail.com
--- dlls/taskschd/task.c | 11 +++++++++-- dlls/taskschd/tests/scheduler.c | 6 +++--- 2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/dlls/taskschd/task.c b/dlls/taskschd/task.c index 1e3b992f0e3..fd4877830e6 100644 --- a/dlls/taskschd/task.c +++ b/dlls/taskschd/task.c @@ -37,6 +37,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(taskschd); typedef struct { IRepetitionPattern IRepetitionPattern_iface; LONG ref; + BOOL stop; } RepetitionPattern;
static inline RepetitionPattern *impl_from_IRepetitionPattern(IRepetitionPattern *iface) @@ -152,8 +153,13 @@ static HRESULT WINAPI RepetitionPattern_put_Interval(IRepetitionPattern *iface, static HRESULT WINAPI RepetitionPattern_get_StopAtDurationEnd(IRepetitionPattern *iface, VARIANT_BOOL *stop) { RepetitionPattern *This = impl_from_IRepetitionPattern(iface); - FIXME("(%p)->(%p)\n", This, stop); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, stop); + + if (!stop) return E_POINTER; + + *stop = This->stop ? VARIANT_TRUE : VARIANT_FALSE; + return S_OK; }
static HRESULT WINAPI RepetitionPattern_put_StopAtDurationEnd(IRepetitionPattern *iface, VARIANT_BOOL stop) @@ -189,6 +195,7 @@ static HRESULT RepetitionPattern_create(IRepetitionPattern **pattern)
rep_pattern->IRepetitionPattern_iface.lpVtbl = &RepetitionPattern_vtbl; rep_pattern->ref = 1; + rep_pattern->stop = FALSE;
*pattern = &rep_pattern->IRepetitionPattern_iface; return S_OK; diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c index 2b51a20959d..0d7493df7c9 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -1337,12 +1337,12 @@ static void test_repetition_pattern(IRepetitionPattern *pattern) todo_wine ok(interval == NULL, "interval not set\n");
hr = IRepetitionPattern_get_StopAtDurationEnd(pattern, NULL); - todo_wine ok(hr == E_POINTER, "get_Enabled failed: %08lx\n", hr); + ok(hr == E_POINTER, "get_Enabled failed: %08lx\n", hr);
stopatend = VARIANT_TRUE; hr = IRepetitionPattern_get_StopAtDurationEnd(pattern, &stopatend); - todo_wine ok(hr == S_OK, "get_StopAtDurationEnd failed: %08lx\n", hr); - todo_wine ok(stopatend == VARIANT_FALSE, "got %d\n", stopatend); + ok(hr == S_OK, "get_StopAtDurationEnd failed: %08lx\n", hr); + ok(stopatend == VARIANT_FALSE, "got %d\n", stopatend); }
static void test_daily_trigger(ITrigger *trigger)
From: Vijay Kiran Kamuju infyquest@gmail.com
--- dlls/taskschd/task.c | 14 ++++++++++++-- dlls/taskschd/tests/scheduler.c | 6 +++--- 2 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/dlls/taskschd/task.c b/dlls/taskschd/task.c index fd4877830e6..151e4c9cad8 100644 --- a/dlls/taskschd/task.c +++ b/dlls/taskschd/task.c @@ -37,6 +37,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(taskschd); typedef struct { IRepetitionPattern IRepetitionPattern_iface; LONG ref; + WCHAR *interval; BOOL stop; } RepetitionPattern;
@@ -85,6 +86,7 @@ static ULONG WINAPI RepetitionPattern_Release(IRepetitionPattern *iface) if(!ref) { TRACE("destroying %p\n", iface); + free(This->interval); free(This); }
@@ -139,8 +141,15 @@ static HRESULT WINAPI RepetitionPattern_put_Duration(IRepetitionPattern *iface, static HRESULT WINAPI RepetitionPattern_get_Interval(IRepetitionPattern *iface, BSTR *interval) { RepetitionPattern *This = impl_from_IRepetitionPattern(iface); - FIXME("(%p)->(%p)\n", This, interval); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, interval); + + if (!interval) return E_POINTER; + + if (!This->interval) *interval = NULL; + else if (!(*interval = SysAllocString(This->interval))) return E_OUTOFMEMORY; + + return S_OK; }
static HRESULT WINAPI RepetitionPattern_put_Interval(IRepetitionPattern *iface, BSTR interval) @@ -195,6 +204,7 @@ static HRESULT RepetitionPattern_create(IRepetitionPattern **pattern)
rep_pattern->IRepetitionPattern_iface.lpVtbl = &RepetitionPattern_vtbl; rep_pattern->ref = 1; + rep_pattern->interval = NULL; rep_pattern->stop = FALSE;
*pattern = &rep_pattern->IRepetitionPattern_iface; diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c index 0d7493df7c9..eaa45d6429f 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -1324,7 +1324,7 @@ static void test_repetition_pattern(IRepetitionPattern *pattern) todo_wine ok(hr == E_POINTER, "get_Duration failed: %08lx\n", hr);
hr = IRepetitionPattern_get_Interval(pattern, NULL); - todo_wine ok(hr == E_POINTER, "get_Interval failed: %08lx\n", hr); + ok(hr == E_POINTER, "get_Interval failed: %08lx\n", hr);
duration = (BSTR)0xdeadbeef; hr = IRepetitionPattern_get_Duration(pattern, &duration); @@ -1333,8 +1333,8 @@ static void test_repetition_pattern(IRepetitionPattern *pattern)
interval = (BSTR)0xdeadbeef; hr = IRepetitionPattern_get_Interval(pattern, &interval); - todo_wine ok(hr == S_OK, "get_Interval failed: %08lx\n", hr); - todo_wine ok(interval == NULL, "interval not set\n"); + ok(hr == S_OK, "get_Interval failed: %08lx\n", hr); + ok(interval == NULL, "interval not set\n");
hr = IRepetitionPattern_get_StopAtDurationEnd(pattern, NULL); ok(hr == E_POINTER, "get_Enabled failed: %08lx\n", hr);
From: Vijay Kiran Kamuju infyquest@gmail.com
--- dlls/taskschd/task.c | 14 ++++++++++++-- dlls/taskschd/tests/scheduler.c | 6 +++--- 2 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/dlls/taskschd/task.c b/dlls/taskschd/task.c index 151e4c9cad8..a91c0ec90a9 100644 --- a/dlls/taskschd/task.c +++ b/dlls/taskschd/task.c @@ -37,6 +37,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(taskschd); typedef struct { IRepetitionPattern IRepetitionPattern_iface; LONG ref; + WCHAR *duration; WCHAR *interval; BOOL stop; } RepetitionPattern; @@ -86,6 +87,7 @@ static ULONG WINAPI RepetitionPattern_Release(IRepetitionPattern *iface) if(!ref) { TRACE("destroying %p\n", iface); + free(This->duration); free(This->interval); free(This); } @@ -127,8 +129,15 @@ static HRESULT WINAPI RepetitionPattern_Invoke(IRepetitionPattern *iface, DISPID static HRESULT WINAPI RepetitionPattern_get_Duration(IRepetitionPattern *iface, BSTR *duration) { RepetitionPattern *This = impl_from_IRepetitionPattern(iface); - FIXME("(%p)->(%p)\n", This, duration); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, duration); + + if (!duration) return E_POINTER; + + if (!This->duration) *duration = NULL; + else if (!(*duration = SysAllocString(This->duration))) return E_OUTOFMEMORY; + + return S_OK; }
static HRESULT WINAPI RepetitionPattern_put_Duration(IRepetitionPattern *iface, BSTR duration) @@ -204,6 +213,7 @@ static HRESULT RepetitionPattern_create(IRepetitionPattern **pattern)
rep_pattern->IRepetitionPattern_iface.lpVtbl = &RepetitionPattern_vtbl; rep_pattern->ref = 1; + rep_pattern->duration = NULL; rep_pattern->interval = NULL; rep_pattern->stop = FALSE;
diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c index eaa45d6429f..65c264b2fcf 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -1321,15 +1321,15 @@ static void test_repetition_pattern(IRepetitionPattern *pattern) HRESULT hr;
hr = IRepetitionPattern_get_Duration(pattern, NULL); - todo_wine ok(hr == E_POINTER, "get_Duration failed: %08lx\n", hr); + ok(hr == E_POINTER, "get_Duration failed: %08lx\n", hr);
hr = IRepetitionPattern_get_Interval(pattern, NULL); ok(hr == E_POINTER, "get_Interval failed: %08lx\n", hr);
duration = (BSTR)0xdeadbeef; hr = IRepetitionPattern_get_Duration(pattern, &duration); - todo_wine ok(hr == S_OK, "get_Duration failed: %08lx\n", hr); - todo_wine ok(duration == NULL, "duration not set\n"); + ok(hr == S_OK, "get_Duration failed: %08lx\n", hr); + ok(duration == NULL, "duration not set\n");
interval = (BSTR)0xdeadbeef; hr = IRepetitionPattern_get_Interval(pattern, &interval);
From: Vijay Kiran Kamuju infyquest@gmail.com
--- dlls/taskschd/task.c | 11 +++++++++-- dlls/taskschd/tests/scheduler.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-)
diff --git a/dlls/taskschd/task.c b/dlls/taskschd/task.c index a91c0ec90a9..7ac4a6c3c06 100644 --- a/dlls/taskschd/task.c +++ b/dlls/taskschd/task.c @@ -143,8 +143,15 @@ static HRESULT WINAPI RepetitionPattern_get_Duration(IRepetitionPattern *iface, static HRESULT WINAPI RepetitionPattern_put_Duration(IRepetitionPattern *iface, BSTR duration) { RepetitionPattern *This = impl_from_IRepetitionPattern(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(duration)); - return E_NOTIMPL; + WCHAR *dur = NULL; + + TRACE("(%p)->(%s)\n", This, debugstr_w(duration)); + + if (duration && !(dur = wcsdup(duration))) return E_OUTOFMEMORY; + free(This->duration); + This->duration = dur; + + return S_OK; }
static HRESULT WINAPI RepetitionPattern_get_Interval(IRepetitionPattern *iface, BSTR *interval) diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c index 65c264b2fcf..ddf2143262a 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -1316,9 +1316,20 @@ static void change_settings(ITaskDefinition *taskdef, struct settings *test)
static void test_repetition_pattern(IRepetitionPattern *pattern) { + static const struct + { + const WCHAR *dur; + HRESULT hr; + } + start_test[] = + { + {L"P5D", S_OK}, + {L"invalid", S_OK}, + }; BSTR duration, interval; VARIANT_BOOL stopatend; HRESULT hr; + ULONG i;
hr = IRepetitionPattern_get_Duration(pattern, NULL); ok(hr == E_POINTER, "get_Duration failed: %08lx\n", hr); @@ -1343,6 +1354,28 @@ static void test_repetition_pattern(IRepetitionPattern *pattern) hr = IRepetitionPattern_get_StopAtDurationEnd(pattern, &stopatend); ok(hr == S_OK, "get_StopAtDurationEnd failed: %08lx\n", hr); ok(stopatend == VARIANT_FALSE, "got %d\n", stopatend); + + for (i = 0; i < ARRAY_SIZE(start_test); i++) + { + winetest_push_context("%lu", i); + duration = SysAllocString(start_test[i].dur); + hr = IRepetitionPattern_put_Duration(pattern, duration); + ok(hr == start_test[i].hr, "got %08lx expected %08lx\n", hr, start_test[i].hr); + SysFreeString(duration); + if (hr == S_OK) + { + duration = NULL; + hr = IRepetitionPattern_get_Duration(pattern, &duration); + ok(hr == S_OK, "got %08lx\n", hr); + ok(duration != NULL, "duration not set\n"); + ok(!lstrcmpW(duration, start_test[i].dur), "got %s\n", wine_dbgstr_w(duration)); + SysFreeString(duration); + } + winetest_pop_context(); + } + + hr = IRepetitionPattern_put_Duration(pattern, NULL); + ok(hr == S_OK, "put_Duration failed: %08lx\n", hr); }
static void test_daily_trigger(ITrigger *trigger)
From: Vijay Kiran Kamuju infyquest@gmail.com
--- dlls/taskschd/task.c | 11 +++++++++-- dlls/taskschd/tests/scheduler.c | 22 ++++++++++++++++++++-- 2 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/dlls/taskschd/task.c b/dlls/taskschd/task.c index 7ac4a6c3c06..9884ee9cb43 100644 --- a/dlls/taskschd/task.c +++ b/dlls/taskschd/task.c @@ -171,8 +171,15 @@ static HRESULT WINAPI RepetitionPattern_get_Interval(IRepetitionPattern *iface, static HRESULT WINAPI RepetitionPattern_put_Interval(IRepetitionPattern *iface, BSTR interval) { RepetitionPattern *This = impl_from_IRepetitionPattern(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(interval)); - return E_NOTIMPL; + WCHAR *ivl = NULL; + + TRACE("(%p)->(%s)\n", This, debugstr_w(interval)); + + if (interval && !(ivl = wcsdup(interval))) return E_OUTOFMEMORY; + free(This->interval); + This->interval = ivl; + + return S_OK; }
static HRESULT WINAPI RepetitionPattern_get_StopAtDurationEnd(IRepetitionPattern *iface, VARIANT_BOOL *stop) diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c index ddf2143262a..e2360033513 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -1319,12 +1319,13 @@ static void test_repetition_pattern(IRepetitionPattern *pattern) static const struct { const WCHAR *dur; + const WCHAR *ivl; HRESULT hr; } start_test[] = { - {L"P5D", S_OK}, - {L"invalid", S_OK}, + {L"P5D", L"PT30M", S_OK}, + {L"invalid", L"invalid", S_OK}, }; BSTR duration, interval; VARIANT_BOOL stopatend; @@ -1371,11 +1372,28 @@ static void test_repetition_pattern(IRepetitionPattern *pattern) ok(!lstrcmpW(duration, start_test[i].dur), "got %s\n", wine_dbgstr_w(duration)); SysFreeString(duration); } + + interval = SysAllocString(start_test[i].ivl); + hr = IRepetitionPattern_put_Interval(pattern, interval); + ok(hr == start_test[i].hr, "got %08lx expected %08lx\n", hr, start_test[i].hr); + SysFreeString(interval); + if (hr == S_OK) + { + duration = NULL; + hr = IRepetitionPattern_get_Interval(pattern, &interval); + ok(hr == S_OK, "got %08lx\n", hr); + ok(interval != NULL, "interval not set\n"); + ok(!lstrcmpW(interval, start_test[i].ivl), "got %s\n", wine_dbgstr_w(interval)); + SysFreeString(interval); + } winetest_pop_context(); }
hr = IRepetitionPattern_put_Duration(pattern, NULL); ok(hr == S_OK, "put_Duration failed: %08lx\n", hr); + + hr = IRepetitionPattern_put_Interval(pattern, NULL); + ok(hr == S_OK, "put_Interval failed: %08lx\n", hr); }
static void test_daily_trigger(ITrigger *trigger)
From: Vijay Kiran Kamuju infyquest@gmail.com
--- dlls/taskschd/task.c | 7 +++++-- dlls/taskschd/tests/scheduler.c | 8 ++++++++ 2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/dlls/taskschd/task.c b/dlls/taskschd/task.c index 9884ee9cb43..aac3f620afb 100644 --- a/dlls/taskschd/task.c +++ b/dlls/taskschd/task.c @@ -197,8 +197,11 @@ static HRESULT WINAPI RepetitionPattern_get_StopAtDurationEnd(IRepetitionPattern static HRESULT WINAPI RepetitionPattern_put_StopAtDurationEnd(IRepetitionPattern *iface, VARIANT_BOOL stop) { RepetitionPattern *This = impl_from_IRepetitionPattern(iface); - FIXME("(%p)->(%x)\n", This, stop); - return E_NOTIMPL; + + TRACE("(%p)->(%x)\n", This, stop); + + This->stop = !!stop; + return S_OK; }
static const IRepetitionPatternVtbl RepetitionPattern_vtbl = { diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c index e2360033513..9d6f812f69d 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -1394,6 +1394,14 @@ static void test_repetition_pattern(IRepetitionPattern *pattern)
hr = IRepetitionPattern_put_Interval(pattern, NULL); ok(hr == S_OK, "put_Interval failed: %08lx\n", hr); + + hr = IRepetitionPattern_put_StopAtDurationEnd(pattern, VARIANT_TRUE); + ok(hr == S_OK, "put_StopAtDurationEnd failed: %08lx\n", hr); + + stopatend = VARIANT_FALSE; + hr = IRepetitionPattern_get_StopAtDurationEnd(pattern, &stopatend); + ok(hr == S_OK, "get_StopAtDurationEnd failed: %08lx\n", hr); + ok(stopatend == VARIANT_FALSE, "got %d\n", stopatend); }
static void test_daily_trigger(ITrigger *trigger)
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=149624
Your paranoid android.
=== w7u_2qxl (32 bit report) ===
taskschd: scheduler.c:1404: Test failed: got -1
=== w7u_adm (32 bit report) ===
taskschd: scheduler.c:1404: Test failed: got -1
=== w7u_el (32 bit report) ===
taskschd: scheduler.c:1404: Test failed: got -1
=== w8 (32 bit report) ===
taskschd: scheduler.c:1404: Test failed: got -1
=== w8adm (32 bit report) ===
taskschd: scheduler.c:1404: Test failed: got -1
=== w864 (32 bit report) ===
taskschd: scheduler.c:1404: Test failed: got -1
=== w1064v1507 (32 bit report) ===
taskschd: scheduler.c:1404: Test failed: got -1
=== w1064v1809 (32 bit report) ===
taskschd: scheduler.c:1404: Test failed: got -1
=== w1064_tsign (32 bit report) ===
taskschd: scheduler.c:1404: Test failed: got -1
=== w10pro64 (32 bit report) ===
taskschd: scheduler.c:1404: Test failed: got -1
=== w10pro64_en_AE_u8 (32 bit report) ===
taskschd: scheduler.c:1404: Test failed: got -1
=== w11pro64 (32 bit report) ===
taskschd: scheduler.c:1404: Test failed: got -1
=== w7pro64 (64 bit report) ===
taskschd: scheduler.c:1404: Test failed: got -1
=== w864 (64 bit report) ===
taskschd: scheduler.c:1404: Test failed: got -1
=== w1064v1507 (64 bit report) ===
taskschd: scheduler.c:1404: Test failed: got -1
=== w1064v1809 (64 bit report) ===
taskschd: scheduler.c:1404: Test failed: got -1
=== w1064_2qxl (64 bit report) ===
taskschd: scheduler.c:1404: Test failed: got -1
=== w1064_adm (64 bit report) ===
taskschd: scheduler.c:1404: Test failed: got -1
=== w1064_tsign (64 bit report) ===
taskschd: scheduler.c:1404: Test failed: got -1
=== w10pro64 (64 bit report) ===
taskschd: scheduler.c:1404: Test failed: got -1
=== w10pro64_ar (64 bit report) ===
taskschd: scheduler.c:1404: Test failed: got -1
=== w10pro64_ja (64 bit report) ===
taskschd: scheduler.c:1404: Test failed: got -1
=== w10pro64_zh_CN (64 bit report) ===
taskschd: scheduler.c:1404: Test failed: got -1
=== w11pro64_amd (64 bit report) ===
taskschd: scheduler.c:1404: Test failed: got -1
=== debian11 (32 bit report) ===
taskschd: scheduler.c:1336: Test failed: get_Duration failed: 80004001 scheduler.c:1339: Test failed: get_Interval failed: 80004001 scheduler.c:1343: Test failed: get_Duration failed: 80004001 scheduler.c:1344: Test failed: duration not set scheduler.c:1348: Test failed: get_Interval failed: 80004001 scheduler.c:1349: Test failed: interval not set scheduler.c:1352: Test failed: get_Enabled failed: 80004001 scheduler.c:1356: Test failed: get_StopAtDurationEnd failed: 80004001 scheduler.c:1357: Test failed: got -1 scheduler.c:1364: Test failed: 0: got 80004001 expected 00000000
Report validation errors: taskschd:scheduler crashed (c0000005)
=== debian11 (32 bit ar:MA report) ===
taskschd: scheduler.c:1336: Test failed: get_Duration failed: 80004001 scheduler.c:1339: Test failed: get_Interval failed: 80004001 scheduler.c:1343: Test failed: get_Duration failed: 80004001 scheduler.c:1344: Test failed: duration not set scheduler.c:1348: Test failed: get_Interval failed: 80004001 scheduler.c:1349: Test failed: interval not set scheduler.c:1352: Test failed: get_Enabled failed: 80004001 scheduler.c:1356: Test failed: get_StopAtDurationEnd failed: 80004001 scheduler.c:1357: Test failed: got -1 scheduler.c:1364: Test failed: 0: got 80004001 expected 00000000
Report validation errors: taskschd:scheduler crashed (c0000005)
=== debian11 (32 bit de report) ===
taskschd: scheduler.c:1336: Test failed: get_Duration failed: 80004001 scheduler.c:1339: Test failed: get_Interval failed: 80004001 scheduler.c:1343: Test failed: get_Duration failed: 80004001 scheduler.c:1344: Test failed: duration not set scheduler.c:1348: Test failed: get_Interval failed: 80004001 scheduler.c:1349: Test failed: interval not set scheduler.c:1352: Test failed: get_Enabled failed: 80004001 scheduler.c:1356: Test failed: get_StopAtDurationEnd failed: 80004001 scheduler.c:1357: Test failed: got -1 scheduler.c:1364: Test failed: 0: got 80004001 expected 00000000
Report validation errors: taskschd:scheduler crashed (c0000005)
=== debian11 (32 bit fr report) ===
taskschd: scheduler.c:1336: Test failed: get_Duration failed: 80004001 scheduler.c:1339: Test failed: get_Interval failed: 80004001 scheduler.c:1343: Test failed: get_Duration failed: 80004001 scheduler.c:1344: Test failed: duration not set scheduler.c:1348: Test failed: get_Interval failed: 80004001 scheduler.c:1349: Test failed: interval not set scheduler.c:1352: Test failed: get_Enabled failed: 80004001 scheduler.c:1356: Test failed: get_StopAtDurationEnd failed: 80004001 scheduler.c:1357: Test failed: got -1 scheduler.c:1364: Test failed: 0: got 80004001 expected 00000000
Report validation errors: taskschd:scheduler crashed (c0000005)
=== debian11 (32 bit he:IL report) ===
taskschd: scheduler.c:1336: Test failed: get_Duration failed: 80004001 scheduler.c:1339: Test failed: get_Interval failed: 80004001 scheduler.c:1343: Test failed: get_Duration failed: 80004001 scheduler.c:1344: Test failed: duration not set scheduler.c:1348: Test failed: get_Interval failed: 80004001 scheduler.c:1349: Test failed: interval not set scheduler.c:1352: Test failed: get_Enabled failed: 80004001 scheduler.c:1356: Test failed: get_StopAtDurationEnd failed: 80004001 scheduler.c:1357: Test failed: got -1 scheduler.c:1364: Test failed: 0: got 80004001 expected 00000000
Report validation errors: taskschd:scheduler crashed (c0000005)
=== debian11 (32 bit hi:IN report) ===
taskschd: scheduler.c:1336: Test failed: get_Duration failed: 80004001 scheduler.c:1339: Test failed: get_Interval failed: 80004001 scheduler.c:1343: Test failed: get_Duration failed: 80004001 scheduler.c:1344: Test failed: duration not set scheduler.c:1348: Test failed: get_Interval failed: 80004001 scheduler.c:1349: Test failed: interval not set scheduler.c:1352: Test failed: get_Enabled failed: 80004001 scheduler.c:1356: Test failed: get_StopAtDurationEnd failed: 80004001 scheduler.c:1357: Test failed: got -1 scheduler.c:1364: Test failed: 0: got 80004001 expected 00000000
Report validation errors: taskschd:scheduler crashed (c0000005)
=== debian11 (32 bit ja:JP report) ===
taskschd: scheduler.c:1336: Test failed: get_Duration failed: 80004001 scheduler.c:1339: Test failed: get_Interval failed: 80004001 scheduler.c:1343: Test failed: get_Duration failed: 80004001 scheduler.c:1344: Test failed: duration not set scheduler.c:1348: Test failed: get_Interval failed: 80004001 scheduler.c:1349: Test failed: interval not set scheduler.c:1352: Test failed: get_Enabled failed: 80004001 scheduler.c:1356: Test failed: get_StopAtDurationEnd failed: 80004001 scheduler.c:1357: Test failed: got -1 scheduler.c:1364: Test failed: 0: got 80004001 expected 00000000
Report validation errors: taskschd:scheduler crashed (c0000005)
=== debian11 (32 bit zh:CN report) ===
taskschd: scheduler.c:1336: Test failed: get_Duration failed: 80004001 scheduler.c:1339: Test failed: get_Interval failed: 80004001 scheduler.c:1343: Test failed: get_Duration failed: 80004001 scheduler.c:1344: Test failed: duration not set scheduler.c:1348: Test failed: get_Interval failed: 80004001 scheduler.c:1349: Test failed: interval not set scheduler.c:1352: Test failed: get_Enabled failed: 80004001 scheduler.c:1356: Test failed: get_StopAtDurationEnd failed: 80004001 scheduler.c:1357: Test failed: got -1 scheduler.c:1364: Test failed: 0: got 80004001 expected 00000000
Report validation errors: taskschd:scheduler crashed (c0000005)
=== debian11b (32 bit WoW report) ===
taskschd: scheduler.c:1336: Test failed: get_Duration failed: 80004001 scheduler.c:1339: Test failed: get_Interval failed: 80004001 scheduler.c:1343: Test failed: get_Duration failed: 80004001 scheduler.c:1344: Test failed: duration not set scheduler.c:1348: Test failed: get_Interval failed: 80004001 scheduler.c:1349: Test failed: interval not set scheduler.c:1352: Test failed: get_Enabled failed: 80004001 scheduler.c:1356: Test failed: get_StopAtDurationEnd failed: 80004001 scheduler.c:1357: Test failed: got -1 scheduler.c:1364: Test failed: 0: got 80004001 expected 00000000
Report validation errors: taskschd:scheduler crashed (c0000005)
=== debian11b (64 bit WoW report) ===
taskschd: scheduler.c:1404: Test failed: got -1
user32: input.c:4305: Test succeeded inside todo block: button_down_hwnd_todo 1: got MSG_TEST_WIN hwnd 00000000010200EE, msg WM_LBUTTONDOWN, wparam 0x1, lparam 0x320032