static ULONG WINAPI httprequest_Release(IXMLHTTPRequest *iface) { httprequest *This = impl_from_IXMLHTTPRequest( iface ); ULONG ref = InterlockedDecrement( &This->ref ); TRACE("(%p)->(%u)\n", This, ref ); if ( ref == 0 ) { struct reqheader *header, *header2; SysFreeString(This->url); SysFreeString(This->user); SysFreeString(This->password); /* request headers */ LIST_FOR_EACH_ENTRY_SAFE(header, header2, &This->reqheaders, struct reqheader, entry) { list_remove(&header->entry); SysFreeString(header->header); SysFreeString(header->value); } /* detach callback object */ BindStatusCallback_Detach(This->bsc); if (This->sink) IDispatch_Release(This->sink); heap_free( This ); } return ref; }
static HRESULT WINAPI httprequest_abort(IXMLHTTPRequest *iface) { httprequest *This = impl_from_IXMLHTTPRequest( iface ); TRACE("(%p)\n", This); BindStatusCallback_Detach(This->bsc); This->bsc = NULL; httprequest_setreadystate(This, READYSTATE_UNINITIALIZED); return S_OK; }
static HRESULT WINAPI httprequest_send(IXMLHTTPRequest *iface, VARIANT body) { httprequest *This = impl_from_IXMLHTTPRequest( iface ); BindStatusCallback *bsc = NULL; HRESULT hr; TRACE("(%p)->(%s)\n", This, debugstr_variant(&body)); if (This->state != READYSTATE_LOADING) return E_FAIL; hr = BindStatusCallback_create(This, &bsc, &body); if (FAILED(hr)) return hr; BindStatusCallback_Detach(This->bsc); This->bsc = bsc; return hr; }