From 7bc6740a92d32e01c7e899f9e336753f5f3c8ce5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Mon, 24 Aug 2020 17:56:17 +0300 Subject: [PATCH] msscript.ocx: Implement IScriptError::get_HelpContext. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/msscript.ocx/msscript.c | 9 +++++++-- dlls/msscript.ocx/tests/msscript.c | 9 +++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/dlls/msscript.ocx/msscript.c b/dlls/msscript.ocx/msscript.c index dcea9674c9b..05e6121a589 100644 --- a/dlls/msscript.ocx/msscript.c +++ b/dlls/msscript.ocx/msscript.c @@ -128,6 +128,7 @@ typedef struct { BSTR source; BSTR desc; BSTR help_file; + DWORD help_context; BOOLEAN info_filled; } ScriptError; @@ -2136,6 +2137,7 @@ static void fill_error_info(ScriptError *error) error->source = info.bstrSource; error->desc = info.bstrDescription; error->help_file = info.bstrHelpFile; + error->help_context = info.dwHelpContext; } static HRESULT WINAPI ScriptError_QueryInterface(IScriptError *iface, REFIID riid, void **ppv) @@ -2293,9 +2295,11 @@ static HRESULT WINAPI ScriptError_get_HelpContext(IScriptError *iface, LONG *plH { ScriptError *This = impl_from_IScriptError(iface); - FIXME("(%p)->(%p)\n", This, plHelpContext); + TRACE("(%p)->(%p)\n", This, plHelpContext); - return E_NOTIMPL; + fill_error_info(This); + *plHelpContext = This->help_context; + return S_OK; } static HRESULT WINAPI ScriptError_get_Text(IScriptError *iface, BSTR *pbstrText) @@ -2344,6 +2348,7 @@ static HRESULT WINAPI ScriptError_Clear(IScriptError *iface) This->source = NULL; This->desc = NULL; This->help_file = NULL; + This->help_context = 0; This->info_filled = FALSE; return S_OK; diff --git a/dlls/msscript.ocx/tests/msscript.c b/dlls/msscript.ocx/tests/msscript.c index aa0c31e73c2..702fbb167a0 100644 --- a/dlls/msscript.ocx/tests/msscript.c +++ b/dlls/msscript.ocx/tests/msscript.c @@ -3345,6 +3345,9 @@ static void test_IScriptControl_get_Error(void) hr = IScriptError_get_HelpFile(error, &str); ok(hr == S_OK, "IScriptError_get_HelpFile failed: 0x%08x.\n", hr); ok(str == NULL, "Error HelpFile is not (null), got %s.\n", wine_dbgstr_w(str)); + hr = IScriptError_get_HelpContext(error, &x); + ok(hr == S_OK, "IScriptError_get_HelpContext failed: 0x%08x.\n", hr); + ok(x == 0, "Error HelpContext is not 0, got %d.\n", x); str = SysAllocString(L"jscript"); hr = IScriptControl_put_Language(sc, str); @@ -3387,6 +3390,9 @@ static void test_IScriptControl_get_Error(void) hr = IScriptError_get_HelpFile(error, &str); ok(hr == S_OK, "IScriptError_get_HelpFile failed: 0x%08x.\n", hr); ok(str == NULL, "Error HelpFile is not (null), got %s.\n", wine_dbgstr_w(str)); + hr = IScriptError_get_HelpContext(error, &x); + ok(hr == S_OK, "IScriptError_get_HelpContext failed: 0x%08x.\n", hr); + ok(x == 0, "Error HelpContext is not 0, got %d.\n", x); hr = IScriptControl_get_Error(sc, &error2); ok(hr == S_OK, "IScriptControl_get_Error failed: 0x%08x.\n", hr); @@ -3446,6 +3452,9 @@ static void test_IScriptControl_get_Error(void) hr = IScriptError_get_HelpFile(error, &str); ok(hr == S_OK, "IScriptError_get_HelpFile failed: 0x%08x.\n", hr); ok(str == NULL, "Error HelpFile is not (null), got %s.\n", wine_dbgstr_w(str)); + hr = IScriptError_get_HelpContext(error, &x); + ok(hr == S_OK, "IScriptError_get_HelpContext failed: 0x%08x.\n", hr); + ok(x == 0, "Error HelpContext is not 0, got %d.\n", x); SET_EXPECT(GetSourceLineText); hr = IScriptError_get_Text(error, &str);