mshtml: Store IMoniker in BSCallback.

This commit is contained in:
Jacek Caban 2006-08-09 16:37:48 +02:00 committed by Alexandre Julliard
parent f0ca85f78e
commit aa760c8b1e
3 changed files with 20 additions and 9 deletions

View File

@ -172,6 +172,8 @@ struct BSCallback {
nsIStreamListener *nslistener; nsIStreamListener *nslistener;
nsISupports *nscontext; nsISupports *nscontext;
IMoniker *mon;
nsProtocolStream *nsstream; nsProtocolStream *nsstream;
}; };
@ -308,8 +310,9 @@ void nsAString_Finish(nsAString*);
nsIInputStream *create_nsstream(const char*,PRInt32); nsIInputStream *create_nsstream(const char*,PRInt32);
BSCallback *create_bscallback(HTMLDocument*,LPCOLESTR); BSCallback *create_bscallback(HTMLDocument*,IMoniker*);
HRESULT start_binding(BSCallback*,IMoniker*); HRESULT start_binding(BSCallback*);
void create_hidden_hwnd(HTMLDocument*);
IHlink *Hlink_Create(void); IHlink *Hlink_Create(void);
IHTMLSelectionObject *HTMLSelectionObject_Create(nsISelection*); IHTMLSelectionObject *HTMLSelectionObject_Create(nsISelection*);

View File

@ -131,7 +131,7 @@ static nsresult NSAPI nsInputStream_ReadSegments(nsIInputStream *iface,
PRUint32 written = 0; PRUint32 written = 0;
nsresult nsres; nsresult nsres;
FIXME("(%p)->(%p %p %ld %p)\n", This, aWriter, aClousure, aCount, _retval); TRACE("(%p)->(%p %p %ld %p)\n", This, aWriter, aClousure, aCount, _retval);
if(!This->buf_size) if(!This->buf_size)
return S_OK; return S_OK;
@ -246,6 +246,8 @@ static ULONG WINAPI BindStatusCallback_Release(IBindStatusCallback *iface)
nsISupports_Release(This->nscontext); nsISupports_Release(This->nscontext);
if(This->nsstream) if(This->nsstream)
nsIInputStream_Release(NSINSTREAM(This->nsstream)); nsIInputStream_Release(NSINSTREAM(This->nsstream));
if(This->mon)
IMoniker_Release(This->mon);
mshtml_free(This->headers); mshtml_free(This->headers);
mshtml_free(This); mshtml_free(This);
} }
@ -564,7 +566,7 @@ static const IServiceProviderVtbl ServiceProviderVtbl = {
BSCServiceProvider_QueryService BSCServiceProvider_QueryService
}; };
BSCallback *create_bscallback(HTMLDocument *doc, LPCOLESTR url) BSCallback *create_bscallback(HTMLDocument *doc, IMoniker *mon)
{ {
BSCallback *ret = mshtml_alloc(sizeof(BSCallback)); BSCallback *ret = mshtml_alloc(sizeof(BSCallback));
@ -582,6 +584,10 @@ BSCallback *create_bscallback(HTMLDocument *doc, LPCOLESTR url)
ret->nscontext = NULL; ret->nscontext = NULL;
ret->nsstream = NULL; ret->nsstream = NULL;
if(mon)
IMoniker_AddRef(mon);
ret->mon = mon;
return ret; return ret;
} }
@ -663,7 +669,7 @@ void hlink_frame_navigate(HTMLDocument *doc, IHlinkFrame *hlink_frame,
IMoniker *mon; IMoniker *mon;
IHlink *hlink; IHlink *hlink;
callback = create_bscallback(doc, uri); callback = create_bscallback(doc, NULL);
if(post_data_stream) { if(post_data_stream) {
parse_post_data(post_data_stream, &callback->headers, &callback->post_data, parse_post_data(post_data_stream, &callback->headers, &callback->post_data,
@ -692,7 +698,7 @@ void hlink_frame_navigate(HTMLDocument *doc, IHlinkFrame *hlink_frame,
} }
HRESULT start_binding(BSCallback *bscallback, IMoniker *mon) HRESULT start_binding(BSCallback *bscallback)
{ {
IStream *str = NULL; IStream *str = NULL;
IBindCtx *bctx; IBindCtx *bctx;
@ -704,7 +710,7 @@ HRESULT start_binding(BSCallback *bscallback, IMoniker *mon)
return hres; return hres;
} }
hres = IMoniker_BindToStorage(mon, bctx, NULL, &IID_IStream, (void**)&str); hres = IMoniker_BindToStorage(bscallback->mon, bctx, NULL, &IID_IStream, (void**)&str);
IBindCtx_Release(bctx); IBindCtx_Release(bctx);
if(FAILED(hres)) { if(FAILED(hres)) {
WARN("BindToStorage failed: %08lx\n", hres); WARN("BindToStorage failed: %08lx\n", hres);
@ -714,5 +720,7 @@ HRESULT start_binding(BSCallback *bscallback, IMoniker *mon)
if(str) if(str)
IStream_Release(str); IStream_Release(str);
IMoniker_Release(bscallback->mon);
bscallback->mon = NULL;
return S_OK; return S_OK;
} }

View File

@ -215,7 +215,7 @@ static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAva
} }
} }
bscallback = create_bscallback(This, url); bscallback = create_bscallback(This, pimkName);
if(This->nscontainer) { if(This->nscontainer) {
nsIInputStream *post_data_stream = get_post_data_stream(pibc); nsIInputStream *post_data_stream = get_post_data_stream(pibc);
@ -249,7 +249,7 @@ static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAva
if(pibc) if(pibc)
FIXME("not supported pibc\n"); FIXME("not supported pibc\n");
hres = start_binding(bscallback, pimkName); hres = start_binding(bscallback);
IBindStatusCallback_Release(STATUSCLB(bscallback)); IBindStatusCallback_Release(STATUSCLB(bscallback));
CoTaskMemFree(url); CoTaskMemFree(url);