[PATCH v3 1/2] msscript: Cache state of IActiveScript in ScriptHost struct.

Jacek Caban jacek at codeweavers.com
Mon Sep 16 12:55:05 CDT 2019


Hi Jactry,

On 9/16/19 4:19 PM, Jactry Zeng wrote:
> @@ -952,6 +954,20 @@ static HRESULT WINAPI ScriptControl_AddObject(IScriptControl *iface, BSTR name,
>       return hr;
>   }
>   
> +static HRESULT set_script_state(ScriptHost *host, SCRIPTSTATE state, BOOL check_state)
> +{
> +    HRESULT hr;
> +
> +    if (check_state && (host->script_state == SCRIPTSTATE_STARTED))
> +        return S_OK;
> +
> +    hr = IActiveScript_SetScriptState(host->script, state);
> +    if (SUCCEEDED(hr))
> +        host->script_state = state;
> +
> +    return hr;
> +}


I think that the previous version was better. Nikolay's comment was a 
question. The answer seems to be that only some set_script_state callers 
call the engine repeatedly.


> @@ -147,8 +149,8 @@ static HRESULT WINAPI ActiveScriptParse_ParseScriptText(IActiveScriptParse *ifac
>           LPCOLESTR pstrDelimiter, CTXARG_T dwSourceContextCookie, ULONG ulStartingLine,
>           DWORD dwFlags, VARIANT *pvarResult, EXCEPINFO *pexcepinfo)
>   {
> -    ok(0, "unexpected call\n");
> -    return E_NOTIMPL;
> +    CHECK_EXPECT(ParseScriptText);
> +    return S_OK;
>   }


It would be interesting to test some arguments. Especially flags will be 
useful.


> +    /* custom script engine */
> +    if (register_script_engine())
> +    {


It seems to be done in quite a few places already. Maybe we should move 
the call to START_TEST and have have_custom_engine global variable?


Thanks,

Jacek




More information about the wine-devel mailing list