Commit 927ba076 authored by Stefan Huehner's avatar Stefan Huehner Committed by Alexandre Julliard

Fix IXMLDOMDocument error handling.

parent 0518c164
......@@ -727,8 +727,10 @@ static HRESULT WINAPI domdoc_load(
return S_FALSE;
xmldoc = doread( filename );
if ( !xmldoc )
if ( !xmldoc ) {
*isSuccessful = VARIANT_FALSE;
return S_FALSE;
}
This->node = create_node( (xmlNodePtr) xmldoc );
if ( !This->node )
......
......@@ -61,6 +61,10 @@ static const WCHAR szComplete4[] = {
'f','n','2','.','t','x','t','<','/','p','r','>',
'<','/','l','c','>','\n',0
};
static const WCHAR szNonExistentFile[] = {
'c', ':', '\\', 'N', 'o', 'n', 'e', 'x', 'i', 's', 't', 'e', 'n', 't', '.', 'x', 'm', 'l', 0
};
static const WCHAR szOpen[] = { 'o','p','e','n',0 };
static const WCHAR szdl[] = { 'd','l',0 };
static const WCHAR szlc[] = { 'l','c',0 };
......@@ -77,6 +81,7 @@ void test_domdoc( void )
IXMLDOMDocument *doc = NULL;
IXMLDOMElement *element = NULL;
VARIANT_BOOL b;
VARIANT var;
BSTR str;
r = CoCreateInstance( &CLSID_DOMDocument, NULL,
......@@ -93,6 +98,18 @@ void test_domdoc( void )
ok( r == S_FALSE, "loadXML failed\n");
ok( b == VARIANT_FALSE, "failed to load XML string\n");
/* try to laod an document from an non-existent file */
b = VARIANT_TRUE;
str = SysAllocString ( szNonExistentFile );
VariantInit(&var);
V_VT(&var) = VT_BSTR;
V_BSTR(&var) = str;
r = IXMLDOMDocument_load( doc, var, &b);
ok( r == S_FALSE, "load (from file) failed\n");
ok( b == VARIANT_FALSE, "failed to load XML file\n");
SysFreeString( str );
/* try load an empty document */
b = VARIANT_TRUE;
str = SysAllocString( szEmpty );
......
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