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);