Alistair Leslie-Hughes : msxml3: Implment IXMLParser SetInput.

Alexandre Julliard julliard at winehq.org
Fri Mar 15 11:51:34 CDT 2013


Module: wine
Branch: master
Commit: 6f2f577fa5c77ddd8f1790ee142c92ec1c460967
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6f2f577fa5c77ddd8f1790ee142c92ec1c460967

Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date:   Fri Mar 15 16:16:02 2013 +1100

msxml3: Implment IXMLParser SetInput.

---

 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;
 




More information about the wine-cvs mailing list