[PATCH 3/3] Store class version for MXWriter instance

Nikolay Sivov nsivov at codeweavers.com
Wed Aug 24 07:06:58 CDT 2011


---
 dlls/msxml3/factory.c       |   10 +++++++---
 dlls/msxml3/msxml_private.h |    2 +-
 dlls/msxml3/mxwriter.c      |    6 ++++--
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/dlls/msxml3/factory.c b/dlls/msxml3/factory.c
index 2d8855d..2d1a42f 100644
--- a/dlls/msxml3/factory.c
+++ b/dlls/msxml3/factory.c
@@ -75,7 +75,12 @@ static const struct clsid_version_t clsid_versions_table[] =
     { &CLSID_XMLSchemaCache26, MSXML_DEFAULT },
     { &CLSID_XMLSchemaCache30, MSXML3 },
     { &CLSID_XMLSchemaCache40, MSXML4 },
-    { &CLSID_XMLSchemaCache60, MSXML6 }
+    { &CLSID_XMLSchemaCache60, MSXML6 },
+
+    { &CLSID_MXXMLWriter,   MSXML_DEFAULT },
+    { &CLSID_MXXMLWriter30, MSXML3 },
+    { &CLSID_MXXMLWriter40, MSXML4 },
+    { &CLSID_MXXMLWriter60, MSXML6 }
 };
 
 static MSXML_VERSION get_msxml_version(const GUID *clsid)
@@ -264,7 +269,6 @@ static ClassFactory xmldoccf = { { &ClassFactoryVtbl }, XMLDocument_create };
 static ClassFactory saxreadcf = { { &ClassFactoryVtbl }, SAXXMLReader_create };
 static ClassFactory httpreqcf = { { &ClassFactoryVtbl }, XMLHTTPRequest_create };
 static ClassFactory xsltemplatecf = { { &ClassFactoryVtbl }, XSLTemplate_create };
-static ClassFactory mxwritercf = { { &ClassFactoryVtbl }, MXWriter_create };
 static ClassFactory mxnsmanagercf = { {&ClassFactoryVtbl }, MXNamespaceManager_create };
 
 /******************************************************************
@@ -335,7 +339,7 @@ HRESULT WINAPI DllGetClassObject( REFCLSID rclsid, REFIID riid, void **ppv )
              IsEqualCLSID( rclsid, &CLSID_MXXMLWriter40 ) ||
              IsEqualCLSID( rclsid, &CLSID_MXXMLWriter60 ) )
     {
-        cf = &mxwritercf.IClassFactory_iface;
+        return DOMClassFactory_Create(rclsid, riid, ppv, MXWriter_create);
     }
     else if( IsEqualCLSID( rclsid, &CLSID_MXNamespaceManager ) ||
              IsEqualCLSID( rclsid, &CLSID_MXNamespaceManager40 ) ||
diff --git a/dlls/msxml3/msxml_private.h b/dlls/msxml3/msxml_private.h
index a1fdf01..e7f82ea 100644
--- a/dlls/msxml3/msxml_private.h
+++ b/dlls/msxml3/msxml_private.h
@@ -435,7 +435,7 @@ extern HRESULT XMLDocument_create(IUnknown*, void**) DECLSPEC_HIDDEN;
 extern HRESULT SAXXMLReader_create(IUnknown*, void**) DECLSPEC_HIDDEN;
 extern HRESULT XMLHTTPRequest_create(IUnknown*, void **) DECLSPEC_HIDDEN;
 extern HRESULT XSLTemplate_create(IUnknown*, void**) DECLSPEC_HIDDEN;
-extern HRESULT MXWriter_create(IUnknown*,void**) DECLSPEC_HIDDEN;
+extern HRESULT MXWriter_create(MSXML_VERSION, IUnknown*, void**) DECLSPEC_HIDDEN;
 extern HRESULT MXNamespaceManager_create(IUnknown*,void**) DECLSPEC_HIDDEN;
 
 static inline const CLSID* DOMDocument_version(MSXML_VERSION v)
diff --git a/dlls/msxml3/mxwriter.c b/dlls/msxml3/mxwriter.c
index 54b7758..60ac35f 100644
--- a/dlls/msxml3/mxwriter.c
+++ b/dlls/msxml3/mxwriter.c
@@ -62,6 +62,7 @@ typedef struct _mxwriter
     ISAXContentHandler ISAXContentHandler_iface;
 
     LONG ref;
+    MSXML_VERSION class_version;
 
     VARIANT_BOOL props[MXWriter_LastProp];
     BOOL prop_changed;
@@ -881,7 +882,7 @@ static const struct ISAXContentHandlerVtbl mxwriter_saxcontent_vtbl =
     mxwriter_saxcontent_skippedEntity
 };
 
-HRESULT MXWriter_create(IUnknown *pUnkOuter, void **ppObj)
+HRESULT MXWriter_create(MSXML_VERSION version, IUnknown *pUnkOuter, void **ppObj)
 {
     static const WCHAR version10W[] = {'1','.','0',0};
     mxwriter *This;
@@ -897,6 +898,7 @@ HRESULT MXWriter_create(IUnknown *pUnkOuter, void **ppObj)
     This->IMXWriter_iface.lpVtbl = &mxwriter_vtbl;
     This->ISAXContentHandler_iface.lpVtbl = &mxwriter_saxcontent_vtbl;
     This->ref = 1;
+    This->class_version = version;
 
     This->props[MXWriter_BOM] = VARIANT_TRUE;
     This->props[MXWriter_DisableEscaping] = VARIANT_FALSE;
@@ -921,7 +923,7 @@ HRESULT MXWriter_create(IUnknown *pUnkOuter, void **ppObj)
 
 #else
 
-HRESULT MXWriter_create(IUnknown *pUnkOuter, void **obj)
+HRESULT MXWriter_create(MSXML_VERSION version, IUnknown *pUnkOuter, void **obj)
 {
     MESSAGE("This program tried to use a MXXMLWriter object, but\n"
             "libxml2 support was not present at compile time.\n");
-- 
1.5.6.5



--------------040509060704000708080701--



More information about the wine-patches mailing list