From: Kevin Puetz PuetzKevinA@JohnDeere.com
It occurred to me to wonder whether it was really Description, Source, or both that results in skipping the map_vbs_exception logic.
It turns out we had it right (it's just description, and it's null-pointer and not empty string that makes the difference).
But the fact that it's not obvious still makes it a good testcase --- dlls/vbscript/tests/run.c | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-)
diff --git a/dlls/vbscript/tests/run.c b/dlls/vbscript/tests/run.c index ef26641d01d..31ac03ab8d7 100644 --- a/dlls/vbscript/tests/run.c +++ b/dlls/vbscript/tests/run.c @@ -1577,8 +1577,11 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
if(pdp->cArgs >= 2) { v = pdp->rgvarg + pdp->cArgs - 2; - ok(V_VT(v) == VT_BSTR, "v = %s\n", debugstr_variant(v)); - pei->bstrSource = SysAllocString(V_BSTR(v)); + if(!(V_VT(v) == VT_ERROR && V_ERROR(v) == DISP_E_PARAMNOTFOUND)) /* != vtMissing */ + { + ok(V_VT(v) == VT_BSTR, "v = %s\n", debugstr_variant(v)); + pei->bstrSource = SysAllocString(V_BSTR(v)); + } }
if(pdp->cArgs >= 3) { @@ -2453,6 +2456,31 @@ static void test_callbacks(void)
IActiveScriptError_Release(error1);
+ store_script_error = &error1; + SET_EXPECT(OnScriptError); + hres = parse_script_ar("throwException &h80004002&, , "test desc""); + ok(hres == E_NOINTERFACE, "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(!wcscmp(ei.bstrDescription, L"test desc"), + "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_NOINTERFACE, "scode = %lx\n", ei.scode); + free_ei(&ei); + + IActiveScriptError_Release(error1); + store_script_error = &error1; SET_EXPECT(OnScriptError); hres = parse_script_ar("throwException &h80004002&, "test src", "test desc"");