Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46773
It is split from !5104
From: Vijay Kiran Kamuju infyquest@gmail.com
--- include/taskschd.idl | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/include/taskschd.idl b/include/taskschd.idl index d5577555e56..6c5e5533934 100644 --- a/include/taskschd.idl +++ b/include/taskschd.idl @@ -407,6 +407,18 @@ interface IDailyTrigger : ITrigger [propput] HRESULT RandomDelay([in] BSTR randomDelay); }
+[ + uuid(4c8fec3a-c218-4e0c-b23d-629024db91a2), + oleautomation, + dual, + nonextensible +] +interface IRegistrationTrigger : ITrigger +{ + [propget] HRESULT Delay([out, retval] BSTR *pDelay); + [propput] HRESULT Delay([in] BSTR delay); +} + [ object, oleautomation,
From: Vijay Kiran Kamuju infyquest@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46773 --- dlls/taskschd/task.c | 237 ++++++++++++++++++++++++++++++++ dlls/taskschd/tests/scheduler.c | 32 +++++ 2 files changed, 269 insertions(+)
diff --git a/dlls/taskschd/task.c b/dlls/taskschd/task.c index d9ddf9d12b8..59c1006042a 100644 --- a/dlls/taskschd/task.c +++ b/dlls/taskschd/task.c @@ -324,6 +324,241 @@ static HRESULT DailyTrigger_create(ITrigger **trigger) return S_OK; }
+typedef struct { + IRegistrationTrigger IRegistrationTrigger_iface; + LONG ref; +} RegistrationTrigger; + +static inline RegistrationTrigger *impl_from_IRegistrationTrigger(IRegistrationTrigger *iface) +{ + return CONTAINING_RECORD(iface, RegistrationTrigger, IRegistrationTrigger_iface); +} + +static HRESULT WINAPI RegistrationTrigger_QueryInterface(IRegistrationTrigger *iface, REFIID riid, void **ppv) +{ + RegistrationTrigger *This = impl_from_IRegistrationTrigger(iface); + + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv); + + if(IsEqualGUID(&IID_IUnknown, riid) || + IsEqualGUID(&IID_IDispatch, riid) || + IsEqualGUID(&IID_ITrigger, riid) || + IsEqualGUID(&IID_IRegistrationTrigger, riid)) + { + *ppv = &This->IRegistrationTrigger_iface; + } + else + { + FIXME("unsupported riid %s\n", debugstr_guid(riid)); + *ppv = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; +} + +static ULONG WINAPI RegistrationTrigger_AddRef(IRegistrationTrigger *iface) +{ + RegistrationTrigger *This = impl_from_IRegistrationTrigger(iface); + LONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) ref=%ld\n", This, ref); + + return ref; +} + +static ULONG WINAPI RegistrationTrigger_Release(IRegistrationTrigger *iface) +{ + RegistrationTrigger *This = impl_from_IRegistrationTrigger(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 RegistrationTrigger_GetTypeInfoCount(IRegistrationTrigger *iface, UINT *count) +{ + RegistrationTrigger *This = impl_from_IRegistrationTrigger(iface); + FIXME("(%p)->(%p)\n", This, count); + return E_NOTIMPL; +} + +static HRESULT WINAPI RegistrationTrigger_GetTypeInfo(IRegistrationTrigger *iface, UINT index, LCID lcid, ITypeInfo **info) +{ + RegistrationTrigger *This = impl_from_IRegistrationTrigger(iface); + FIXME("(%p)->(%u %lu %p)\n", This, index, lcid, info); + return E_NOTIMPL; +} + +static HRESULT WINAPI RegistrationTrigger_GetIDsOfNames(IRegistrationTrigger *iface, REFIID riid, LPOLESTR *names, + UINT count, LCID lcid, DISPID *dispid) +{ + RegistrationTrigger *This = impl_from_IRegistrationTrigger(iface); + FIXME("(%p)->(%s %p %u %lu %p)\n", This, debugstr_guid(riid), names, count, lcid, dispid); + return E_NOTIMPL; +} + +static HRESULT WINAPI RegistrationTrigger_Invoke(IRegistrationTrigger *iface, DISPID dispid, REFIID riid, LCID lcid, WORD flags, + DISPPARAMS *params, VARIANT *result, EXCEPINFO *excepinfo, UINT *argerr) +{ + RegistrationTrigger *This = impl_from_IRegistrationTrigger(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 RegistrationTrigger_get_Type(IRegistrationTrigger *iface, TASK_TRIGGER_TYPE2 *type) +{ + RegistrationTrigger *This = impl_from_IRegistrationTrigger(iface); + FIXME("(%p)->(%p)\n", This, type); + return E_NOTIMPL; +} + +static HRESULT WINAPI RegistrationTrigger_get_Id(IRegistrationTrigger *iface, BSTR *id) +{ + RegistrationTrigger *This = impl_from_IRegistrationTrigger(iface); + FIXME("(%p)->(%p)\n", This, id); + return E_NOTIMPL; +} + +static HRESULT WINAPI RegistrationTrigger_put_Id(IRegistrationTrigger *iface, BSTR id) +{ + RegistrationTrigger *This = impl_from_IRegistrationTrigger(iface); + FIXME("(%p)->(%s)\n", This, debugstr_w(id)); + return E_NOTIMPL; +} + +static HRESULT WINAPI RegistrationTrigger_get_Repetition(IRegistrationTrigger *iface, IRepetitionPattern **repeat) +{ + RegistrationTrigger *This = impl_from_IRegistrationTrigger(iface); + FIXME("(%p)->(%p)\n", This, repeat); + return E_NOTIMPL; +} + +static HRESULT WINAPI RegistrationTrigger_put_Repetition(IRegistrationTrigger *iface, IRepetitionPattern *repeat) +{ + RegistrationTrigger *This = impl_from_IRegistrationTrigger(iface); + FIXME("(%p)->(%p)\n", This, repeat); + return E_NOTIMPL; +} + +static HRESULT WINAPI RegistrationTrigger_get_ExecutionTimeLimit(IRegistrationTrigger *iface, BSTR *limit) +{ + RegistrationTrigger *This = impl_from_IRegistrationTrigger(iface); + FIXME("(%p)->(%p)\n", This, limit); + return E_NOTIMPL; +} + +static HRESULT WINAPI RegistrationTrigger_put_ExecutionTimeLimit(IRegistrationTrigger *iface, BSTR limit) +{ + RegistrationTrigger *This = impl_from_IRegistrationTrigger(iface); + FIXME("(%p)->(%s)\n", This, debugstr_w(limit)); + return E_NOTIMPL; +} + +static HRESULT WINAPI RegistrationTrigger_get_StartBoundary(IRegistrationTrigger *iface, BSTR *start) +{ + FIXME("(%p)->(%p)\n", This, start); + return E_NOTIMPL; +} + +static HRESULT WINAPI RegistrationTrigger_put_StartBoundary(IRegistrationTrigger *iface, BSTR start) +{ + RegistrationTrigger *This = impl_from_IRegistrationTrigger(iface); + FIXME("(%p)->(%s)\n", This, debugstr_w(start)); + return E_NOTIMPL; +} + +static HRESULT WINAPI RegistrationTrigger_get_EndBoundary(IRegistrationTrigger *iface, BSTR *end) +{ + RegistrationTrigger *This = impl_from_IRegistrationTrigger(iface); + FIXME("(%p)->(%p)\n", This, end); + return E_NOTIMPL; +} + +static HRESULT WINAPI RegistrationTrigger_put_EndBoundary(IRegistrationTrigger *iface, BSTR end) +{ + RegistrationTrigger *This = impl_from_IRegistrationTrigger(iface); + FIXME("(%p)->(%s)\n", This, debugstr_w(end)); + return E_NOTIMPL; +} + +static HRESULT WINAPI RegistrationTrigger_get_Enabled(IRegistrationTrigger *iface, VARIANT_BOOL *enabled) +{ + RegistrationTrigger *This = impl_from_IRegistrationTrigger(iface); + FIXME("(%p)->(%p)\n", This, enabled); + return E_NOTIMPL; +} + +static HRESULT WINAPI RegistrationTrigger_put_Enabled(IRegistrationTrigger *iface, VARIANT_BOOL enabled) +{ + RegistrationTrigger *This = impl_from_IRegistrationTrigger(iface); + FIXME("(%p)->(%x)\n", This, enabled); + return E_NOTIMPL; +} + +static HRESULT WINAPI RegistrationTrigger_get_Delay(IRegistrationTrigger *iface, BSTR *pDelay) +{ + RegistrationTrigger *This = impl_from_IRegistrationTrigger(iface); + FIXME("(%p)->(%p)\n", This, pDelay); + return E_NOTIMPL; +} + +static HRESULT WINAPI RegistrationTrigger_put_Delay(IRegistrationTrigger *iface, BSTR delay) +{ + RegistrationTrigger *This = impl_from_IRegistrationTrigger(iface); + FIXME("(%p)->(%s)\n", This, debugstr_w(delay)); + return E_NOTIMPL; +} + +static const IRegistrationTriggerVtbl RegistrationTrigger_vtbl = { + RegistrationTrigger_QueryInterface, + RegistrationTrigger_AddRef, + RegistrationTrigger_Release, + RegistrationTrigger_GetTypeInfoCount, + RegistrationTrigger_GetTypeInfo, + RegistrationTrigger_GetIDsOfNames, + RegistrationTrigger_Invoke, + RegistrationTrigger_get_Type, + RegistrationTrigger_get_Id, + RegistrationTrigger_put_Id, + RegistrationTrigger_get_Repetition, + RegistrationTrigger_put_Repetition, + RegistrationTrigger_get_ExecutionTimeLimit, + RegistrationTrigger_put_ExecutionTimeLimit, + RegistrationTrigger_get_StartBoundary, + RegistrationTrigger_put_StartBoundary, + RegistrationTrigger_get_EndBoundary, + RegistrationTrigger_put_EndBoundary, + RegistrationTrigger_get_Enabled, + RegistrationTrigger_put_Enabled, + RegistrationTrigger_get_Delay, + RegistrationTrigger_put_Delay +}; + +static HRESULT RegistrationTrigger_create(ITrigger **trigger) +{ + RegistrationTrigger *registration_trigger; + + registration_trigger = malloc(sizeof(*registration_trigger)); + if (!registration_trigger) + return E_OUTOFMEMORY; + + registration_trigger->IRegistrationTrigger_iface.lpVtbl = &RegistrationTrigger_vtbl; + registration_trigger->ref = 1; + + *trigger = (ITrigger*)®istration_trigger->IRegistrationTrigger_iface; + return S_OK; +} + typedef struct { ITriggerCollection ITriggerCollection_iface; @@ -439,6 +674,8 @@ static HRESULT WINAPI TriggerCollection_Create(ITriggerCollection *iface, TASK_T switch(type) { case TASK_TRIGGER_DAILY: return DailyTrigger_create(trigger); + case TASK_TRIGGER_REGISTRATION: + return RegistrationTrigger_create(trigger); default: FIXME("Unimplemented type %d\n", type); return E_NOTIMPL; diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c index bf6e13be98b..2697c33fc3d 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -1376,6 +1376,31 @@ static void test_daily_trigger(ITrigger *trigger) IDailyTrigger_Release(daily_trigger); }
+static void test_registration_trigger(ITrigger *trigger) +{ + IRegistrationTrigger *reg_trigger; + VARIANT_BOOL enabled; + HRESULT hr; + + hr = ITrigger_QueryInterface(trigger, &IID_IRegistrationTrigger, (void**)®_trigger); + ok(hr == S_OK, "Could not get IDailyTrigger iface: %08lx\n", hr); + + enabled = VARIANT_FALSE; + hr = IRegistrationTrigger_get_Enabled(reg_trigger, &enabled); + todo_wine ok(hr == S_OK, "get_Enabled failed: %08lx\n", hr); + todo_wine ok(enabled == VARIANT_TRUE, "got %d\n", enabled); + + hr = IRegistrationTrigger_put_Enabled(reg_trigger, VARIANT_FALSE); + todo_wine ok(hr == S_OK, "put_Enabled failed: %08lx\n", hr); + + enabled = VARIANT_TRUE; + hr = IRegistrationTrigger_get_Enabled(reg_trigger, &enabled); + todo_wine ok(hr == S_OK, "get_Enabled failed: %08lx\n", hr); + todo_wine ok(enabled == VARIANT_FALSE, "got %d\n", enabled); + + IRegistrationTrigger_Release(reg_trigger); +} + static void create_action(ITaskDefinition *taskdef) { static WCHAR task1_exe[] = L"task1.exe"; @@ -1776,6 +1801,13 @@ static void test_TaskDefinition(void) ITrigger_Release(trigger); ITriggerCollection_Release(trigger_col);
+ hr = ITriggerCollection_Create(trigger_col, TASK_TRIGGER_REGISTRATION, &trigger); + ok(hr == S_OK, "Create failed: %08lx\n", hr); + ok(trigger != NULL, "trigger = NULL\n"); + test_registration_trigger(trigger); + ITrigger_Release(trigger); + ITriggerCollection_Release(trigger_col); + hr = ITaskDefinition_get_Triggers(taskdef, &trigger_col2); ok(hr == S_OK, "get_Triggers failed: %08lx\n", hr); ok(trigger_col == trigger_col2, "Mismatched triggers\n");
From: Vijay Kiran Kamuju infyquest@gmail.com
--- dlls/taskschd/task.c | 9 +++++++-- dlls/taskschd/tests/scheduler.c | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/dlls/taskschd/task.c b/dlls/taskschd/task.c index 59c1006042a..f764f2d5a92 100644 --- a/dlls/taskschd/task.c +++ b/dlls/taskschd/task.c @@ -326,6 +326,7 @@ static HRESULT DailyTrigger_create(ITrigger **trigger)
typedef struct { IRegistrationTrigger IRegistrationTrigger_iface; + BOOL enabled; LONG ref; } RegistrationTrigger;
@@ -501,8 +502,11 @@ static HRESULT WINAPI RegistrationTrigger_get_Enabled(IRegistrationTrigger *ifac static HRESULT WINAPI RegistrationTrigger_put_Enabled(IRegistrationTrigger *iface, VARIANT_BOOL enabled) { RegistrationTrigger *This = impl_from_IRegistrationTrigger(iface); - FIXME("(%p)->(%x)\n", This, enabled); - return E_NOTIMPL; + + TRACE("(%p)->(%x)\n", This, enabled); + + This->enabled = !!enabled; + return S_OK; }
static HRESULT WINAPI RegistrationTrigger_get_Delay(IRegistrationTrigger *iface, BSTR *pDelay) @@ -554,6 +558,7 @@ static HRESULT RegistrationTrigger_create(ITrigger **trigger)
registration_trigger->IRegistrationTrigger_iface.lpVtbl = &RegistrationTrigger_vtbl; registration_trigger->ref = 1; + registration_trigger->enabled = FALSE;
*trigger = (ITrigger*)®istration_trigger->IRegistrationTrigger_iface; return S_OK; diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c index 2697c33fc3d..e1fc27e2a7a 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -1391,7 +1391,7 @@ static void test_registration_trigger(ITrigger *trigger) todo_wine ok(enabled == VARIANT_TRUE, "got %d\n", enabled);
hr = IRegistrationTrigger_put_Enabled(reg_trigger, VARIANT_FALSE); - todo_wine ok(hr == S_OK, "put_Enabled failed: %08lx\n", hr); + ok(hr == S_OK, "put_Enabled failed: %08lx\n", hr);
enabled = VARIANT_TRUE; hr = IRegistrationTrigger_get_Enabled(reg_trigger, &enabled);
From: Vijay Kiran Kamuju infyquest@gmail.com
--- dlls/taskschd/task.c | 11 ++++++++--- dlls/taskschd/tests/scheduler.c | 8 ++++---- 2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/dlls/taskschd/task.c b/dlls/taskschd/task.c index f764f2d5a92..fa4ad8f9bd8 100644 --- a/dlls/taskschd/task.c +++ b/dlls/taskschd/task.c @@ -495,8 +495,13 @@ static HRESULT WINAPI RegistrationTrigger_put_EndBoundary(IRegistrationTrigger * static HRESULT WINAPI RegistrationTrigger_get_Enabled(IRegistrationTrigger *iface, VARIANT_BOOL *enabled) { RegistrationTrigger *This = impl_from_IRegistrationTrigger(iface); - FIXME("(%p)->(%p)\n", This, enabled); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, enabled); + + if (!enabled) return E_POINTER; + + *enabled = This->enabled ? VARIANT_TRUE : VARIANT_FALSE; + return S_OK; }
static HRESULT WINAPI RegistrationTrigger_put_Enabled(IRegistrationTrigger *iface, VARIANT_BOOL enabled) @@ -558,7 +563,7 @@ static HRESULT RegistrationTrigger_create(ITrigger **trigger)
registration_trigger->IRegistrationTrigger_iface.lpVtbl = &RegistrationTrigger_vtbl; registration_trigger->ref = 1; - registration_trigger->enabled = FALSE; + registration_trigger->enabled = TRUE;
*trigger = (ITrigger*)®istration_trigger->IRegistrationTrigger_iface; return S_OK; diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c index e1fc27e2a7a..0146cee0954 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -1387,16 +1387,16 @@ static void test_registration_trigger(ITrigger *trigger)
enabled = VARIANT_FALSE; hr = IRegistrationTrigger_get_Enabled(reg_trigger, &enabled); - todo_wine ok(hr == S_OK, "get_Enabled failed: %08lx\n", hr); - todo_wine ok(enabled == VARIANT_TRUE, "got %d\n", enabled); + ok(hr == S_OK, "get_Enabled failed: %08lx\n", hr); + ok(enabled == VARIANT_TRUE, "got %d\n", enabled);
hr = IRegistrationTrigger_put_Enabled(reg_trigger, VARIANT_FALSE); ok(hr == S_OK, "put_Enabled failed: %08lx\n", hr);
enabled = VARIANT_TRUE; hr = IRegistrationTrigger_get_Enabled(reg_trigger, &enabled); - todo_wine ok(hr == S_OK, "get_Enabled failed: %08lx\n", hr); - todo_wine ok(enabled == VARIANT_FALSE, "got %d\n", enabled); + ok(hr == S_OK, "get_Enabled failed: %08lx\n", hr); + ok(enabled == VARIANT_FALSE, "got %d\n", enabled);
IRegistrationTrigger_Release(reg_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=143352
Your paranoid android.
=== w7u_2qxl (32 bit report) ===
taskschd: 06a4:scheduler: unhandled exception c0000005 at 000D8F30
=== w7u_el (32 bit report) ===
taskschd: 0db8:scheduler: unhandled exception c0000005 at 005C8F30
=== w8 (32 bit report) ===
taskschd: 0c34:scheduler: unhandled exception c0000002 at 754C1A3A
=== w8adm (32 bit report) ===
taskschd: 0a48:scheduler: unhandled exception c0000002 at 75461A3A
=== w864 (32 bit report) ===
taskschd: 0210:scheduler: unhandled exception c0000002 at 75454128
=== w1064v1507 (32 bit report) ===
taskschd: 0894:scheduler: unhandled exception c0000005 at 00C76F98
=== w1064v1809 (32 bit report) ===
taskschd: 1de0:scheduler: unhandled exception c0000005 at 010A3EF8
=== w1064_tsign (32 bit report) ===
taskschd: 05c0:scheduler: unhandled exception c0000005 at 009D5530
=== w10pro64 (32 bit report) ===
taskschd: 145c:scheduler: unhandled exception c0000005 at 016127A0
=== w10pro64_en_AE_u8 (32 bit report) ===
taskschd: 1580:scheduler: unhandled exception c0000005 at 010C27A0
=== w11pro64 (32 bit report) ===
taskschd: 1b7c:scheduler: unhandled exception c0000002 at 769207B2
=== w7pro64 (64 bit report) ===
taskschd: 079c:scheduler: unhandled exception c0000005 at 000000000055AD40
=== w864 (64 bit report) ===
taskschd: 0b34:scheduler: unhandled exception c0000005 at 00000000013AB220
=== w1064v1507 (64 bit report) ===
taskschd: 0aa8:scheduler: unhandled exception c0000002 at 00007FFADB3AA1C8
=== w1064v1809 (64 bit report) ===
taskschd: 1de4:scheduler: unhandled exception c0000005 at 0000000000E7AA60
=== w1064_2qxl (64 bit report) ===
taskschd: 08f8:scheduler: unhandled exception c0000002 at 00007FFFFB10CD29
=== w1064_adm (64 bit report) ===
taskschd: 1c24:scheduler: unhandled exception c0000002 at 00007FFA545FCD29
=== w1064_tsign (64 bit report) ===
taskschd: 1f9c:scheduler: unhandled exception c0000002 at 00007FFF10BFCD29
=== w10pro64 (64 bit report) ===
taskschd: 1e48:scheduler: unhandled exception c0000002 at 00007FFF2C874F69
=== w10pro64_ar (64 bit report) ===
taskschd: 0de4:scheduler: unhandled exception c0000002 at 00007FFA072F4F69
=== w10pro64_ja (64 bit report) ===
taskschd: 0ab0:scheduler: unhandled exception c0000002 at 00007FF96EAF4F69
=== w10pro64_zh_CN (64 bit report) ===
taskschd: 11d0:scheduler: unhandled exception c0000002 at 00007FF8B5764F69
=== w11pro64_amd (64 bit report) ===
taskschd: 1e04:scheduler: unhandled exception c0000002 at 00007FFBB8DD428C
=== debian11 (build log) ===
../wine/dlls/taskschd/task.c:470:27: error: ���This��� undeclared (first use in this function) Task: The win32 Wine build failed
=== debian11b (build log) ===
../wine/dlls/taskschd/task.c:470:27: error: ���This��� undeclared (first use in this function) Task: The wow64 Wine build failed
I had to create this merge request with a split from !5104 as now-a-days the generic unrelated header additions i.e., when not referenced bug or no affected application, is being regarded as a maintenance overhead.