urlmon: Added ibind argument handling in CreateAsyncBindCtx.

This commit is contained in:
Jacek Caban 2007-12-30 17:42:03 +01:00 committed by Alexandre Julliard
parent 2f0f1fefb8
commit 785e98173f
2 changed files with 31 additions and 9 deletions

View File

@ -705,13 +705,13 @@ static HRESULT WINAPI AsyncBindCtx_GetObjectParam(IBindCtx* iface, LPOLESTR pszk
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);
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)
@ -820,9 +820,14 @@ HRESULT WINAPI CreateAsyncBindCtxEx(IBindCtx *ibind, DWORD options,
if(reserved)
WARN("reserved=%d\n", reserved);
hres = CreateBindCtx(0, &bindctx);
if(FAILED(hres))
return hres;
if(ibind) {
IBindCtx_AddRef(ibind);
bindctx = ibind;
}else {
hres = CreateBindCtx(0, &bindctx);
if(FAILED(hres))
return hres;
}
ret = heap_alloc(sizeof(AsyncBindCtx));

View File

@ -1191,11 +1191,13 @@ static void test_CreateAsyncBindCtx(void)
static void test_CreateAsyncBindCtxEx(void)
{
IBindCtx *bctx = NULL, *bctx_arg = NULL;
IBindCtx *bctx = NULL, *bctx2 = NULL, *bctx_arg = NULL;
IUnknown *unk;
BIND_OPTS bindopts;
HRESULT hres;
static WCHAR testW[] = {'t','e','s','t',0};
hres = CreateAsyncBindCtxEx(NULL, 0, NULL, NULL, NULL, 0);
ok(hres == E_INVALIDARG, "CreateAsyncBindCtx failed: %08x, expected E_INVALIDARG\n", hres);
@ -1248,8 +1250,23 @@ static void test_CreateAsyncBindCtxEx(void)
if(SUCCEEDED(hres))
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)