[PATCH] Assign the IBindStatusCallback as soon as it created.

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Fri Feb 18 03:14:33 CST 2011


---
 dlls/msxml3/httprequest.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/dlls/msxml3/httprequest.c b/dlls/msxml3/httprequest.c
index a1b5834..382e508 100644
--- a/dlls/msxml3/httprequest.c
+++ b/dlls/msxml3/httprequest.c
@@ -426,7 +426,7 @@ static const IHttpNegotiateVtbl BSCHttpNegotiateVtbl = {
     BSCHttpNegotiate_OnResponse
 };
 
-static HRESULT BindStatusCallback_create(httprequest* This, BindStatusCallback **obj, const VARIANT *body)
+static HRESULT BindStatusCallback_create(httprequest* This, const VARIANT *body)
 {
     BindStatusCallback *bsc;
     IBindCtx *pbc;
@@ -451,6 +451,7 @@ static HRESULT BindStatusCallback_create(httprequest* This, BindStatusCallback *
     bsc->body = NULL;
 
     TRACE("created callback %p\n", bsc);
+    This->bsc = bsc;
 
     if (This->verb != BINDVERB_GET)
     {
@@ -497,7 +498,6 @@ static HRESULT BindStatusCallback_create(httprequest* This, BindStatusCallback *
         bsc = NULL;
     }
 
-    *obj = bsc;
     return hr;
 }
 
@@ -763,18 +763,16 @@ static HRESULT WINAPI httprequest_getAllResponseHeaders(IXMLHTTPRequest *iface,
 static HRESULT WINAPI httprequest_send(IXMLHTTPRequest *iface, VARIANT body)
 {
     httprequest *This = impl_from_IXMLHTTPRequest( iface );
-    BindStatusCallback *bsc = NULL;
     HRESULT hr;
 
     TRACE("(%p)\n", This);
 
     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;
+
+    hr = BindStatusCallback_create(This, &body);
+    if (FAILED(hr)) return hr;
 
     return hr;
 }
-- 
1.7.1


--------------000800050607060609020408--



More information about the wine-patches mailing list