Commit 5ae224de authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added support for sending BSTR over IHTMLXMLHttpRequst::send.

parent 80893bcf
......@@ -524,22 +524,37 @@ static HRESULT WINAPI HTMLXMLHttpRequest_open(IHTMLXMLHttpRequest *iface, BSTR b
static HRESULT WINAPI HTMLXMLHttpRequest_send(IHTMLXMLHttpRequest *iface, VARIANT varBody)
{
HTMLXMLHttpRequest *This = impl_from_IHTMLXMLHttpRequest(iface);
nsresult nsres;
nsIWritableVariant *nsbody = NULL;
nsresult nsres = NS_OK;
TRACE("(%p)->(%s)\n", This, debugstr_variant(&varBody));
switch(V_VT(&varBody)) {
case VT_NULL:
case VT_EMPTY:
case VT_ERROR:
break;
default:
FIXME("varBody(%s) unsupported\n", debugstr_variant(&varBody));
return E_FAIL;
}
case VT_NULL:
case VT_EMPTY:
case VT_ERROR:
break;
case VT_BSTR: {
nsAString nsstr;
nsbody = create_nsvariant();
if(!nsbody)
return E_OUTOFMEMORY;
nsres = nsIXMLHttpRequest_Send(This->nsxhr, NULL);
nsAString_InitDepend(&nsstr, V_BSTR(&varBody));
nsres = nsIWritableVariant_SetAsAString(nsbody, &nsstr);
nsAString_Finish(&nsstr);
break;
}
default:
FIXME("unsupported body type %s\n", debugstr_variant(&varBody));
return E_NOTIMPL;
}
if(NS_SUCCEEDED(nsres))
nsres = nsIXMLHttpRequest_Send(This->nsxhr, (nsIVariant*)nsbody);
if(nsbody)
nsIWritableVariant_Release(nsbody);
if(NS_FAILED(nsres)) {
ERR("nsIXMLHttpRequest_Send failed: %08x\n", nsres);
return E_FAIL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment