Commit c940a3e9 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

taskschd: Implement ITaskService::get_TargetServer.

parent 938f073e
MODULE = taskschd.dll
IMPORTS = oleaut32
C_SRCS = \
task.c \
......
......@@ -193,8 +193,19 @@ static HRESULT WINAPI TaskService_get_Connected(ITaskService *iface, VARIANT_BOO
static HRESULT WINAPI TaskService_get_TargetServer(ITaskService *iface, BSTR *server)
{
FIXME("%p,%p: stub\n", iface, server);
return E_NOTIMPL;
TaskService *task_svc = impl_from_ITaskService(iface);
TRACE("%p,%p\n", iface, server);
if (!server) return E_POINTER;
if (!task_svc->connected)
return HRESULT_FROM_WIN32(ERROR_ONLY_IF_CONNECTED);
*server = SysAllocString(task_svc->comp_name);
if (!*server) return E_OUTOFMEMORY;
return S_OK;
}
static HRESULT WINAPI TaskService_get_ConnectedUser(ITaskService *iface, BSTR *user)
......
......@@ -52,7 +52,6 @@ static void test_Connect(void)
ok(vbool == VARIANT_FALSE, "expected VARIANT_FALSE, got %d\n", vbool);
hr = ITaskService_get_TargetServer(service, &bstr);
todo_wine
ok(hr == HRESULT_FROM_WIN32(ERROR_ONLY_IF_CONNECTED), "expected ERROR_ONLY_IF_CONNECTED, got %#x\n", hr);
/* Win7 doesn't support UNC \\ prefix, but according to a user
......@@ -89,7 +88,6 @@ todo_wine
ok(vbool == VARIANT_TRUE, "expected VARIANT_TRUE, got %d\n", vbool);
hr = ITaskService_get_TargetServer(service, &bstr);
todo_wine
ok(hr == S_OK, "get_TargetServer error %#x\n", hr);
if (hr == S_OK)
{
......
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