Hans Leidekker : taskschd: Implement IExecAction_get_Path.
Alexandre Julliard
julliard at winehq.org
Thu Nov 30 14:19:35 CST 2017
Module: wine
Branch: master
Commit: 0d3ebfc45981e7d61522c44ff91f9b8748ca5c60
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0d3ebfc45981e7d61522c44ff91f9b8748ca5c60
Author: Hans Leidekker <hans at codeweavers.com>
Date: Thu Nov 30 09:37:11 2017 +0100
taskschd: Implement IExecAction_get_Path.
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/taskschd/task.c | 16 ++++++++++++++--
dlls/taskschd/tests/scheduler.c | 13 +++++++++++++
2 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/dlls/taskschd/task.c b/dlls/taskschd/task.c
index 01e7c2d..df75236 100644
--- a/dlls/taskschd/task.c
+++ b/dlls/taskschd/task.c
@@ -1740,8 +1740,20 @@ static HRESULT WINAPI ExecAction_get_Type(IExecAction *iface, TASK_ACTION_TYPE *
static HRESULT WINAPI ExecAction_get_Path(IExecAction *iface, BSTR *path)
{
- FIXME("%p,%p: stub\n", iface, path);
- return E_NOTIMPL;
+ ExecAction *action = impl_from_IExecAction(iface);
+
+ TRACE("%p,%p\n", iface, path);
+
+ if (!path) return E_POINTER;
+
+ if (!action->path)
+ {
+ *path = NULL;
+ return S_OK;
+ }
+
+ if (!(*path = SysAllocString(action->path))) return E_OUTOFMEMORY;
+ return S_OK;
}
static HRESULT WINAPI ExecAction_put_Path(IExecAction *iface, BSTR path)
diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c
index 22854d9..c7de7c7 100644
--- a/dlls/taskschd/tests/scheduler.c
+++ b/dlls/taskschd/tests/scheduler.c
@@ -1236,6 +1236,7 @@ static void create_action(ITaskDefinition *taskdef)
IAction *action;
IExecAction *exec_action;
TASK_ACTION_TYPE type;
+ BSTR path;
hr = ITaskDefinition_get_Actions(taskdef, &actions);
ok(hr == S_OK, "get_Actions error %#x\n", hr);
@@ -1251,9 +1252,21 @@ static void create_action(ITaskDefinition *taskdef)
ok(hr == S_OK, "get_Type error %#x\n", hr);
ok(type == TASK_ACTION_EXEC, "got %u\n", type );
+ path = (BSTR)0xdeadbeef;
+ hr = IExecAction_get_Path(exec_action, &path);
+ ok(hr == S_OK, "get_Path error %#x\n", hr);
+ ok(path == NULL, "path not set\n");
+
hr = IExecAction_put_Path(exec_action, task1_exe);
ok(hr == S_OK, "put_Path error %#x\n", hr);
+ path = NULL;
+ hr = IExecAction_get_Path(exec_action, &path);
+ ok(hr == S_OK, "get_Path error %#x\n", hr);
+ ok(path != NULL, "path not set\n");
+ ok(!lstrcmpW(path, task1_exe), "wrong path\n" );
+ SysFreeString(path);
+
IExecAction_Release(exec_action);
IAction_Release(action);
IActionCollection_Release(actions);
More information about the wine-cvs
mailing list