Michał Ziętek : wscript: Implemented Host_get_Name.

Alexandre Julliard julliard at winehq.org
Tue Jun 28 17:25:17 CDT 2011


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

Author: Michał Ziętek <smierc.w.wenecji at gmail.com>
Date:   Tue Jun 28 13:37:36 2011 +0200

wscript: Implemented Host_get_Name.

---

 programs/wscript/host.c       |    9 +++++++--
 programs/wscript/tests/run.js |    1 +
 2 files changed, 8 insertions(+), 2 deletions(-)

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-cvs mailing list