Detlef Riekenberg : mstask: Implement SetTargetComputer.
Alexandre Julliard
julliard at winehq.org
Thu Nov 8 15:39:55 CST 2012
Module: wine
Branch: master
Commit: 5bff2fb66b46ab1834354b57baca262861b74e03
URL: http://source.winehq.org/git/wine.git/?a=commit;h=5bff2fb66b46ab1834354b57baca262861b74e03
Author: Detlef Riekenberg <wine.dev at web.de>
Date: Thu Nov 8 00:12:47 2012 +0100
mstask: Implement SetTargetComputer.
---
dlls/mstask/task_scheduler.c | 23 +++++++++++++++++++++--
1 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/dlls/mstask/task_scheduler.c b/dlls/mstask/task_scheduler.c
index 44609b8..5657e43 100644
--- a/dlls/mstask/task_scheduler.c
+++ b/dlls/mstask/task_scheduler.c
@@ -85,8 +85,27 @@ static HRESULT WINAPI MSTASK_ITaskScheduler_SetTargetComputer(
ITaskScheduler* iface,
LPCWSTR pwszComputer)
{
- FIXME("%p, %s: stub\n", iface, debugstr_w(pwszComputer));
- return E_NOTIMPL;
+ TaskSchedulerImpl *This = impl_from_ITaskScheduler(iface);
+ WCHAR buffer[MAX_COMPUTERNAME_LENGTH + 3]; /* extra space for two '\' and a zero */
+ DWORD len = MAX_COMPUTERNAME_LENGTH + 1; /* extra space for a zero */
+
+ TRACE("(%p)->(%s)\n", This, debugstr_w(pwszComputer));
+
+ /* NULL is an alias for the local computer */
+ if (!pwszComputer)
+ return S_OK;
+
+ buffer[0] = '\\';
+ buffer[1] = '\\';
+ if (GetComputerNameW(buffer + 2, &len))
+ {
+ if (!lstrcmpiW(buffer, pwszComputer) || /* full unc name */
+ !lstrcmpiW(buffer + 2, pwszComputer)) /* name without backslash */
+ return S_OK;
+ }
+
+ FIXME("remote computer %s not supported\n", debugstr_w(pwszComputer));
+ return HRESULT_FROM_WIN32(ERROR_BAD_NETPATH);
}
static HRESULT WINAPI MSTASK_ITaskScheduler_GetTargetComputer(
More information about the wine-cvs
mailing list