msxml3: Store class version for MXWriter instance.

This commit is contained in:
Nikolay Sivov 2011-08-24 16:06:58 +04:00 committed by Alexandre Julliard
parent 4877da66b3
commit 283276d6ea
3 changed files with 12 additions and 6 deletions

View File

@ -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 ) ||

View File

@ -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)

View File

@ -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");