[PATCH 1/2] wscript: implemented Host_get_Name

Michał Ziętek smierc.w.wenecji at gmail.com
Tue Jun 28 06:37:36 CDT 2011


---
 programs/wscript/host.c       |    9 +++++++--
 programs/wscript/tests/run.js |    1 +
 2 files changed, 8 insertions(+), 2 deletions(-)
-------------- next part --------------
diff --git a/programs/wscript/host.c b/programs/wscript/host.c
index 9634100..3021656 100644
--- a/programs/wscript/host.c
+++ b/programs/wscript/host.c
@@ -29,6 +29,8 @@
 
 #include <wine/debug.h>
 
+static const WCHAR wshNameW[] = {'W','i','n','d','o','w','s',' ','S','c','r','i','p','t',' ','H','o','s','t',0};
+
 WINE_DEFAULT_DEBUG_CHANNEL(wscript);
 
 static HRESULT WINAPI Host_QueryInterface(IHost *iface, REFIID riid, void **ppv)
@@ -94,8 +96,11 @@ static HRESULT WINAPI Host_Invoke(IHost *iface, DISPID dispIdMember, REFIID riid
 
 static HRESULT WINAPI Host_get_Name(IHost *iface, BSTR *out_Name)
 {
-    WINE_FIXME("(%p)\n", out_Name);
-    return E_NOTIMPL;
+    WINE_TRACE("(%p)\n", out_Name);
+
+    if(!(*out_Name = SysAllocString(wshNameW)))
+	return E_OUTOFMEMORY;
+    return S_OK;
 }
 
 static HRESULT WINAPI Host_get_Application(IHost *iface, IDispatch **out_Dispatch)
diff --git a/programs/wscript/tests/run.js b/programs/wscript/tests/run.js
index 809fa2f..84d7789 100644
--- a/programs/wscript/tests/run.js
+++ b/programs/wscript/tests/run.js
@@ -25,5 +25,6 @@ function ok(expr, msg) {
 ok(typeof(WScript) === "object", "typeof(WScript) = " + typeof(WScript));
 ok(typeof(WSH) === "object", "typeof(WSH) = " + typeof(WSH));
 ok(WScript === WSH, "WScript !== WSH");
+ok(WScript.Name === "Windows Script Host", "WScript.Name = " + WScript.Name);
 
 winetest.reportSuccess();


More information about the wine-patches mailing list