Commit 524a8171 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

msxml3: Implement IXMLParser Get/Set Flags.

parent e65b19ca
...@@ -80,6 +80,7 @@ dlls/msi/sql.tab.c ...@@ -80,6 +80,7 @@ dlls/msi/sql.tab.c
dlls/msi/sql.tab.h dlls/msi/sql.tab.h
dlls/mstask/mstask_local.h dlls/mstask/mstask_local.h
dlls/mstask/mstask_local_i.c dlls/mstask/mstask_local_i.c
dlls/msxml3/tests/xmlparser.h
dlls/msxml3/xmlparser.h dlls/msxml3/xmlparser.h
dlls/msxml3/xslpattern.tab.c dlls/msxml3/xslpattern.tab.c
dlls/msxml3/xslpattern.tab.h dlls/msxml3/xslpattern.tab.h
......
...@@ -9,6 +9,8 @@ C_SRCS = \ ...@@ -9,6 +9,8 @@ C_SRCS = \
xmlparser.c \ xmlparser.c \
xmlview.c xmlview.c
IDL_H_SRCS = xmlparser.idl
RC_SRCS = rsrc.rc RC_SRCS = rsrc.rc
@MAKE_TEST_RULES@ @MAKE_TEST_RULES@
...@@ -25,17 +25,14 @@ ...@@ -25,17 +25,14 @@
#include "windows.h" #include "windows.h"
#include "ole2.h" #include "ole2.h"
#include "initguid.h" #include "xmlparser.h"
#include "wine/test.h" #include "wine/test.h"
DEFINE_GUID(IID_IXMLParser, 0xd242361e, 0x51a0, 0x11d2, 0x9c,0xaf, 0x00,0x60,0xb0,0xec,0x3d,0x39);
DEFINE_GUID(CLSID_XMLParser30, 0xf5078f31, 0xc551, 0x11d3, 0x89,0xb9, 0x00,0x00,0xf8,0x1f,0xe2,0x21);
static void create_test(void) static void create_test(void)
{ {
HRESULT hr; HRESULT hr;
IUnknown *parser; IXMLParser *parser;
DWORD flags;
hr = CoCreateInstance(&CLSID_XMLParser30, NULL, CLSCTX_INPROC_SERVER, &IID_IXMLParser, (void**)&parser); hr = CoCreateInstance(&CLSID_XMLParser30, NULL, CLSCTX_INPROC_SERVER, &IID_IXMLParser, (void**)&parser);
if (FAILED(hr)) if (FAILED(hr))
...@@ -44,7 +41,19 @@ static void create_test(void) ...@@ -44,7 +41,19 @@ static void create_test(void)
return; return;
} }
IUnknown_Release(parser); flags = IXMLParser_GetFlags(parser);
ok(flags == 0, "Expected 0 got %d\n", flags);
hr = IXMLParser_SetFlags(parser, XMLFLAG_SAX);
ok(hr == S_OK, "Expected S_OK got 0x%08x\n", hr);
flags = IXMLParser_GetFlags(parser);
ok(flags == XMLFLAG_SAX, "Expected 0 got %d\n", flags);
hr = IXMLParser_SetFlags(parser, 0);
ok(hr == S_OK, "Expected S_OK got 0x%08x\n", hr);
IXMLParser_Release(parser);
} }
START_TEST(xmlparser) START_TEST(xmlparser)
......
...@@ -29,11 +29,10 @@ ...@@ -29,11 +29,10 @@
#include "perhist.h" #include "perhist.h"
#include "docobj.h" #include "docobj.h"
#include "urlmon.h" #include "urlmon.h"
#include "xmlparser.h"
#include "wine/test.h" #include "wine/test.h"
DEFINE_GUID(CLSID_XMLView, 0x48123bc4, 0x99d9, 0x11d1, 0xa6,0xb3, 0x00,0xc0,0x4f,0xd9,0x15,0x55);
HRESULT (WINAPI *pCreateURLMoniker)(IMoniker*, LPCWSTR, IMoniker**); HRESULT (WINAPI *pCreateURLMoniker)(IMoniker*, LPCWSTR, IMoniker**);
static const char xmlview_html[] = static const char xmlview_html[] =
......
...@@ -47,6 +47,8 @@ typedef struct _xmlparser ...@@ -47,6 +47,8 @@ typedef struct _xmlparser
{ {
IXMLParser IXMLParser_iface; IXMLParser IXMLParser_iface;
LONG ref; LONG ref;
int flags;
} xmlparser; } xmlparser;
static inline xmlparser *impl_from_IXMLParser( IXMLParser *iface ) static inline xmlparser *impl_from_IXMLParser( IXMLParser *iface )
...@@ -186,9 +188,9 @@ static ULONG WINAPI xmlparser_GetFlags(IXMLParser *iface) ...@@ -186,9 +188,9 @@ static ULONG WINAPI xmlparser_GetFlags(IXMLParser *iface)
{ {
xmlparser *This = impl_from_IXMLParser( iface ); xmlparser *This = impl_from_IXMLParser( iface );
FIXME("(%p)\n", This); TRACE("(%p)\n", This);
return 0; return This->flags;
} }
static HRESULT WINAPI xmlparser_GetURL(IXMLParser *iface, const WCHAR **ppBuf) static HRESULT WINAPI xmlparser_GetURL(IXMLParser *iface, const WCHAR **ppBuf)
...@@ -338,9 +340,11 @@ static HRESULT WINAPI xmlparser_SetFlags(IXMLParser *iface, ULONG flags) ...@@ -338,9 +340,11 @@ static HRESULT WINAPI xmlparser_SetFlags(IXMLParser *iface, ULONG flags)
{ {
xmlparser *This = impl_from_IXMLParser( iface ); xmlparser *This = impl_from_IXMLParser( iface );
FIXME("(%p %d)\n", This, flags); TRACE("(%p %d)\n", This, flags);
return E_NOTIMPL; This->flags = flags;
return S_OK;
} }
static HRESULT WINAPI xmlparser_SetSecureBaseURL(IXMLParser *iface, const WCHAR *baseUrl) static HRESULT WINAPI xmlparser_SetSecureBaseURL(IXMLParser *iface, const WCHAR *baseUrl)
...@@ -411,6 +415,7 @@ HRESULT XMLParser_create(IUnknown* pUnkOuter, void**ppObj) ...@@ -411,6 +415,7 @@ HRESULT XMLParser_create(IUnknown* pUnkOuter, void**ppObj)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
This->IXMLParser_iface.lpVtbl = &xmlparser_vtbl; This->IXMLParser_iface.lpVtbl = &xmlparser_vtbl;
This->flags = 0;
This->ref = 1; This->ref = 1;
*ppObj = &This->IXMLParser_iface; *ppObj = &This->IXMLParser_iface;
......
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