taskschd: Implement ITaskService::get_TargetServer.

This commit is contained in:
Dmitry Timoshkov 2014-01-14 17:18:11 +09:00 committed by Alexandre Julliard
parent 938f073e5c
commit c940a3e97e
3 changed files with 14 additions and 4 deletions

View File

@ -1,4 +1,5 @@
MODULE = taskschd.dll
IMPORTS = oleaut32
C_SRCS = \
task.c \

View File

@ -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)

View File

@ -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)
{