msscript.ocx: Implement IScriptError::get_HelpFile.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Gabriel Ivăncescu 2020-08-24 17:56:16 +03:00 committed by Alexandre Julliard
parent 24d9f52fea
commit 79378814e4
2 changed files with 17 additions and 2 deletions

View file

@ -127,6 +127,7 @@ typedef struct {
HRESULT number;
BSTR source;
BSTR desc;
BSTR help_file;
BOOLEAN info_filled;
} ScriptError;
@ -2134,6 +2135,7 @@ static void fill_error_info(ScriptError *error)
error->number = info.scode;
error->source = info.bstrSource;
error->desc = info.bstrDescription;
error->help_file = info.bstrHelpFile;
}
static HRESULT WINAPI ScriptError_QueryInterface(IScriptError *iface, REFIID riid, void **ppv)
@ -2280,9 +2282,11 @@ static HRESULT WINAPI ScriptError_get_HelpFile(IScriptError *iface, BSTR *pbstrH
{
ScriptError *This = impl_from_IScriptError(iface);
FIXME("(%p)->(%p)\n", This, pbstrHelpFile);
TRACE("(%p)->(%p)\n", This, pbstrHelpFile);
return E_NOTIMPL;
fill_error_info(This);
*pbstrHelpFile = SysAllocString(This->help_file);
return S_OK;
}
static HRESULT WINAPI ScriptError_get_HelpContext(IScriptError *iface, LONG *plHelpContext)
@ -2334,10 +2338,12 @@ static HRESULT WINAPI ScriptError_Clear(IScriptError *iface)
}
SysFreeString(This->source);
SysFreeString(This->desc);
SysFreeString(This->help_file);
This->number = 0;
This->source = NULL;
This->desc = NULL;
This->help_file = NULL;
This->info_filled = FALSE;
return S_OK;

View file

@ -3342,6 +3342,9 @@ static void test_IScriptControl_get_Error(void)
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 = 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));
str = SysAllocString(L"jscript");
hr = IScriptControl_put_Language(sc, str);
@ -3381,6 +3384,9 @@ static void test_IScriptControl_get_Error(void)
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 = 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 = IScriptControl_get_Error(sc, &error2);
ok(hr == S_OK, "IScriptControl_get_Error failed: 0x%08x.\n", hr);
@ -3437,6 +3443,9 @@ static void test_IScriptControl_get_Error(void)
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 = 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));
SET_EXPECT(GetSourceLineText);
hr = IScriptError_get_Text(error, &str);