Commit 91c4b4c9 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msxml3: Accept disabled on load validation.

parent 42bd2051
......@@ -93,6 +93,8 @@ typedef struct _schema_cache
MSXML_VERSION version;
xmlHashTablePtr cache;
LONG ref;
VARIANT_BOOL validateOnLoad;
} schema_cache;
typedef struct _cache_entry
......@@ -1285,6 +1287,11 @@ static HRESULT WINAPI schema_cache_put_validateOnLoad(IXMLDOMSchemaCollection2*
{
schema_cache* This = impl_from_IXMLDOMSchemaCollection2(iface);
FIXME("(%p)->(%d): stub\n", This, value);
This->validateOnLoad = value;
/* it's ok to disable it, cause we don't validate on load anyway */
if (value == VARIANT_FALSE) return S_OK;
return E_NOTIMPL;
}
......@@ -1292,8 +1299,12 @@ static HRESULT WINAPI schema_cache_get_validateOnLoad(IXMLDOMSchemaCollection2*
VARIANT_BOOL* value)
{
schema_cache* This = impl_from_IXMLDOMSchemaCollection2(iface);
FIXME("(%p)->(%p): stub\n", This, value);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, value);
if (!value) return E_POINTER;
*value = This->validateOnLoad;
return S_OK;
}
static HRESULT WINAPI schema_cache_getSchema(IXMLDOMSchemaCollection2* iface,
......@@ -1425,18 +1436,21 @@ XDR_DT SchemaCache_get_node_dt(IXMLDOMSchemaCollection2* iface, xmlNodePtr node)
return dt;
}
HRESULT SchemaCache_create(MSXML_VERSION version, IUnknown* pUnkOuter, void** ppObj)
HRESULT SchemaCache_create(MSXML_VERSION version, IUnknown* outer, void** obj)
{
schema_cache* This = heap_alloc(sizeof(schema_cache));
if (!This)
return E_OUTOFMEMORY;
TRACE("(%d %p %p)\n", version, outer, obj);
This->lpVtbl = &schema_cache_vtbl;
This->cache = xmlHashCreate(DEFAULT_HASHTABLE_SIZE);
This->ref = 1;
This->version = version;
This->validateOnLoad = VARIANT_TRUE;
*ppObj = &This->lpVtbl;
*obj = &This->lpVtbl;
return S_OK;
}
......
......@@ -31,6 +31,9 @@
#include "wine/test.h"
#define EXPECT_HR(hr,hr_exp) \
ok(hr == hr_exp, "got 0x%08x, expected 0x%08x\n", hr, hr_exp)
static const WCHAR xdr_schema_uri[] = {'x','-','s','c','h','e','m','a',':','t','e','s','t','.','x','m','l',0};
static const WCHAR xdr_schema_xml[] = {
......@@ -1973,6 +1976,26 @@ static void test_XDR_datatypes(void)
free_bstrs();
}
static void test_validate_on_load(void)
{
IXMLDOMSchemaCollection2 *cache;
VARIANT_BOOL b;
HRESULT hr;
cache = create_cache_version(40, &IID_IXMLDOMSchemaCollection2);
if (!cache) return;
hr = IXMLDOMSchemaCollection2_get_validateOnLoad(cache, NULL);
EXPECT_HR(hr, E_POINTER);
b = VARIANT_FALSE;
hr = IXMLDOMSchemaCollection2_get_validateOnLoad(cache, &b);
EXPECT_HR(hr, S_OK);
ok(b == VARIANT_TRUE, "got %d\n", b);
IXMLDOMSchemaCollection2_Release(cache);
}
START_TEST(schema)
{
HRESULT r;
......@@ -1986,6 +2009,7 @@ START_TEST(schema)
test_collection_content();
test_XDR_schemas();
test_XDR_datatypes();
test_validate_on_load();
CoUninitialize();
}
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