Commit 04e240b3 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

mstask: Implement setting and getting working directory using IExecAction.

parent cad2e5e8
...@@ -533,20 +533,45 @@ static HRESULT WINAPI MSTASK_ITask_GetParameters(ITask *iface, LPWSTR *params) ...@@ -533,20 +533,45 @@ static HRESULT WINAPI MSTASK_ITask_GetParameters(ITask *iface, LPWSTR *params)
return hr; return hr;
} }
static HRESULT WINAPI MSTASK_ITask_SetWorkingDirectory( static HRESULT WINAPI MSTASK_ITask_SetWorkingDirectory(ITask * iface, LPCWSTR workdir)
ITask* iface,
LPCWSTR pwszWorkingDirectory)
{ {
FIXME("(%p, %s): stub\n", iface, debugstr_w(pwszWorkingDirectory)); TaskImpl *This = impl_from_ITask(iface);
return E_NOTIMPL;
TRACE("(%p, %s)\n", iface, debugstr_w(workdir));
if (!workdir || !workdir[0])
workdir = NULL;
return IExecAction_put_WorkingDirectory(This->action, (BSTR)workdir);
} }
static HRESULT WINAPI MSTASK_ITask_GetWorkingDirectory( static HRESULT WINAPI MSTASK_ITask_GetWorkingDirectory(ITask *iface, LPWSTR *workdir)
ITask* iface,
LPWSTR *ppwszWorkingDirectory)
{ {
FIXME("(%p, %p): stub\n", iface, ppwszWorkingDirectory); TaskImpl *This = impl_from_ITask(iface);
return E_NOTIMPL; HRESULT hr;
BSTR dir;
DWORD len;
TRACE("(%p, %p)\n", iface, workdir);
hr = IExecAction_get_WorkingDirectory(This->action, &dir);
if (hr != S_OK) return hr;
len = dir ? lstrlenW(dir) + 1 : 1;
*workdir = CoTaskMemAlloc(len * sizeof(WCHAR));
if (*workdir)
{
if (!dir)
*workdir[0] = 0;
else
lstrcpyW(*workdir, dir);
hr = S_OK;
}
else
hr = E_OUTOFMEMORY;
SysFreeString(dir);
return hr;
} }
static HRESULT WINAPI MSTASK_ITask_SetPriority( static HRESULT WINAPI MSTASK_ITask_SetPriority(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment