https://bugs.winehq.org/show_bug.cgi?id=49908
Bug ID: 49908 Summary: vbscript: ExecuteGlobal is not implemented Product: Wine Version: 5.18 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: vbscript Assignee: wine-bugs@winehq.org Reporter: sloper42@yahoo.com Distribution: ---
Created attachment 68275 --> https://bugs.winehq.org/attachment.cgi?id=68275 vbs testcase
The script in https://bugs.winehq.org/show_bug.cgi?id=39971 uses ExecuteGlobal, which is only stubbed in vbscript.dll.
https://bugs.winehq.org/show_bug.cgi?id=49908
Jason Millard jsm174@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jsm174@gmail.com
--- Comment #1 from Jason Millard jsm174@gmail.com --- While working on using the vbscript engine of Wine for a macos/linux port of Visual Pinball, I am in need of this too.
Most table scripts use ExecuteGlobal as a way to import other scripts:
On Error Resume Next ExecuteGlobal GetTextFile("controller.vbs") If Err Then MsgBox "You need the Controller.vbs file in order to run this table (installed with the VPX package in the scripts folder)" On Error Goto 0
(GetTextFile is an exposed method in Visual Pinball that loads a file and returns the result as a BSTR variant)
I believe I have this working, so I figured I would post it here.
global.c:
static HRESULT Global_ExecuteGlobal(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { #ifndef __EXECUTE_GLOBAL_FIX__ FIXME("\n"); return E_NOTIMPL; #else vbscode_t *code; HRESULT hres = compile_script(This->ctx, V_BSTR(arg), 0, 0, 0, 0, SCRIPTTEXT_ISVISIBLE, &code);
if (SUCCEEDED(hres)) hres = exec_global_code(This->ctx, code, res);
return hres; #endif
vbscript.h:
#ifdef __EXECUTE_GLOBAL_FIX__ HRESULT exec_global_code(script_ctx_t *ctx, vbscode_t *code, VARIANT *res) DECLSPEC_HIDDEN; #endif
vbscript.c:
#ifndef __EXECUTE_GLOBAL_FIX__ static HRESULT exec_global_code(script_ctx_t *ctx, vbscode_t *code, VARIANT *res) #else HRESULT exec_global_code(script_ctx_t *ctx, vbscode_t *code, VARIANT *res) #endif { ScriptDisp *obj = ctx->script_obj; function_t *func_iter, **new_funcs; . . .