From 280dbcf84a314ff111306f85432df60bd65effff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zi=C4=99tek?= Date: Tue, 23 Aug 2011 15:16:08 +0200 Subject: [PATCH] wscript: Implemented Host_get_Interactive. --- programs/wscript/host.c | 7 +++++-- programs/wscript/main.c | 25 ++++++++++++++++++++++++- programs/wscript/tests/run.js | 1 + programs/wscript/wscript.h | 2 ++ 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/programs/wscript/host.c b/programs/wscript/host.c index 02a9291d613..0ce7e58eee0 100644 --- a/programs/wscript/host.c +++ b/programs/wscript/host.c @@ -34,6 +34,7 @@ static const WCHAR wshNameW[] = {'W','i','n','d','o','w','s',' ','S','c','r','i','p','t',' ','H','o','s','t',0}; static const WCHAR wshVersionW[] = {'5','.','8'}; +VARIANT_BOOL wshInteractive = VARIANT_TRUE; WINE_DEFAULT_DEBUG_CHANNEL(wscript); @@ -145,8 +146,10 @@ static HRESULT WINAPI Host_get_Path(IHost *iface, BSTR *out_Path) static HRESULT WINAPI Host_get_Interactive(IHost *iface, VARIANT_BOOL *out_Interactive) { - WINE_FIXME("(%p)\n", out_Interactive); - return E_NOTIMPL; + WINE_TRACE("(%p)\n", out_Interactive); + + *out_Interactive = wshInteractive; + return S_OK; } static HRESULT WINAPI Host_put_Interactive(IHost *iface, VARIANT_BOOL v) diff --git a/programs/wscript/main.c b/programs/wscript/main.c index 3073445c4a0..9d79415e490 100644 --- a/programs/wscript/main.c +++ b/programs/wscript/main.c @@ -322,6 +322,28 @@ static void run_script(const WCHAR *filename, IActiveScript *script, IActiveScri WINE_FIXME("SetScriptState failed: %08x\n", hres); } +static BOOL set_host_properties(const WCHAR *prop) +{ + static const WCHAR iactive[] = {'i',0}; + static const WCHAR batch[] = {'b',0}; + + if(*prop == '/') { + ++prop; + if(*prop == '/') + ++prop; + } + else + ++prop; + + if(strcmpiW(prop, iactive) == 0) + wshInteractive = VARIANT_TRUE; + else if(strcmpiW(prop, batch) == 0) + wshInteractive = VARIANT_FALSE; + else + return FALSE; + return TRUE; +} + int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cmdshow) { const WCHAR *ext, *filename = NULL; @@ -340,7 +362,8 @@ int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cm for(i=0; i