Detlef Riekenberg : mstask: Implement GetTargetComputer.

Alexandre Julliard julliard at winehq.org
Tue Nov 6 14:27:29 CST 2012


Module: wine
Branch: master
Commit: 493d85898889e4d67e1d2e65c8fb6e7abdef7cae
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=493d85898889e4d67e1d2e65c8fb6e7abdef7cae

Author: Detlef Riekenberg <wine.dev at web.de>
Date:   Tue Nov  6 00:20:12 2012 +0100

mstask: Implement GetTargetComputer.

---

 dlls/mstask/task_scheduler.c |   26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/dlls/mstask/task_scheduler.c b/dlls/mstask/task_scheduler.c
index 1d2ac21..44609b8 100644
--- a/dlls/mstask/task_scheduler.c
+++ b/dlls/mstask/task_scheduler.c
@@ -93,8 +93,30 @@ static HRESULT WINAPI MSTASK_ITaskScheduler_GetTargetComputer(
         ITaskScheduler* iface,
         LPWSTR *ppwszComputer)
 {
-    FIXME("%p, %p: stub\n", iface, ppwszComputer);
-    return E_NOTIMPL;
+    TaskSchedulerImpl *This = impl_from_ITaskScheduler(iface);
+    LPWSTR buffer;
+    DWORD len = MAX_COMPUTERNAME_LENGTH + 1; /* extra space for the zero */
+
+    TRACE("(%p)->(%p)\n", This, ppwszComputer);
+
+    if (!ppwszComputer)
+        return E_INVALIDARG;
+
+    /* extra space for two '\' and a zero */
+    buffer = CoTaskMemAlloc((MAX_COMPUTERNAME_LENGTH + 3) * sizeof(WCHAR));
+    if (buffer)
+    {
+        buffer[0] = '\\';
+        buffer[1] = '\\';
+        if (GetComputerNameW(buffer + 2, &len))
+        {
+            *ppwszComputer = buffer;
+            return S_OK;
+        }
+        CoTaskMemFree(buffer);
+    }
+    *ppwszComputer = NULL;
+    return HRESULT_FROM_WIN32(GetLastError());
 }
 
 static HRESULT WINAPI MSTASK_ITaskScheduler_Enum(




More information about the wine-cvs mailing list