Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
f429c818
Commit
f429c818
authored
Apr 25, 2018
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Apr 25, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mstask: Implement ITaskScheduler::AddWorkItem().
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bf635fd4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
14 deletions
+23
-14
task_scheduler.c
dlls/mstask/task_scheduler.c
+23
-6
task_scheduler.c
dlls/mstask/tests/task_scheduler.c
+0
-8
No files found.
dlls/mstask/task_scheduler.c
View file @
f429c818
...
...
@@ -331,13 +331,30 @@ static HRESULT WINAPI MSTASK_ITaskScheduler_NewWorkItem(
return
TaskConstructor
(
This
->
service
,
task_name
,
(
ITask
**
)
task
);
}
static
HRESULT
WINAPI
MSTASK_ITaskScheduler_AddWorkItem
(
ITaskScheduler
*
iface
,
LPCWSTR
pwszTaskName
,
IScheduledWorkItem
*
pWorkItem
)
static
HRESULT
WINAPI
MSTASK_ITaskScheduler_AddWorkItem
(
ITaskScheduler
*
iface
,
LPCWSTR
name
,
IScheduledWorkItem
*
item
)
{
FIXME
(
"%p, %s, %p: stub
\n
"
,
iface
,
debugstr_w
(
pwszTaskName
),
pWorkItem
);
return
E_NOTIMPL
;
static
const
WCHAR
tasksW
[]
=
{
'\\'
,
'T'
,
'a'
,
's'
,
'k'
,
's'
,
'\\'
,
0
};
static
const
WCHAR
jobW
[]
=
{
'.'
,
'j'
,
'o'
,
'b'
,
0
};
WCHAR
task_name
[
MAX_PATH
];
IPersistFile
*
pfile
;
HRESULT
hr
;
TRACE
(
"%p, %s, %p
\n
"
,
iface
,
debugstr_w
(
name
),
item
);
if
(
strchrW
(
name
,
'.'
))
return
E_INVALIDARG
;
GetWindowsDirectoryW
(
task_name
,
MAX_PATH
);
lstrcatW
(
task_name
,
tasksW
);
lstrcatW
(
task_name
,
name
);
lstrcatW
(
task_name
,
jobW
);
hr
=
IScheduledWorkItem_QueryInterface
(
item
,
&
IID_IPersistFile
,
(
void
**
)
&
pfile
);
if
(
hr
==
S_OK
)
{
hr
=
IPersistFile_Save
(
pfile
,
task_name
,
TRUE
);
IPersistFile_Release
(
pfile
);
}
return
hr
;
}
static
HRESULT
WINAPI
MSTASK_ITaskScheduler_IsOfType
(
...
...
dlls/mstask/tests/task_scheduler.c
View file @
f429c818
...
...
@@ -343,30 +343,23 @@ static void test_task_storage(void)
ok
(
task2
==
(
ITask
*
)
0xdeadbeef
,
"task should not be set to NULL
\n
"
);
hr
=
ITaskScheduler_AddWorkItem
(
scheduler
,
Task1
,
(
IScheduledWorkItem
*
)
task
);
todo_wine
ok
(
hr
==
S_OK
,
"AddWorkItem error %#x
\n
"
,
hr
);
curfile
=
get_task_curfile
(
task
);
todo_wine
ok
(
file_exists
(
curfile
),
"curfile should exist
\n
"
);
hr
=
ITaskScheduler_AddWorkItem
(
scheduler
,
Task1
,
(
IScheduledWorkItem
*
)
task
);
todo_wine
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_FILE_EXISTS
),
"wrong error %#x
\n
"
,
hr
);
curfile
=
get_task_curfile
(
task
);
todo_wine
ok
(
file_exists
(
curfile
),
"curfile should exist
\n
"
);
ITask_Release
(
task
);
task
=
NULL
;
hr
=
ITaskScheduler_Activate
(
scheduler
,
Task1
,
&
IID_ITask
,
(
IUnknown
**
)
&
task
);
todo_wine
ok
(
hr
==
S_OK
,
"Activate error %#x
\n
"
,
hr
);
todo_wine
ok
(
task
!=
NULL
,
"task should not be set to NULL
\n
"
);
if
(
task
==
NULL
)
goto
fail
;
curfile2
=
get_task_curfile
(
task
);
ok
(
file_exists
(
curfile2
),
"curfile2 should exist
\n
"
);
...
...
@@ -380,7 +373,6 @@ todo_wine
CoTaskMemFree
(
curfile
);
ITask_Release
(
task
);
fail:
ITaskScheduler_Release
(
scheduler
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment