2 * Copyright 2010 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
30 #include <wine/debug.h>
32 static const WCHAR wshNameW[] = {'W','i','n','d','o','w','s',' ','S','c','r','i','p','t',' ','H','o','s','t',0};
33 static const WCHAR wshVersionW[] = {'5','.','8'};
35 WINE_DEFAULT_DEBUG_CHANNEL(wscript);
37 static HRESULT WINAPI Host_QueryInterface(IHost *iface, REFIID riid, void **ppv)
39 WINE_TRACE("(%s %p)\n", wine_dbgstr_guid(riid), ppv);
41 if(IsEqualGUID(&IID_IUnknown, riid)
42 || IsEqualGUID(&IID_IDispatch, riid)
43 || IsEqualGUID(&IID_IHost, riid)) {
52 static ULONG WINAPI Host_AddRef(IHost *iface)
57 static ULONG WINAPI Host_Release(IHost *iface)
62 static HRESULT WINAPI Host_GetTypeInfoCount(IHost *iface, UINT *pctinfo)
64 WINE_TRACE("(%p)\n", pctinfo);
69 static HRESULT WINAPI Host_GetTypeInfo(IHost *iface, UINT iTInfo, LCID lcid,
72 WINE_TRACE("(%x %x %p\n", iTInfo, lcid, ppTInfo);
74 ITypeInfo_AddRef(host_ti);
79 static HRESULT WINAPI Host_GetIDsOfNames(IHost *iface, REFIID riid, LPOLESTR *rgszNames,
80 UINT cNames, LCID lcid, DISPID *rgDispId)
82 WINE_TRACE("(%s %p %d %x %p)\n", wine_dbgstr_guid(riid), rgszNames,
83 cNames, lcid, rgDispId);
85 return ITypeInfo_GetIDsOfNames(host_ti, rgszNames, cNames, rgDispId);
88 static HRESULT WINAPI Host_Invoke(IHost *iface, DISPID dispIdMember, REFIID riid,
89 LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult,
90 EXCEPINFO *pExcepInfo, UINT *puArgErr)
92 WINE_TRACE("(%d %p %p)\n", dispIdMember, pDispParams, pVarResult);
94 return ITypeInfo_Invoke(host_ti, iface, dispIdMember, wFlags, pDispParams,
95 pVarResult, pExcepInfo, puArgErr);
98 static HRESULT WINAPI Host_get_Name(IHost *iface, BSTR *out_Name)
100 WINE_TRACE("(%p)\n", out_Name);
102 if(!(*out_Name = SysAllocString(wshNameW)))
103 return E_OUTOFMEMORY;
107 static HRESULT WINAPI Host_get_Application(IHost *iface, IDispatch **out_Dispatch)
109 WINE_FIXME("(%p)\n", out_Dispatch);
113 static HRESULT WINAPI Host_get_FullName(IHost *iface, BSTR *out_Path)
115 WINE_FIXME("(%p)\n", out_Path);
119 static HRESULT WINAPI Host_get_Path(IHost *iface, BSTR *out_Path)
121 WINE_FIXME("(%p)\n", out_Path);
125 static HRESULT WINAPI Host_get_Interactive(IHost *iface, VARIANT_BOOL *out_Interactive)
127 WINE_FIXME("(%p)\n", out_Interactive);
131 static HRESULT WINAPI Host_put_Interactive(IHost *iface, VARIANT_BOOL v)
133 WINE_FIXME("(%x)\n", v);
137 static HRESULT WINAPI Host_Quit(IHost *iface, int ExitCode)
139 WINE_FIXME("(%d)\n", ExitCode);
143 static HRESULT WINAPI Host_get_ScriptName(IHost *iface, BSTR *out_ScriptName)
145 WINE_FIXME("(%p)\n", out_ScriptName);
149 static HRESULT WINAPI Host_get_ScriptFullName(IHost *iface, BSTR *out_ScriptFullName)
151 WINE_FIXME("(%p)\n", out_ScriptFullName);
155 static HRESULT WINAPI Host_get_Arguments(IHost *iface, IArguments2 **out_Arguments)
157 WINE_FIXME("(%p)\n", out_Arguments);
161 static HRESULT WINAPI Host_get_Version(IHost *iface, BSTR *out_Version)
163 WINE_TRACE("(%p)\n", out_Version);
165 if(!(*out_Version = SysAllocString(wshVersionW)))
166 return E_OUTOFMEMORY;
170 static HRESULT WINAPI Host_get_BuildVersion(IHost *iface, int *out_Build)
172 WINE_FIXME("(%p)\n", out_Build);
176 static HRESULT WINAPI Host_get_Timeout(IHost *iface, LONG *out_Timeout)
178 WINE_FIXME("(%p)\n", out_Timeout);
182 static HRESULT WINAPI Host_put_Timeout(IHost *iface, LONG v)
184 WINE_FIXME("(%d)\n", v);
188 static HRESULT WINAPI Host_CreateObject(IHost *iface, BSTR ProgID, BSTR Prefix,
189 IDispatch **out_Dispatch)
191 WINE_FIXME("(%s %s %p)\n", wine_dbgstr_w(ProgID), wine_dbgstr_w(Prefix), out_Dispatch);
195 static HRESULT WINAPI Host_Echo(IHost *iface, SAFEARRAY *args)
197 WINE_FIXME("(%p)\n", args);
201 static HRESULT WINAPI Host_GetObject(IHost *iface, BSTR Pathname, BSTR ProgID,
202 BSTR Prefix, IDispatch **out_Dispatch)
204 WINE_FIXME("(%s %s %s %p)\n", wine_dbgstr_w(Pathname), wine_dbgstr_w(ProgID),
205 wine_dbgstr_w(Prefix), out_Dispatch);
209 static HRESULT WINAPI Host_DisconnectObject(IHost *iface, IDispatch *Object)
211 WINE_FIXME("(%p)\n", Object);
215 static HRESULT WINAPI Host_Sleep(IHost *iface, LONG Time)
217 WINE_FIXME("(%d)\n", Time);
221 static HRESULT WINAPI Host_ConnectObject(IHost *iface, IDispatch *Object, BSTR Prefix)
223 WINE_FIXME("(%p %s)\n", Object, wine_dbgstr_w(Prefix));
227 static HRESULT WINAPI Host_get_StdIn(IHost *iface, ITextStream **ppts)
229 WINE_FIXME("(%p)\n", ppts);
233 static HRESULT WINAPI Host_get_StdOut(IHost *iface, ITextStream **ppts)
235 WINE_FIXME("(%p)\n", ppts);
239 static HRESULT WINAPI Host_get_StdErr(IHost *iface, ITextStream **ppts)
241 WINE_FIXME("(%p)\n", ppts);
245 static const IHostVtbl HostVtbl = {
249 Host_GetTypeInfoCount,
254 Host_get_Application,
257 Host_get_Interactive,
258 Host_put_Interactive,
261 Host_get_ScriptFullName,
264 Host_get_BuildVersion,
270 Host_DisconnectObject,
278 IHost host_obj = { &HostVtbl };