Commit 785e9817 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

urlmon: Added ibind argument handling in CreateAsyncBindCtx.

parent 2f0f1fef
...@@ -705,13 +705,13 @@ static HRESULT WINAPI AsyncBindCtx_GetObjectParam(IBindCtx* iface, LPOLESTR pszk ...@@ -705,13 +705,13 @@ static HRESULT WINAPI AsyncBindCtx_GetObjectParam(IBindCtx* iface, LPOLESTR pszk
return IBindCtx_GetObjectParam(This->bindctx, pszkey, punk); return IBindCtx_GetObjectParam(This->bindctx, pszkey, punk);
} }
static HRESULT WINAPI AsyncBindCtx_RevokeObjectParam(IBindCtx *iface, LPOLESTR ppenum) static HRESULT WINAPI AsyncBindCtx_RevokeObjectParam(IBindCtx *iface, LPOLESTR pszkey)
{ {
AsyncBindCtx *This = BINDCTX_THIS(iface); AsyncBindCtx *This = BINDCTX_THIS(iface);
TRACE("(%p)->(%p)\n", This, ppenum); TRACE("(%p)->(%s)\n", This, debugstr_w(pszkey));
return IBindCtx_RevokeObjectParam(This->bindctx, ppenum); return IBindCtx_RevokeObjectParam(This->bindctx, pszkey);
} }
static HRESULT WINAPI AsyncBindCtx_EnumObjectParam(IBindCtx *iface, IEnumString **pszkey) static HRESULT WINAPI AsyncBindCtx_EnumObjectParam(IBindCtx *iface, IEnumString **pszkey)
...@@ -820,9 +820,14 @@ HRESULT WINAPI CreateAsyncBindCtxEx(IBindCtx *ibind, DWORD options, ...@@ -820,9 +820,14 @@ HRESULT WINAPI CreateAsyncBindCtxEx(IBindCtx *ibind, DWORD options,
if(reserved) if(reserved)
WARN("reserved=%d\n", reserved); WARN("reserved=%d\n", reserved);
if(ibind) {
IBindCtx_AddRef(ibind);
bindctx = ibind;
}else {
hres = CreateBindCtx(0, &bindctx); hres = CreateBindCtx(0, &bindctx);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
}
ret = heap_alloc(sizeof(AsyncBindCtx)); ret = heap_alloc(sizeof(AsyncBindCtx));
......
...@@ -1191,11 +1191,13 @@ static void test_CreateAsyncBindCtx(void) ...@@ -1191,11 +1191,13 @@ static void test_CreateAsyncBindCtx(void)
static void test_CreateAsyncBindCtxEx(void) static void test_CreateAsyncBindCtxEx(void)
{ {
IBindCtx *bctx = NULL, *bctx_arg = NULL; IBindCtx *bctx = NULL, *bctx2 = NULL, *bctx_arg = NULL;
IUnknown *unk; IUnknown *unk;
BIND_OPTS bindopts; BIND_OPTS bindopts;
HRESULT hres; HRESULT hres;
static WCHAR testW[] = {'t','e','s','t',0};
hres = CreateAsyncBindCtxEx(NULL, 0, NULL, NULL, NULL, 0); hres = CreateAsyncBindCtxEx(NULL, 0, NULL, NULL, NULL, 0);
ok(hres == E_INVALIDARG, "CreateAsyncBindCtx failed: %08x, expected E_INVALIDARG\n", hres); ok(hres == E_INVALIDARG, "CreateAsyncBindCtx failed: %08x, expected E_INVALIDARG\n", hres);
...@@ -1248,8 +1250,23 @@ static void test_CreateAsyncBindCtxEx(void) ...@@ -1248,8 +1250,23 @@ static void test_CreateAsyncBindCtxEx(void)
if(SUCCEEDED(hres)) if(SUCCEEDED(hres))
IUnknown_Release(unk); IUnknown_Release(unk);
if(SUCCEEDED(hres))
IBindCtx_Release(bctx); IBindCtx_Release(bctx);
hres = CreateBindCtx(0, &bctx2);
ok(hres == S_OK, "CreateBindCtx failed: %08x\n", hres);
hres = CreateAsyncBindCtxEx(bctx2, 0, NULL, NULL, &bctx, 0);
ok(hres == S_OK, "CreateAsyncBindCtxEx failed: %08x\n", hres);
hres = IBindCtx_RegisterObjectParam(bctx2, testW, (IUnknown*)&Protocol);
ok(hres == S_OK, "RegisterObjectParam failed: %08x\n", hres);
hres = IBindCtx_GetObjectParam(bctx, testW, &unk);
ok(hres == S_OK, "GetObjectParam failed: %08x\n", hres);
ok(unk == (IUnknown*)&Protocol, "unexpected unk %p\n", unk);
IBindCtx_Release(bctx);
IBindCtx_Release(bctx2);
} }
static void test_bscholder(IBindStatusCallback *holder) static void test_bscholder(IBindStatusCallback *holder)
......
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