mshtml: Use QueryService to get IHttpNegotiate in get_post_data_stream.
This commit is contained in:
parent
ed11dbab6c
commit
c32cca8066
|
@ -90,8 +90,9 @@ static int fix_headers(char *buf, DWORD post_len)
|
||||||
static nsIInputStream *get_post_data_stream(IBindCtx *bctx)
|
static nsIInputStream *get_post_data_stream(IBindCtx *bctx)
|
||||||
{
|
{
|
||||||
nsIInputStream *ret = NULL;
|
nsIInputStream *ret = NULL;
|
||||||
|
IUnknown *unk;
|
||||||
IBindStatusCallback *callback;
|
IBindStatusCallback *callback;
|
||||||
IHttpNegotiate *http_negotiate;
|
IServiceProvider *service_provider;
|
||||||
BINDINFO bindinfo;
|
BINDINFO bindinfo;
|
||||||
DWORD bindf = 0;
|
DWORD bindf = 0;
|
||||||
DWORD post_len = 0, headers_len = 0;
|
DWORD post_len = 0, headers_len = 0;
|
||||||
|
@ -108,11 +109,22 @@ static nsIInputStream *get_post_data_stream(IBindCtx *bctx)
|
||||||
if(!bctx)
|
if(!bctx)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
hres = IBindCtx_GetObjectParam(bctx, _BSCB_Holder_, (IUnknown**)&callback);
|
hres = IBindCtx_GetObjectParam(bctx, _BSCB_Holder_, &unk);
|
||||||
if(FAILED(hres))
|
if(FAILED(hres))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
hres = IBindStatusCallback_QueryInterface(callback, &IID_IHttpNegotiate,
|
hres = IUnknown_QueryInterface(unk, &IID_IBindStatusCallback, (void**)&callback);
|
||||||
|
if(FAILED(hres)) {
|
||||||
|
IUnknown_Release(unk);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
hres = IUnknown_QueryInterface(unk, &IID_IServiceProvider, (void**)&service_provider);
|
||||||
|
IUnknown_Release(unk);
|
||||||
|
if(SUCCEEDED(hres)) {
|
||||||
|
IHttpNegotiate *http_negotiate;
|
||||||
|
|
||||||
|
hres = IServiceProvider_QueryService(service_provider, &IID_IHttpNegotiate, &IID_IHttpNegotiate,
|
||||||
(void**)&http_negotiate);
|
(void**)&http_negotiate);
|
||||||
if(SUCCEEDED(hres)) {
|
if(SUCCEEDED(hres)) {
|
||||||
hres = IHttpNegotiate_BeginningTransaction(http_negotiate, emptystr,
|
hres = IHttpNegotiate_BeginningTransaction(http_negotiate, emptystr,
|
||||||
|
@ -123,6 +135,9 @@ static nsIInputStream *get_post_data_stream(IBindCtx *bctx)
|
||||||
headers_len = WideCharToMultiByte(CP_ACP, 0, headers, -1, NULL, 0, NULL, NULL);
|
headers_len = WideCharToMultiByte(CP_ACP, 0, headers, -1, NULL, 0, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IServiceProvider_Release(service_provider);
|
||||||
|
}
|
||||||
|
|
||||||
memset(&bindinfo, 0, sizeof(bindinfo));
|
memset(&bindinfo, 0, sizeof(bindinfo));
|
||||||
bindinfo.cbSize = sizeof(bindinfo);
|
bindinfo.cbSize = sizeof(bindinfo);
|
||||||
|
|
||||||
|
@ -140,7 +155,6 @@ static nsIInputStream *get_post_data_stream(IBindCtx *bctx)
|
||||||
|
|
||||||
if(headers_len) {
|
if(headers_len) {
|
||||||
WideCharToMultiByte(CP_ACP, 0, headers, -1, data, -1, NULL, NULL);
|
WideCharToMultiByte(CP_ACP, 0, headers, -1, data, -1, NULL, NULL);
|
||||||
CoTaskMemFree(headers);
|
|
||||||
len = fix_headers(data, post_len);
|
len = fix_headers(data, post_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,6 +173,7 @@ static nsIInputStream *get_post_data_stream(IBindCtx *bctx)
|
||||||
ret = create_nsstream(data, len+post_len);
|
ret = create_nsstream(data, len+post_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CoTaskMemFree(headers);
|
||||||
ReleaseBindInfo(&bindinfo);
|
ReleaseBindInfo(&bindinfo);
|
||||||
IBindStatusCallback_Release(callback);
|
IBindStatusCallback_Release(callback);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue