From 283276d6eaab82c298f646623d4ee0adf2db8db9 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Wed, 24 Aug 2011 16:06:58 +0400 Subject: [PATCH] msxml3: Store class version for MXWriter instance. --- 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 2d8855d6759..2d1a42f8b19 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 a1fdf01945d..e7f82eac91f 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 54b7758218c..60ac35f0e3a 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");