Commit db94448d authored by Kevin Puetz's avatar Kevin Puetz Committed by Alexandre Julliard

vbscript: Only set EXCEPINFO strings for cases that map_hres translated.

Add test for E_UNEXPECTED.
parent d8a03ae6
......@@ -2498,10 +2498,13 @@ HRESULT exec_script(script_ctx_t *ctx, BOOL extern_caller, function_t *func, vbd
}
ctx->ei.scode = hres;
if(!ctx->ei.bstrSource)
ctx->ei.bstrSource = get_vbscript_string(VBS_RUNTIME_ERROR);
if(!ctx->ei.bstrDescription)
ctx->ei.bstrDescription = get_vbscript_error_string(hres);
if(HRESULT_FACILITY(hres) == FACILITY_VBS)
{
if(!ctx->ei.bstrSource)
ctx->ei.bstrSource = get_vbscript_string(VBS_RUNTIME_ERROR);
if(!ctx->ei.bstrDescription)
ctx->ei.bstrDescription = get_vbscript_error_string(hres);
}
if(exec.resume_next) {
unsigned stack_off;
......
......@@ -2477,6 +2477,32 @@ static void test_callbacks(void)
free_ei(&ei);
IActiveScriptError_Release(error1);
store_script_error = &error1;
SET_EXPECT(OnScriptError);
hres = parse_script_ar("throwException &h8000FFFF&");
ok(hres == E_UNEXPECTED, "got error: %08lx\n", hres);
CHECK_CALLED(OnScriptError);
memset(&ei, 0xcc, sizeof(ei));
hres = IActiveScriptError_GetExceptionInfo(error1, &ei);
ok(hres == S_OK, "GetExceptionInfo returned %08lx\n", hres);
ok(!ei.wCode, "wCode = %x\n", ei.wCode);
ok(!ei.wReserved, "wReserved = %x\n", ei.wReserved);
if(is_english) {
ok(!ei.bstrSource,
"bstrSource = %s\n", wine_dbgstr_w(ei.bstrSource));
ok(!ei.bstrDescription,
"bstrDescription = %s\n", wine_dbgstr_w(ei.bstrDescription));
}
ok(!ei.bstrHelpFile, "bstrHelpFile = %s\n", wine_dbgstr_w(ei.bstrHelpFile));
ok(!ei.dwHelpContext, "dwHelpContext = %lx\n", ei.dwHelpContext);
ok(!ei.pvReserved, "pvReserved = %p\n", ei.pvReserved);
ok(!ei.pfnDeferredFillIn, "pfnDeferredFillIn = %p\n", ei.pfnDeferredFillIn);
ok(ei.scode == E_UNEXPECTED, "scode = %lx\n", ei.scode);
free_ei(&ei);
IActiveScriptError_Release(error1);
}
static void test_gc(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment