https://bugs.winehq.org/show_bug.cgi?id=54634
Bug ID: 54634 Summary: schtasks.exe:schtasks causes taskschd:scheduler to crash on w7u_adm and w8adm Product: Wine Version: unspecified Hardware: x86-64 OS: Windows Status: NEW Severity: normal Priority: P2 Component: taskschd Assignee: wine-bugs@winehq.org Reporter: fgouget@codeweavers.com
schtasks.exe:schtasks causes taskschd:scheduler to crash on w7u_adm and w8adm:
scheduler.c:344: Test failed: expected ERROR_DIR_NOT_EMPTY, got 0x80070005 scheduler.c:351: Test failed: DeleteFolder error 0x80070005 scheduler.c:354: Test failed: expected ERROR_FILE_NOT_FOUND, got 0x80070005 scheduler.c:474: Test failed: expected 2, got 3 scheduler.c:483: Test failed: expected 2, got 3 scheduler.c:515: Test failed: expected \Wine\Folder2, got L"\Wine\test" scheduler.c:523: Test failed: expected Folder2, got L"test" scheduler.c:538: Test failed: expected \Wine\Folder2, got L"\Wine\test" scheduler.c:546: Test failed: expected Folder2, got L"test" scheduler.c:555: Test failed: expected E_INVALIDARG, got 0 scheduler.c:582: Test failed: expected S_FALSE, got 0 scheduler.c:616: Test failed: expected S_FALSE, got 0 scheduler.c:617: Test failed: expected 0, got 1 scheduler.c:630: Test failed: expected S_FALSE, got 0 scheduler.c:631: Test failed: expected 2, got 3 scheduler.c:647: Test failed: expected \Wine\Folder2, got L"\Wine\test" scheduler.c:655: Test failed: expected Folder2, got L"test" scheduler.c:673: Test failed: DeleteFolder error 0x80070005 scheduler.c:776: Test failed: CreateFolder error 0x800700b7 scheduler.c:787: Test failed: expected ERROR_FILE_NOT_FOUND, got 0x80070005 scheduler.c:787: this is the last test seen before the exception 07e4:scheduler: unhandled exception c0000005 at 004017CA
See https://test.winehq.org/data/patterns.html#taskschd:scheduler
taskschd:scheduler does not crash when run on its own: it's schtasks.exe:schtasks that causes it to crash.
The reason is that, at least when run without elevated privileges, schtasks.exe:schtasks leaves behind the "Wine\test" task folders created by the call below in schtasks.c:
register_task("wine\test\winetest");
These folders then interfere with taskschd:scheduler. Not that they are mean to be deleted by the calls below but that fail with E_ACCESSDENIED:
ITaskFolder_DeleteFolder(root, wine_testW, 0); ITaskFolder_DeleteFolder(root, wineW, 0);