{
httprequest req;
IServerXMLHTTPRequest IServerXMLHTTPRequest_iface;
- LONG ref;
} serverhttp;
static inline httprequest *impl_from_IXMLHTTPRequest( IXMLHTTPRequest *iface )
httprequest_ObjectWithSite_QueryInterface( IObjectWithSite* iface, REFIID riid, void** ppvObject )
{
httprequest *This = impl_from_IObjectWithSite(iface);
- return IXMLHTTPRequest_QueryInterface( (IXMLHTTPRequest *)This, riid, ppvObject );
+ return IXMLHTTPRequest_QueryInterface(&This->IXMLHTTPRequest_iface, riid, ppvObject);
}
static ULONG WINAPI httprequest_ObjectWithSite_AddRef( IObjectWithSite* iface )
{
httprequest *This = impl_from_IObjectWithSite(iface);
- return IXMLHTTPRequest_AddRef((IXMLHTTPRequest *)This);
+ return IXMLHTTPRequest_AddRef(&This->IXMLHTTPRequest_iface);
}
static ULONG WINAPI httprequest_ObjectWithSite_Release( IObjectWithSite* iface )
{
httprequest *This = impl_from_IObjectWithSite(iface);
- return IXMLHTTPRequest_Release((IXMLHTTPRequest *)This);
+ return IXMLHTTPRequest_Release(&This->IXMLHTTPRequest_iface);
}
static HRESULT WINAPI httprequest_ObjectWithSite_GetSite( IObjectWithSite *iface, REFIID iid, void **ppvSite )
static HRESULT WINAPI httprequest_Safety_QueryInterface(IObjectSafety *iface, REFIID riid, void **ppv)
{
httprequest *This = impl_from_IObjectSafety(iface);
- return IXMLHTTPRequest_QueryInterface( (IXMLHTTPRequest *)This, riid, ppv );
+ return IXMLHTTPRequest_QueryInterface(&This->IXMLHTTPRequest_iface, riid, ppv);
}
static ULONG WINAPI httprequest_Safety_AddRef(IObjectSafety *iface)
{
httprequest *This = impl_from_IObjectSafety(iface);
- return IXMLHTTPRequest_AddRef((IXMLHTTPRequest *)This);
+ return IXMLHTTPRequest_AddRef(&This->IXMLHTTPRequest_iface);
}
static ULONG WINAPI httprequest_Safety_Release(IObjectSafety *iface)
{
httprequest *This = impl_from_IObjectSafety(iface);
- return IXMLHTTPRequest_Release((IXMLHTTPRequest *)This);
+ return IXMLHTTPRequest_Release(&This->IXMLHTTPRequest_iface);
}
static HRESULT WINAPI httprequest_Safety_GetInterfaceSafetyOptions(IObjectSafety *iface, REFIID riid,
static ULONG WINAPI ServerXMLHTTPRequest_AddRef(IServerXMLHTTPRequest *iface)
{
serverhttp *This = impl_from_IServerXMLHTTPRequest( iface );
- ULONG ref = InterlockedIncrement( &This->ref );
+ ULONG ref = InterlockedIncrement( &This->req.ref );
TRACE("(%p)->(%u)\n", This, ref );
return ref;
}
static ULONG WINAPI ServerXMLHTTPRequest_Release(IServerXMLHTTPRequest *iface)
{
serverhttp *This = impl_from_IServerXMLHTTPRequest( iface );
- ULONG ref = InterlockedDecrement( &This->ref );
+ ULONG ref = InterlockedDecrement( &This->req.ref );
TRACE("(%p)->(%u)\n", This, ref );
init_httprequest(&req->req);
req->IServerXMLHTTPRequest_iface.lpVtbl = &ServerXMLHTTPRequestVtbl;
- req->ref = 1;
*obj = &req->IServerXMLHTTPRequest_iface;
IUnknown_QueryInterface(V_UNKNOWN(&var), &IID_IXMLDOMNode, (void**)&domnode);
if (domnode)
- doc = xmlNodePtr_from_domnode(domnode, XML_DOCUMENT_NODE)->doc;
+ {
+ DOMNodeType type;
+
+ IXMLDOMNode_get_nodeType(domnode, &type);
+ switch (type)
+ {
+ case NODE_ELEMENT:
+ {
+ IXMLDOMDocument *domdoc;
+ VARIANT_BOOL b;
+ BSTR xml;
+
+ IXMLDOMNode_get_xml(domnode, &xml);
+ DOMDocument_create(This->version, (void**)&domdoc);
+ IXMLDOMDocument_loadXML(domdoc, xml, &b);
+ SysFreeString(xml);
+ doc = xmlNodePtr_from_domnode((IXMLDOMNode*)domdoc, XML_DOCUMENT_NODE)->doc;
+ break;
+ }
+ default:
+ doc = xmlNodePtr_from_domnode(domnode, XML_DOCUMENT_NODE)->doc;
+ break;
+ }
+ }
if (!doc)
{