Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/msscript.ocx/msscript.c | 10 ++++++++-- dlls/msscript.ocx/tests/msscript.c | 22 ++++++++++++++++++---- 2 files changed, 26 insertions(+), 6 deletions(-)
diff --git a/dlls/msscript.ocx/msscript.c b/dlls/msscript.ocx/msscript.c index 30125af..288056b 100644 --- a/dlls/msscript.ocx/msscript.c +++ b/dlls/msscript.ocx/msscript.c @@ -126,6 +126,7 @@ typedef struct {
HRESULT number; BSTR source; + BSTR desc;
BOOLEAN info_filled; } ScriptError; @@ -2132,6 +2133,7 @@ static void fill_error_info(ScriptError *error)
error->number = info.scode; error->source = info.bstrSource; + error->desc = info.bstrDescription; }
static HRESULT WINAPI ScriptError_QueryInterface(IScriptError *iface, REFIID riid, void **ppv) @@ -2267,9 +2269,11 @@ static HRESULT WINAPI ScriptError_get_Description(IScriptError *iface, BSTR *pbs { ScriptError *This = impl_from_IScriptError(iface);
- FIXME("(%p)->(%p)\n", This, pbstrDescription); + TRACE("(%p)->(%p)\n", This, pbstrDescription);
- return E_NOTIMPL; + fill_error_info(This); + *pbstrDescription = SysAllocString(This->desc); + return S_OK; }
static HRESULT WINAPI ScriptError_get_HelpFile(IScriptError *iface, BSTR *pbstrHelpFile) @@ -2329,9 +2333,11 @@ static HRESULT WINAPI ScriptError_Clear(IScriptError *iface) This->object = NULL; } SysFreeString(This->source); + SysFreeString(This->desc);
This->number = 0; This->source = NULL; + This->desc = NULL;
This->info_filled = FALSE; return S_OK; diff --git a/dlls/msscript.ocx/tests/msscript.c b/dlls/msscript.ocx/tests/msscript.c index d42ce9e..46463c6 100644 --- a/dlls/msscript.ocx/tests/msscript.c +++ b/dlls/msscript.ocx/tests/msscript.c @@ -3339,6 +3339,9 @@ static void test_IScriptControl_get_Error(void) hr = IScriptError_get_Source(error, &str); ok(hr == S_OK, "IScriptError_get_Source failed: 0x%08x.\n", hr); ok(str == NULL, "Error Source is not (null), got %s.\n", wine_dbgstr_w(str)); + hr = IScriptError_get_Description(error, &str); + ok(hr == S_OK, "IScriptError_get_Description failed: 0x%08x.\n", hr); + ok(str == NULL, "Error Description is not (null), got %s.\n", wine_dbgstr_w(str));
str = SysAllocString(L"jscript"); hr = IScriptControl_put_Language(sc, str); @@ -3361,6 +3364,10 @@ static void test_IScriptControl_get_Error(void) ok(hr == S_OK, "IScriptError_get_Source failed: 0x%08x.\n", hr); ok(str != NULL, "Error Source is (null).\n"); SysFreeString(str); + hr = IScriptError_get_Description(error, &str); + ok(hr == S_OK, "IScriptError_get_Description failed: 0x%08x.\n", hr); + ok(str != NULL, "Error Description is (null).\n"); + SysFreeString(str);
hr = IScriptError_Clear(error); ok(hr == S_OK, "IScriptError_Clear failed: 0x%08x.\n", hr); @@ -3371,6 +3378,9 @@ static void test_IScriptControl_get_Error(void) hr = IScriptError_get_Source(error, &str); ok(hr == S_OK, "IScriptError_get_Source failed: 0x%08x.\n", hr); ok(str == NULL, "Error Source is not (null), got %s.\n", wine_dbgstr_w(str)); + hr = IScriptError_get_Description(error, &str); + ok(hr == S_OK, "IScriptError_get_Description failed: 0x%08x.\n", hr); + ok(str == NULL, "Error Description is not (null), got %s.\n", wine_dbgstr_w(str));
hr = IScriptControl_get_Error(sc, &error2); ok(hr == S_OK, "IScriptControl_get_Error failed: 0x%08x.\n", hr); @@ -3424,6 +3434,9 @@ static void test_IScriptControl_get_Error(void) hr = IScriptError_get_Source(error, &str); ok(hr == S_OK, "IScriptError_get_Source failed: 0x%08x.\n", hr); ok(str == NULL, "Error Source is not (null), got %s.\n", wine_dbgstr_w(str)); + hr = IScriptError_get_Description(error, &str); + ok(hr == S_OK, "IScriptError_get_Description failed: 0x%08x.\n", hr); + ok(str == NULL, "Error Description is not (null), got %s.\n", wine_dbgstr_w(str));
SET_EXPECT(GetSourceLineText); hr = IScriptError_get_Text(error, &str); @@ -3456,8 +3469,9 @@ static void test_IScriptControl_get_Error(void) ok(!lstrcmpW(str, L"foobar"), "Error Source is wrong, got %s.\n", wine_dbgstr_w(str)); SysFreeString(str); hr = IScriptError_get_Description(error, &str); - todo_wine ok(hr == S_OK, "IScriptError_get_Description failed: 0x%08x.\n", hr); - if (SUCCEEDED(hr)) SysFreeString(str); + ok(hr == S_OK, "IScriptError_get_Description failed: 0x%08x.\n", hr); + ok(!lstrcmpW(str, L"barfoo"), "Error Description is wrong, got %s.\n", wine_dbgstr_w(str)); + SysFreeString(str);
SET_EXPECT(GetSourceLineText); hr = IScriptError_get_Text(error, &str); @@ -3490,8 +3504,8 @@ static void test_IScriptControl_get_Error(void) ok(!lstrcmpW(str, L"source"), "Error Source is wrong, got %s.\n", wine_dbgstr_w(str)); SysFreeString(str); hr = IScriptError_get_Description(error, &str); - todo_wine ok(hr == S_OK, "IScriptError_get_Description failed: 0x%08x.\n", hr); - if (SUCCEEDED(hr)) SysFreeString(str); + ok(hr == S_OK, "IScriptError_get_Description failed: 0x%08x.\n", hr); + ok(str == NULL, "Error Description is not (null), got %s.\n", wine_dbgstr_w(str));
SET_EXPECT(GetSourceLineText); hr = IScriptError_get_Text(error, &str);