34 const WCHAR task_name[] = {
'T',
'e',
's',
't',
'i',
'n',
'g', 0};
78 const WCHAR non_application_name[] = {
'N',
'o',
'S',
'u',
'c',
'h',
79 'A',
'p',
'p',
'l',
'i',
'c',
'a',
't',
'i',
'o',
'n', 0};
80 const WCHAR notepad_exe[] = {
81 'n',
'o',
't',
'e',
'p',
'a',
'd',
'.',
'e',
'x',
'e', 0};
82 const WCHAR notepad[] = {
'n',
'o',
't',
'e',
'p',
'a',
'd', 0};
85 ok(
setup,
"Failed to setup test_task\n");
88 skip(
"Failed to create task. Skipping tests.\n");
98 "Got %s, expected empty string\n",
wine_dbgstr_w(stored_name));
104 hres = ITask_SetApplicationName(
test_task, non_application_name);
105 ok(
hres ==
S_OK,
"Failed setting name %s: %08x\n",
112 ok(!
lstrcmpiW(stored_name, full_name),
"Got %s, expected %s\n",
120 ok(
hres ==
S_OK,
"Failed setting name %s: %08x\n",
127 ok(!
lstrcmpiW(stored_name, full_name),
"Got %s, expected %s\n",
141 if (
lstrcmpiW(stored_name, full_name) != 0)
144 ok(!
lstrcmpiW(stored_name, full_name),
"Got %s, expected %s\n",
153 hres = ITask_SetApplicationName(
test_task, non_application_name);
154 ok(
hres ==
S_OK,
"Failed setting name %s: %08x\n",
161 ok(!
lstrcmpiW(stored_name, full_name),
"Got %s, expected %s\n",
174 "Got %s, expected empty string\n",
wine_dbgstr_w(stored_name));
190 ok(
setup,
"Failed to setup test_task\n");
193 skip(
"Failed to create task. Skipping tests.\n");
215 const WCHAR parameters_a[] = {
'f',
'o',
'o',
'.',
't',
'x',
't', 0};
216 const WCHAR parameters_b[] = {
'f',
'o',
'o',
'.',
't',
'x',
't',
' ',
217 'b',
'a',
'r',
'.',
't',
'x',
't', 0};
220 ok(
setup,
"Failed to setup test_task\n");
223 skip(
"Failed to create task. Skipping tests.\n");
233 "Got %s, expected empty string\n",
wine_dbgstr_w(parameters));
239 ok(
hres ==
S_OK,
"Failed setting parameters %s: %08x\n",
245 ok(!
lstrcmpW(parameters, parameters_a),
"Got %s, expected %s\n",
252 ok(
hres ==
S_OK,
"Failed setting parameters %s: %08x\n",
258 ok(!
lstrcmpW(parameters, parameters_b),
"Got %s, expected %s\n",
265 ok(
hres ==
S_OK,
"Failed setting parameters %s: %08x\n",
272 "Got %s, expected empty string\n",
wine_dbgstr_w(parameters));
285 const WCHAR comment_a[] = {
'C',
'o',
'm',
'm',
'e',
'n',
't',
'.', 0};
286 const WCHAR comment_b[] = {
'L',
'o',
'n',
'g',
'e',
'r',
' ',
287 'c',
'o',
'm',
'm',
'e',
'n',
't',
'.', 0};
290 ok(
setup,
"Failed to setup test_task\n");
293 skip(
"Failed to create task. Skipping tests.\n");
309 ok(
hres ==
S_OK,
"Failed setting comment %s: %08x\n",
322 ok(
hres ==
S_OK,
"Failed setting comment %s: %08x\n",
335 ok(
hres ==
S_OK,
"Failed setting comment %s: %08x\n",
357 ok(
setup,
"Failed to setup test_task\n");
360 skip(
"Failed to create task. Skipping tests.\n");
369 ok(max_run_time == 259200000,
"Expected 259200000: %d\n", max_run_time);
377 ok(max_run_time == 1234,
"Expected 1234: %d\n", max_run_time);
385 ok(max_run_time == 0,
"Expected 0: %d\n", max_run_time);
393 ok(max_run_time == 1,
"Expected 1: %d\n", max_run_time);
401 ok(max_run_time ==
INFINITE,
"Expected INFINITE: %d\n", max_run_time);
412 const WCHAR dummy_account_name[] = {
'N',
'o',
'S',
'u',
'c',
'h',
413 'A',
'c',
'c',
'o',
'u',
'n',
't', 0};
414 const WCHAR dummy_account_name_b[] = {
'N',
'o',
'S',
'u',
'c',
'h',
415 'A',
'c',
'c',
'o',
'u',
'n',
't',
'B', 0};
418 ok(
setup,
"Failed to setup test_task\n");
421 skip(
"Failed to create task. Skipping tests.\n");
426 hres = ITask_GetAccountInformation(
test_task, &account_name);
432 win_skip(
"Security services are not supported\n");
438 "Unset account name generated: 0x%08x\n",
hres);
444 "Failed setting dummy account with no password: %08x\n",
hres);
445 hres = ITask_GetAccountInformation(
test_task, &account_name);
450 "GetAccountInformation failed: %08x\n",
hres);
453 ok(!
lstrcmpW(account_name, dummy_account_name),
461 hres = ITask_SetAccountInformation(
test_task, dummy_account_name_b,
462 dummy_account_name_b);
464 "Failed setting dummy account with password: %08x\n",
hres);
465 hres = ITask_GetAccountInformation(
test_task, &account_name);
470 "GetAccountInformation failed: %08x\n",
hres);
473 ok(!
lstrcmpW(account_name, dummy_account_name_b),
482 hres = ITask_GetAccountInformation(
test_task, &account_name);
487 "GetAccountInformation failed: %08x\n",
hres);
491 "Got %s, expected empty string\n",
wine_dbgstr_w(account_name));
DWORD WINAPI SearchPathW(IN LPCWSTR lpPath OPTIONAL, IN LPCWSTR lpFileName, IN LPCWSTR lpExtension OPTIONAL, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart OPTIONAL)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
VOID WINAPI CoTaskMemFree(LPVOID ptr)
#define ERROR_FILE_NOT_FOUND
#define comment(fmt, arg1)
static void test_SetComment_GetComment(void)
static ITaskScheduler * test_task_scheduler
static void test_CreateTrigger(void)
static BOOL setup_task(void)
static void cleanup_task(void)
static LPCWSTR path_resolve_name(LPCWSTR base_name)
static void test_SetMaxRunTime_GetMaxRunTime(void)
static void test_SetApplicationName_GetApplicationName(void)
static void test_SetAccountInformation_GetAccountInformation(void)
static const WCHAR empty[]
static void test_SetParameters_GetParameters(void)
static WORD trigger_index
static ITaskTrigger * test_trigger
#define SCHED_E_SERVICE_NOT_RUNNING
#define SCHED_E_NO_SECURITY_SERVICES
#define SCHED_E_CANNOT_OPEN_TASK
#define HRESULT_FROM_WIN32(x)