oleaut32: Implement ITypeComp::Bind() proxy/stub.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2016-08-26 12:30:47 +03:00 committed by Alexandre Julliard
parent 9d1876f462
commit ff934e82a8
1 changed files with 96 additions and 17 deletions

View File

@ -82,6 +82,10 @@ unsigned char * WINAPI CLEANLOCALSTORAGE_UserMarshal(ULONG *pFlags, unsigned cha
{ {
ALIGN_POINTER(Buffer, 3); ALIGN_POINTER(Buffer, 3);
*(DWORD*)Buffer = pstg->flags; *(DWORD*)Buffer = pstg->flags;
if (!pstg->pInterface)
return Buffer + sizeof(DWORD);
switch(pstg->flags) switch(pstg->flags)
{ {
case CLS_LIBATTR: case CLS_LIBATTR:
@ -1407,31 +1411,106 @@ static void free_embedded_elemdesc(ELEMDESC *edesc)
HRESULT CALLBACK ITypeComp_Bind_Proxy( HRESULT CALLBACK ITypeComp_Bind_Proxy(
ITypeComp* This, ITypeComp* This,
LPOLESTR szName, LPOLESTR name,
ULONG lHashVal, ULONG lHashVal,
WORD wFlags, WORD flags,
ITypeInfo** ppTInfo, ITypeInfo **ti,
DESCKIND* pDescKind, DESCKIND *desckind,
BINDPTR* pBindPtr) BINDPTR *bindptr)
{ {
FIXME("not implemented\n"); CLEANLOCALSTORAGE stg = { 0 };
return E_FAIL; ITypeComp *typecomp;
FUNCDESC *funcdesc;
VARDESC *vardesc;
HRESULT hr;
TRACE("(%p, %s, %#x, %#x, %p, %p, %p)\n", This, debugstr_w(name), lHashVal, flags, ti,
desckind, bindptr);
*desckind = DESCKIND_NONE;
memset(bindptr, 0, sizeof(*bindptr));
hr = ITypeComp_RemoteBind_Proxy(This, name, lHashVal, flags, ti, desckind,
&funcdesc, &vardesc, &typecomp, &stg);
if (hr == S_OK)
{
switch (*desckind)
{
case DESCKIND_FUNCDESC:
bindptr->lpfuncdesc = funcdesc;
break;
case DESCKIND_VARDESC:
case DESCKIND_IMPLICITAPPOBJ:
bindptr->lpvardesc = vardesc;
break;
case DESCKIND_TYPECOMP:
bindptr->lptcomp = typecomp;
break;
default:
;
}
}
return hr;
} }
HRESULT __RPC_STUB ITypeComp_Bind_Stub( HRESULT __RPC_STUB ITypeComp_Bind_Stub(
ITypeComp* This, ITypeComp* This,
LPOLESTR szName, LPOLESTR name,
ULONG lHashVal, ULONG lHashVal,
WORD wFlags, WORD flags,
ITypeInfo** ppTInfo, ITypeInfo **ti,
DESCKIND* pDescKind, DESCKIND *desckind,
LPFUNCDESC* ppFuncDesc, FUNCDESC **funcdesc,
LPVARDESC* ppVarDesc, VARDESC **vardesc,
ITypeComp** ppTypeComp, ITypeComp **typecomp,
CLEANLOCALSTORAGE* pDummy) CLEANLOCALSTORAGE *stg)
{ {
FIXME("not implemented\n"); BINDPTR bindptr;
return E_FAIL; HRESULT hr;
TRACE("(%p, %s, %#x, %#x, %p, %p, %p, %p, %p, %p)\n", This, debugstr_w(name),
lHashVal, flags, ti, desckind, funcdesc, vardesc, typecomp, stg);
memset(stg, 0, sizeof(*stg));
memset(&bindptr, 0, sizeof(bindptr));
*funcdesc = NULL;
*vardesc = NULL;
*typecomp = NULL;
*ti = NULL;
hr = ITypeComp_Bind(This, name, lHashVal, flags, ti, desckind, &bindptr);
if(hr != S_OK)
return hr;
switch (*desckind)
{
case DESCKIND_FUNCDESC:
*funcdesc = bindptr.lpfuncdesc;
stg->pInterface = (IUnknown*)*ti;
stg->pStorage = funcdesc;
stg->flags = CLS_FUNCDESC;
break;
case DESCKIND_VARDESC:
case DESCKIND_IMPLICITAPPOBJ:
*vardesc = bindptr.lpvardesc;
stg->pInterface = (IUnknown*)*ti;
stg->pStorage = vardesc;
stg->flags = CLS_VARDESC;
break;
case DESCKIND_TYPECOMP:
*typecomp = bindptr.lptcomp;
break;
default:
;
}
if (stg->pInterface)
IUnknown_AddRef(stg->pInterface);
return hr;
} }
HRESULT CALLBACK ITypeComp_BindType_Proxy( HRESULT CALLBACK ITypeComp_BindType_Proxy(