ole32: Fix cbStruct handling in IBindCtx:GetBindOptions.
This commit is contained in:
parent
e14e464df6
commit
ba3ceaa4b8
|
@ -267,16 +267,20 @@ static HRESULT WINAPI
|
|||
BindCtxImpl_GetBindOptions(IBindCtx* iface,BIND_OPTS *pbindopts)
|
||||
{
|
||||
BindCtxImpl *This = (BindCtxImpl *)iface;
|
||||
ULONG cbStruct;
|
||||
|
||||
TRACE("(%p,%p)\n",This,pbindopts);
|
||||
|
||||
if (pbindopts==NULL)
|
||||
return E_POINTER;
|
||||
|
||||
if (pbindopts->cbStruct > sizeof(BIND_OPTS2))
|
||||
pbindopts->cbStruct = sizeof(BIND_OPTS2);
|
||||
cbStruct = pbindopts->cbStruct;
|
||||
if (cbStruct > sizeof(BIND_OPTS2))
|
||||
cbStruct = sizeof(BIND_OPTS2);
|
||||
|
||||
memcpy(pbindopts, &This->bindOption2, cbStruct);
|
||||
pbindopts->cbStruct = cbStruct;
|
||||
|
||||
memcpy(pbindopts, &This->bindOption2, pbindopts->cbStruct);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -1466,7 +1466,6 @@ static void test_bind_context(void)
|
|||
bind_opts.cbStruct = sizeof(BIND_OPTS);
|
||||
hr = IBindCtx_GetBindOptions(pBindCtx, (BIND_OPTS *)&bind_opts);
|
||||
ok_ole_success(hr, "IBindCtx_GetBindOptions");
|
||||
todo_wine
|
||||
ok(bind_opts.cbStruct == sizeof(BIND_OPTS), "bind_opts.cbStruct was %d\n", bind_opts.cbStruct);
|
||||
|
||||
bind_opts.cbStruct = sizeof(bind_opts);
|
||||
|
|
Loading…
Reference in New Issue