mstask: Implemented NewWorkItem.
This commit is contained in:
parent
777c2f1d46
commit
2f366935d5
|
@ -119,9 +119,18 @@ static HRESULT WINAPI MSTASK_ITaskScheduler_NewWorkItem(
|
|||
REFIID riid,
|
||||
IUnknown **ppunk)
|
||||
{
|
||||
FIXME("%p, %s, %s, %s, %p: stub\n", iface, debugstr_w(pwszTaskName),
|
||||
HRESULT hr;
|
||||
TRACE("(%p, %s, %s, %s, %p)\n", iface, debugstr_w(pwszTaskName),
|
||||
debugstr_guid(rclsid) ,debugstr_guid(riid), ppunk);
|
||||
return E_NOTIMPL;
|
||||
|
||||
if (!IsEqualGUID(rclsid, &CLSID_CTask))
|
||||
return CLASS_E_CLASSNOTAVAILABLE;
|
||||
|
||||
if (!IsEqualGUID(riid, &IID_ITask))
|
||||
return E_NOINTERFACE;
|
||||
|
||||
hr = TaskConstructor(pwszTaskName, (LPVOID *)ppunk);
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI MSTASK_ITaskScheduler_AddWorkItem(
|
||||
|
|
|
@ -49,25 +49,25 @@ static void test_NewWorkItem(void)
|
|||
/* Test basic task creation */
|
||||
hres = ITaskScheduler_NewWorkItem(test_task_scheduler, task_name,
|
||||
&CLSID_CTask, &IID_ITask, (IUnknown**)&task);
|
||||
todo_wine ok(hres == S_OK, "NewNetworkItem failed: %08x\n", hres);
|
||||
ok(hres == S_OK, "NewNetworkItem failed: %08x\n", hres);
|
||||
if (hres == S_OK)
|
||||
ITask_Release(task);
|
||||
|
||||
/* Task creation attempt using invalid work item class ID */
|
||||
hres = ITaskScheduler_NewWorkItem(test_task_scheduler, task_name,
|
||||
&GUID_BAD, &IID_ITask, (IUnknown**)&task);
|
||||
todo_wine ok(hres == CLASS_E_CLASSNOTAVAILABLE,
|
||||
ok(hres == CLASS_E_CLASSNOTAVAILABLE,
|
||||
"Expected CLASS_E_CLASSNOTAVAILABLE: %08x\n", hres);
|
||||
|
||||
/* Task creation attempt using invalid interface ID */
|
||||
hres = ITaskScheduler_NewWorkItem(test_task_scheduler, task_name,
|
||||
&CLSID_CTask, &GUID_BAD, (IUnknown**)&task);
|
||||
todo_wine ok(hres == E_NOINTERFACE, "Expected E_NOINTERFACE: %08x\n", hres);
|
||||
ok(hres == E_NOINTERFACE, "Expected E_NOINTERFACE: %08x\n", hres);
|
||||
|
||||
/* Task creation attempt using invalid work item class and interface ID */
|
||||
hres = ITaskScheduler_NewWorkItem(test_task_scheduler, task_name,
|
||||
&GUID_BAD, &GUID_BAD, (IUnknown**)&task);
|
||||
todo_wine ok(hres == CLASS_E_CLASSNOTAVAILABLE,
|
||||
ok(hres == CLASS_E_CLASSNOTAVAILABLE,
|
||||
"Expected CLASS_E_CLASSNOTAVAILABLE: %08x\n", hres);
|
||||
|
||||
ITaskScheduler_Release(test_task_scheduler);
|
||||
|
|
Loading…
Reference in New Issue