[PATCH] vbscript/tests: Show IActiveScriptSite OnScriptError is called on error

Jacek Caban jacek at codeweavers.com
Mon Oct 26 06:23:59 CDT 2015


Hi Alistair,

On 10/26/15 09:56, Alistair Leslie-Hughes wrote:
> Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
> ---
>  dlls/vbscript/tests/run.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 46 insertions(+), 1 deletion(-)
>
> diff --git a/dlls/vbscript/tests/run.c b/dlls/vbscript/tests/run.c
> index a86711a..e625136 100644
> --- a/dlls/vbscript/tests/run.c
> +++ b/dlls/vbscript/tests/run.c
> @@ -100,6 +100,7 @@ DEFINE_EXPECT(Next);
>  DEFINE_EXPECT(GetWindow);
>  DEFINE_EXPECT(GetUIBehavior);
>  DEFINE_EXPECT(EnableModeless);
> +DEFINE_EXPECT(on_script_error);

Please use OnScriptError for consistency.

>  #define DISPID_GLOBAL_REPORTSUCCESS 1000
>  #define DISPID_GLOBAL_TRACE         1001
> @@ -138,6 +139,7 @@ static const char *test_name = "(null)";
>  static int test_counter;
>  static SCRIPTUICHANDLING uic_handling = SCRIPTUICHANDLING_NOUIERROR;
>  static IDispatchEx testObj;
> +static BOOL overwrite_return = FALSE;

How about using HRESULT here...

>  static BSTR a2bstr(const char *str)
>  {
> @@ -1623,7 +1625,22 @@ static HRESULT WINAPI ActiveScriptSite_OnStateChange(IActiveScriptSite *iface, S
>  
>  static HRESULT WINAPI ActiveScriptSite_OnScriptError(IActiveScriptSite *iface, IActiveScriptError *pscripterror)
>  {
> -    return E_NOTIMPL;
> +    HRESULT hr;
> +    EXCEPINFO ei = {0};
> +
> +    CHECK_EXPECT(on_script_error);
> +
> +    hr = IActiveScriptError_GetExceptionInfo(pscripterror, &ei);
> +    ok(hr == S_OK, "GetExceptionInfo %x\n", hr);
> +
> +    if(overwrite_return)
> +    {
> +        overwrite_return = FALSE;
> +        return S_OK;
> +    }
> +
> +    /* We return the EXCEPINFO error since returning S_OK means we have handled the error */
> +    return ei.scode;

... and return it here for simplicity?

Thanks,
Jacek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20151026/3ff886bd/attachment.html>


More information about the wine-devel mailing list