From: Vijay Kiran Kamuju infyquest@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47152 --- programs/schtasks/schtasks.c | 27 +++++++++++++++++++++++++-- programs/schtasks/tests/schtasks.c | 17 ++++++++++++++--- 2 files changed, 39 insertions(+), 5 deletions(-)
diff --git a/programs/schtasks/schtasks.c b/programs/schtasks/schtasks.c index bb52e7e7bc0..a5be5ce3ec4 100644 --- a/programs/schtasks/schtasks.c +++ b/programs/schtasks/schtasks.c @@ -244,7 +244,6 @@ static int create_command(int argc, WCHAR *argv[]) return E_FAIL; }
- FIXME("Unsupported /tr option %s\n", debugstr_w(argv[1])); task_run = argv[1]; tr_mode = TRUE; argc -= 2; @@ -260,7 +259,6 @@ static int create_command(int argc, WCHAR *argv[]) return E_FAIL; }
- FIXME("Unsupported /sc option %s\n", debugstr_w(argv[1])); schedule = argv[1]; tr_mode = TRUE; argc -= 2; @@ -340,12 +338,37 @@ static int create_command(int argc, WCHAR *argv[]) return E_FAIL; }
+ FIXME("Unsupported /tr option %s\n", wine_dbgstr_w(task_run)); if (!schedule) { ERR("Missing /sc argument\n"); return E_FAIL; + } else if (!wcsicmp(schedule, L"minute")){ + FIXME("Unsupported /sc minute\n"); + } else if (!wcsicmp(schedule, L"hourly")){ + FIXME("Unsupported /sc hourly\n"); + } else if (!wcsicmp(schedule, L"daily")){ + FIXME("Unsupported /sc daily\n"); + } else if (!wcsicmp(schedule, L"weekly")){ + FIXME("Unsupported /sc weekly\n"); + } else if (!wcsicmp(schedule, L"monthly")){ + FIXME("Unsupported /sc monthly\n"); + } else if (!wcsicmp(schedule, L"once")){ + FIXME("Unsupported /sc once\n"); + } else if (!wcsicmp(schedule, L"onstart")){ + FIXME("Unsupported /sc onstart\n"); + } else if (!wcsicmp(schedule, L"onlogon")){ + FIXME("Unsupported /sc onlogon\n"); + } else if (!wcsicmp(schedule, L"onidle")){ + FIXME("Unsupported /sc onidle\n"); + } else if (!wcsicmp(schedule, L"onevent")){ + FIXME("Unsupported /sc onevent\n"); + } else { + ERR("Invalid schedule type %s\n", debugstr_w(schedule)); + return E_FAIL; } return 0; } + return E_FAIL; }
diff --git a/programs/schtasks/tests/schtasks.c b/programs/schtasks/tests/schtasks.c index ccd8d018d4b..6f7203f21c2 100644 --- a/programs/schtasks/tests/schtasks.c +++ b/programs/schtasks/tests/schtasks.c @@ -238,7 +238,12 @@ START_TEST(schtasks) { "/delete /f /tn /tn wine\test\winetest", 1 }, { "/delete /f /tn wine\test\winetest", 0 }, { "/Change /tn wine\test\winetest /enable", 1 }, - { "/create /xml test.xml /tn wine\winetest", 0 }, + { "/create /xml test.xml", E_FAIL }, + { "/create /xml test.xml /tn", E_FAIL }, + { "/create /xml /tn wine\winetest", E_FAIL }, + { "/create /xml noexist.xml /tn wine\winetest", 1 }, + { "/create /xml empty.xml /tn wine\winetest", 1 }, + { "/create /xml test.xml /tn wine\winetest", 0 }, { "/create /xml test.xml /tn wine\winetest /tn", E_FAIL }, { "/create /xml test.xml /tn wine\winetest /xml", E_FAIL }, { "/create /xml test.xml /tn wine\winetest /tn test", E_FAIL }, @@ -249,10 +254,11 @@ START_TEST(schtasks) { "/create /xml test.xml /tn wine\winetest", 1 }, { "/create /xml test.xml /f /tn wine\winetest /tr c:\windows\hh.exe", E_FAIL }, { "/Delete /f /tn wine\winetest", 0 }, + { "/create /tn", E_FAIL }, { "/create /tn wine\winetest", E_FAIL }, - { "/create /tn wine\winetest /tr c:\windows\hh.exe", E_FAIL, FALSE }, + { "/create /tn wine\winetest /tr c:\windows\hh.exe", E_FAIL }, { "/create /tn wine\winetest /tr c:\windows\hh.exe /sc wine", E_FAIL }, - { "/create /tn wine\winetest /tr c:\windows\hh.exe /sc daily", 0, TRUE }, + { "/create /tn wine\winetest /tr c:\windows\hh.exe /sc daily", 0 }, { "/DELETE /f /tn wine\winetest", 0, TRUE } }; static WCHAR wineW[] = L"\wine"; static WCHAR wine_testW[] = L"\wine\test"; @@ -272,6 +278,8 @@ START_TEST(schtasks)
create_file("test.xml", xml_a);
+ create_file("empty.xml", ""); + run_command_list(querylist, ARRAY_SIZE(querylist));
register_task("winetest"); @@ -286,6 +294,9 @@ START_TEST(schtasks)
run_command_list(creatlist, ARRAY_SIZE(creatlist));
+ r = DeleteFileA("empty.xml"); + ok(r, "DeleteFileA failed: %lu\n", GetLastError()); + r = DeleteFileA("test.xml"); ok(r, "DeleteFileA failed: %lu\n", GetLastError());