msxml3: Implment IXMLParser SetInput
Alistair Leslie-Hughes
leslie_alistair at hotmail.com
Fri Mar 15 02:49:32 CDT 2013
Hi,
Changelog:
msxml3: Implment IXMLParser SetInput
Best Regards
Alistair Leslie-Hughes
-------------- next part --------------
>From 88255b17a0256a55de1e2e41cd2a6a08c2011c58 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date: Fri, 15 Mar 2013 16:16:02 +1100
Subject: [PATCH] Implment IXMLParser SetInput
To: wine-patches <wine-patches at winehq.org>
---
dlls/msxml3/tests/xmlparser.c | 3 +++
dlls/msxml3/xmlparser.c | 18 ++++++++++++++++--
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/dlls/msxml3/tests/xmlparser.c b/dlls/msxml3/tests/xmlparser.c
index 46812c8..51f2a27 100644
--- a/dlls/msxml3/tests/xmlparser.c
+++ b/dlls/msxml3/tests/xmlparser.c
@@ -135,6 +135,9 @@ static void create_test(void)
ok(hr == S_OK, "Expected S_OK got 0x%08x\n", hr);
ok(nodefactory == &thenodefactory, "expected NULL\n");
+ hr = IXMLParser_SetInput(parser, NULL);
+ ok(hr == E_INVALIDARG, "Expected S_OK got 0x%08x\n", hr);
+
hr = IXMLParser_SetFactory(parser, NULL);
ok(hr == S_OK, "Expected S_OK got 0x%08x\n", hr);
diff --git a/dlls/msxml3/xmlparser.c b/dlls/msxml3/xmlparser.c
index 154e439..4c91a1e 100644
--- a/dlls/msxml3/xmlparser.c
+++ b/dlls/msxml3/xmlparser.c
@@ -47,6 +47,7 @@ typedef struct _xmlparser
{
IXMLParser IXMLParser_iface;
IXMLNodeFactory *nodefactory;
+ IUnknown *input;
LONG ref;
int flags;
@@ -96,6 +97,9 @@ static ULONG WINAPI xmlparser_Release(IXMLParser* iface)
TRACE("(%p)->(%d)\n", This, ref);
if ( ref == 0 )
{
+ if(This->input)
+ IUnknown_Release(This->input);
+
if(This->nodefactory)
IXMLNodeFactory_Release(This->nodefactory);
@@ -246,9 +250,18 @@ static HRESULT WINAPI xmlparser_SetInput(IXMLParser *iface, IUnknown *pStm)
{
xmlparser *This = impl_from_IXMLParser( iface );
- FIXME("(%p %p)\n", This, pStm);
+ TRACE("(%p %p)\n", This, pStm);
- return E_NOTIMPL;
+ if(!pStm)
+ return E_INVALIDARG;
+
+ if(This->input)
+ IUnknown_Release(This->input);
+
+ This->input = pStm;
+ IUnknown_AddRef(This->input);
+
+ return S_OK;
}
static HRESULT WINAPI xmlparser_PushData(IXMLParser *iface, const char *pData,
@@ -435,6 +448,7 @@ HRESULT XMLParser_create(IUnknown* pUnkOuter, void**ppObj)
This->IXMLParser_iface.lpVtbl = &xmlparser_vtbl;
This->nodefactory = NULL;
+ This->input = NULL;
This->flags = 0;
This->ref = 1;
--
1.7.10.4
More information about the wine-patches
mailing list