4 * Copyright 2002 Marcus Meissner
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 #define NONAMELESSUNION
31 #define NONAMELESSSTRUCT
40 #include "wine/unicode.h"
43 #include "wine/debug.h"
46 static const WCHAR riidW
[5] = {'r','i','i','d',0};
47 static const WCHAR pdispparamsW
[] = {'p','d','i','s','p','p','a','r','a','m','s',0};
48 static const WCHAR ppvObjectW
[] = {'p','p','v','O','b','j','e','c','t',0};
50 WINE_DEFAULT_DEBUG_CHANNEL(ole
);
51 WINE_DECLARE_DEBUG_CHANNEL(olerelay
);
53 typedef struct _marshal_state
{
59 IID iid
; /* HACK: for VT_VOID */
63 xbuf_add(marshal_state
*buf
, LPBYTE stuff
, DWORD size
) {
64 while (buf
->size
- buf
->curoff
< size
) {
67 buf
->base
= HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY
,buf
->base
,buf
->size
);
71 buf
->base
= HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY
,32);
77 memcpy(buf
->base
+buf
->curoff
,stuff
,size
);
83 xbuf_get(marshal_state
*buf
, LPBYTE stuff
, DWORD size
) {
84 if (buf
->size
< buf
->curoff
+size
) return E_FAIL
;
85 memcpy(stuff
,buf
->base
+buf
->curoff
,size
);
91 xbuf_skip(marshal_state
*buf
, DWORD size
) {
92 if (buf
->size
< buf
->curoff
+size
) return E_FAIL
;
98 _unmarshal_interface(marshal_state
*buf
, REFIID riid
, LPUNKNOWN
*pUnk
) {
100 ULARGE_INTEGER newpos
;
101 LARGE_INTEGER seekto
;
106 TRACE("...%s...\n",debugstr_guid(riid
));
108 hres
= xbuf_get(buf
,(LPBYTE
)&xsize
,sizeof(xsize
));
109 if (hres
) return hres
;
110 if (xsize
== 0) return S_OK
;
111 hres
= CreateStreamOnHGlobal(0,TRUE
,&pStm
);
113 FIXME("Stream create failed %lx\n",hres
);
116 hres
= IStream_Write(pStm
,buf
->base
+buf
->curoff
,xsize
,&res
);
117 if (hres
) { FIXME("stream write %lx\n",hres
); return hres
; }
118 memset(&seekto
,0,sizeof(seekto
));
119 hres
= IStream_Seek(pStm
,seekto
,SEEK_SET
,&newpos
);
120 if (hres
) { FIXME("Failed Seek %lx\n",hres
); return hres
;}
121 hres
= CoUnmarshalInterface(pStm
,riid
,(LPVOID
*)pUnk
);
123 FIXME("Marshalling interface %s failed with %lx\n",debugstr_guid(riid
),hres
);
126 IStream_Release(pStm
);
127 return xbuf_skip(buf
,xsize
);
131 _marshal_interface(marshal_state
*buf
, REFIID riid
, LPUNKNOWN pUnk
) {
136 ULARGE_INTEGER newpos
;
137 LARGE_INTEGER seekto
;
146 TRACE("...%s...\n",debugstr_guid(riid
));
147 hres
=IUnknown_QueryInterface(pUnk
,riid
,(LPVOID
*)&newiface
);
149 TRACE("%p does not support iface %s\n",pUnk
,debugstr_guid(riid
));
152 hres
= CreateStreamOnHGlobal(0,TRUE
,&pStm
);
154 FIXME("Stream create failed %lx\n",hres
);
157 hres
= CoMarshalInterface(pStm
,riid
,newiface
,0,NULL
,0);
158 IUnknown_Release(newiface
);
160 FIXME("Marshalling interface %s failed with %lx\n",
161 debugstr_guid(riid
),hres
165 hres
= IStream_Stat(pStm
,&ststg
,0);
166 tempbuf
= HeapAlloc(GetProcessHeap(), 0, ststg
.cbSize
.s
.LowPart
);
167 memset(&seekto
,0,sizeof(seekto
));
168 hres
= IStream_Seek(pStm
,seekto
,SEEK_SET
,&newpos
);
169 if (hres
) { FIXME("Failed Seek %lx\n",hres
); goto fail
;}
170 hres
= IStream_Read(pStm
,tempbuf
,ststg
.cbSize
.s
.LowPart
,&res
);
171 if (hres
) { FIXME("Failed Read %lx\n",hres
); goto fail
;}
172 IStream_Release(pStm
);
173 xsize
= ststg
.cbSize
.s
.LowPart
;
174 xbuf_add(buf
,(LPBYTE
)&xsize
,sizeof(xsize
));
175 hres
= xbuf_add(buf
,tempbuf
,ststg
.cbSize
.s
.LowPart
);
176 HeapFree(GetProcessHeap(),0,tempbuf
);
180 xbuf_add(buf
,(LPBYTE
)&xsize
,sizeof(xsize
));
184 /********************* OLE Proxy/Stub Factory ********************************/
185 static HRESULT WINAPI
186 PSFacBuf_QueryInterface(LPPSFACTORYBUFFER iface
, REFIID iid
, LPVOID
*ppv
) {
187 if (IsEqualIID(iid
,&IID_IPSFactoryBuffer
)||IsEqualIID(iid
,&IID_IUnknown
)) {
188 *ppv
= (LPVOID
)iface
;
189 /* No ref counting, static class */
192 FIXME("(%s) unknown IID?\n",debugstr_guid(iid
));
193 return E_NOINTERFACE
;
196 static ULONG WINAPI
PSFacBuf_AddRef(LPPSFACTORYBUFFER iface
) { return 2; }
197 static ULONG WINAPI
PSFacBuf_Release(LPPSFACTORYBUFFER iface
) { return 1; }
200 _get_typeinfo_for_iid(REFIID riid
, ITypeInfo
**ti
) {
203 char tlguid
[200],typelibkey
[300],interfacekey
[300],ver
[100];
206 DWORD tlguidlen
, verlen
, type
, tlfnlen
;
209 sprintf( interfacekey
, "Interface\\{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\\Typelib",
210 riid
->Data1
, riid
->Data2
, riid
->Data3
,
211 riid
->Data4
[0], riid
->Data4
[1], riid
->Data4
[2], riid
->Data4
[3],
212 riid
->Data4
[4], riid
->Data4
[5], riid
->Data4
[6], riid
->Data4
[7]
215 if (RegOpenKeyA(HKEY_CLASSES_ROOT
,interfacekey
,&ikey
)) {
216 FIXME("No %s key found.\n",interfacekey
);
220 tlguidlen
= sizeof(tlguid
);
221 if (RegQueryValueExA(ikey
,NULL
,NULL
,&type
,tlguid
,&tlguidlen
)) {
222 FIXME("Getting typelib guid failed.\n");
227 verlen
= sizeof(ver
);
228 if (RegQueryValueExA(ikey
,"Version",NULL
,&type
,ver
,&verlen
)) {
229 FIXME("Could not get version value?\n");
234 sprintf(typelibkey
,"Typelib\\%s\\%s\\0\\win32",tlguid
,ver
);
235 tlfnlen
= sizeof(tlfn
);
236 if (RegQueryValueA(HKEY_CLASSES_ROOT
,typelibkey
,tlfn
,&tlfnlen
)) {
237 FIXME("Could not get typelib fn?\n");
240 MultiByteToWideChar(CP_ACP
, 0, tlfn
, -1, tlfnW
, -1);
241 hres
= LoadTypeLib(tlfnW
,&tl
);
243 ERR("Failed to load typelib for %s, but it should be there.\n",debugstr_guid(riid
));
246 hres
= ITypeLib_GetTypeInfoOfGuid(tl
,riid
,ti
);
248 ERR("typelib does not contain info for %s?\n",debugstr_guid(riid
));
249 ITypeLib_Release(tl
);
252 /* FIXME: do this? ITypeLib_Release(tl); */
256 /* Determine nr of functions. Since we use the toplevel interface and all
257 * inherited ones have lower numbers, we are ok to not to descent into
258 * the inheritance tree I think.
260 static int _nroffuncs(ITypeInfo
*tinfo
) {
267 hres
= ITypeInfo_GetFuncDesc(tinfo
,n
,&fdesc
);
270 if (fdesc
->oVft
/4 > max
)
277 typedef struct _TMAsmProxy
{
286 } WINE_PACKED TMAsmProxy
;
288 typedef struct _TMProxyImpl
{
290 ICOM_VTABLE(IRpcProxyBuffer
) *lpvtbl2
;
293 TMAsmProxy
*asmstubs
;
295 IRpcChannelBuffer
* chanbuf
;
299 static HRESULT WINAPI
300 TMProxyImpl_QueryInterface(LPRPCPROXYBUFFER iface
, REFIID riid
, LPVOID
*ppv
) {
302 if (IsEqualIID(riid
,&IID_IUnknown
)||IsEqualIID(riid
,&IID_IRpcProxyBuffer
)) {
303 *ppv
= (LPVOID
)iface
;
304 IRpcProxyBuffer_AddRef(iface
);
307 FIXME("no interface for %s\n",debugstr_guid(riid
));
308 return E_NOINTERFACE
;
312 TMProxyImpl_AddRef(LPRPCPROXYBUFFER iface
) {
313 ICOM_THIS_MULTI(TMProxyImpl
,lpvtbl2
,iface
);
321 TMProxyImpl_Release(LPRPCPROXYBUFFER iface
) {
322 ICOM_THIS_MULTI(TMProxyImpl
,lpvtbl2
,iface
);
326 if (This
->ref
) return This
->ref
;
327 if (This
->chanbuf
) IRpcChannelBuffer_Release(This
->chanbuf
);
328 HeapFree(GetProcessHeap(),0,This
);
332 static HRESULT WINAPI
334 LPRPCPROXYBUFFER iface
,IRpcChannelBuffer
* pRpcChannelBuffer
336 ICOM_THIS_MULTI(TMProxyImpl
,lpvtbl2
,iface
);
338 TRACE("(%p)\n",pRpcChannelBuffer
);
339 This
->chanbuf
= pRpcChannelBuffer
;
340 IRpcChannelBuffer_AddRef(This
->chanbuf
);
345 TMProxyImpl_Disconnect(LPRPCPROXYBUFFER iface
) {
346 ICOM_THIS_MULTI(TMProxyImpl
,lpvtbl2
,iface
);
349 IRpcChannelBuffer_Release(This
->chanbuf
);
350 This
->chanbuf
= NULL
;
354 static ICOM_VTABLE(IRpcProxyBuffer
) tmproxyvtable
= {
355 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
356 TMProxyImpl_QueryInterface
,
360 TMProxyImpl_Disconnect
363 /* how much space do we use on stack in DWORD steps. */
368 return sizeof(DATE
)/sizeof(DWORD
);
370 return (sizeof(VARIANT
)+3)/sizeof(DWORD
);
377 _xsize(TYPEDESC
*td
) {
382 return sizeof(VARIANT
)+3;
385 ARRAYDESC
*adesc
= td
->u
.lpadesc
;
387 for (i
=0;i
<adesc
->cDims
;i
++)
388 arrsize
*= adesc
->rgbounds
[i
].cElements
;
389 return arrsize
*_xsize(&adesc
->tdescElem
);
414 TRACE("(tdesc.vt %d)\n",tdesc
->vt
);
417 case VT_EMPTY
: /* nothing. empty variant for instance */
428 if (debugout
) MESSAGE("%lx",*arg
);
430 hres
= xbuf_add(buf
,(LPBYTE
)arg
,sizeof(DWORD
));
434 VARIANT
*vt
= (VARIANT
*)arg
;
435 DWORD vttype
= V_VT(vt
);
437 if (debugout
) MESSAGE("Vt(%ld)(",vttype
);
440 hres
= xbuf_add(buf
,(LPBYTE
)&vttype
,sizeof(vttype
));
441 if (hres
) return hres
;
443 /* need to recurse since we need to free the stuff */
444 hres
= serialize_param(tinfo
,writeit
,debugout
,dealloc
,&tdesc2
,&(V_I4(vt
)),buf
);
445 if (debugout
) MESSAGE(")");
451 MESSAGE("%s",debugstr_w((BSTR
)*arg
));
453 MESSAGE("<bstr NULL>");
458 hres
= xbuf_add(buf
,(LPBYTE
)&fakelen
,4);
462 DWORD
*bstr
= ((DWORD
*)(*arg
))-1;
464 hres
= xbuf_add(buf
,(LPBYTE
)bstr
,bstr
[0]+4);
471 SysFreeString((BSTR
)*arg
);
477 if (debugout
) MESSAGE("*");
479 cookie
= *arg
? 0x42424242 : 0;
480 hres
= xbuf_add(buf
,(LPBYTE
)&cookie
,sizeof(cookie
));
485 if (debugout
) MESSAGE("NULL");
488 hres
= serialize_param(tinfo
,writeit
,debugout
,dealloc
,tdesc
->u
.lptdesc
,(DWORD
*)*arg
,buf
);
489 if (dealloc
) HeapFree(GetProcessHeap(),0,(LPVOID
)arg
);
493 if (debugout
) MESSAGE("unk(0x%lx)",*arg
);
495 hres
= _marshal_interface(buf
,&IID_IUnknown
,(LPUNKNOWN
)*arg
);
498 if (debugout
) MESSAGE("idisp(0x%lx)",*arg
);
500 hres
= _marshal_interface(buf
,&IID_IDispatch
,(LPUNKNOWN
)*arg
);
503 if (debugout
) MESSAGE("<void>");
505 case VT_USERDEFINED
: {
509 hres
= ITypeInfo_GetRefTypeInfo(tinfo
,tdesc
->u
.hreftype
,&tinfo2
);
511 FIXME("Could not get typeinfo of hreftype %lx for VT_USERDEFINED.\n",tdesc
->u
.hreftype
);
514 ITypeInfo_GetTypeAttr(tinfo2
,&tattr
);
515 switch (tattr
->typekind
) {
517 case TKIND_INTERFACE
:
519 hres
=_marshal_interface(buf
,&(tattr
->guid
),(LPUNKNOWN
)arg
);
523 if (debugout
) MESSAGE("{");
524 for (i
=0;i
<tattr
->cVars
;i
++) {
529 hres
= ITypeInfo2_GetVarDesc(tinfo2
, i
, &vdesc
);
531 FIXME("Could not get vardesc of %d\n",i
);
534 /* Need them for hack below */
536 memset(names,0,sizeof(names));
537 hres = ITypeInfo_GetNames(tinfo2,vdesc->memid,names,sizeof(names)/sizeof(names[0]),&nrofnames);
538 if (nrofnames > sizeof(names)/sizeof(names[0])) {
539 ERR("Need more names!\n");
541 if (!hres && debugout)
542 MESSAGE("%s=",debugstr_w(names[0]));
544 elem2
= &vdesc
->elemdescVar
;
545 tdesc2
= &elem2
->tdesc
;
546 hres
= serialize_param(
552 (DWORD
*)(((LPBYTE
)arg
)+vdesc
->u
.oInst
),
557 if (debugout
&& (i
<(tattr
->cVars
-1)))
560 if (buf
->thisisiid
&& (tattr
->cbSizeInstance
==sizeof(GUID
)))
561 memcpy(&(buf
->iid
),arg
,sizeof(buf
->iid
));
562 if (debugout
) MESSAGE("}");
566 FIXME("Unhandled typekind %d\n",tattr
->typekind
);
570 ITypeInfo_Release(tinfo2
);
574 ARRAYDESC
*adesc
= tdesc
->u
.lpadesc
;
577 if (debugout
) MESSAGE("carr");
578 for (i
=0;i
<adesc
->cDims
;i
++) {
579 if (debugout
) MESSAGE("[%ld]",adesc
->rgbounds
[i
].cElements
);
580 arrsize
*= adesc
->rgbounds
[i
].cElements
;
582 if (debugout
) MESSAGE("[");
583 for (i
=0;i
<arrsize
;i
++) {
584 hres
= serialize_param(tinfo
, writeit
, debugout
, dealloc
, &adesc
->tdescElem
, (DWORD
*)((LPBYTE
)arg
+i
*_xsize(&adesc
->tdescElem
)), buf
);
587 if (debugout
&& (i
<arrsize
-1)) MESSAGE(",");
589 if (debugout
) MESSAGE("]");
593 ERR("Unhandled marshal type %d.\n",tdesc
->vt
);
599 serialize_LPVOID_ptr(
611 if ((tdesc
->vt
!= VT_PTR
) ||
612 (tdesc
->u
.lptdesc
->vt
!= VT_PTR
) ||
613 (tdesc
->u
.lptdesc
->u
.lptdesc
->vt
!= VT_VOID
)
615 FIXME("ppvObject not expressed as VT_PTR -> VT_PTR -> VT_VOID?\n");
618 cookie
= (*arg
) ? 0x42424242: 0x0;
620 hres
= xbuf_add(buf
, (LPVOID
)&cookie
, sizeof(cookie
));
625 if (debugout
) MESSAGE("<lpvoid NULL>");
629 MESSAGE("ppv(%p)",*(LPUNKNOWN
*)*arg
);
631 hres
= _marshal_interface(buf
,&(buf
->iid
),*(LPUNKNOWN
*)*arg
);
636 HeapFree(GetProcessHeap(),0,(LPVOID
)*arg
);
641 serialize_DISPPARAM_ptr(
655 if ((tdesc
->vt
!= VT_PTR
) || (tdesc
->u
.lptdesc
->vt
!= VT_USERDEFINED
)) {
656 FIXME("DISPPARAMS not expressed as VT_PTR -> VT_USERDEFINED?\n");
660 cookie
= *arg
? 0x42424242 : 0x0;
662 hres
= xbuf_add(buf
,(LPBYTE
)&cookie
,sizeof(cookie
));
667 if (debugout
) MESSAGE("<DISPPARAMS NULL>");
670 disp
= (DISPPARAMS
*)*arg
;
672 hres
= xbuf_add(buf
,(LPBYTE
)&disp
->cArgs
,sizeof(disp
->cArgs
));
676 if (debugout
) MESSAGE("D{");
677 for (i
=0;i
<disp
->cArgs
;i
++) {
680 vtdesc
.vt
= VT_VARIANT
;
687 (DWORD
*)(disp
->rgvarg
+i
),
690 if (debugout
&& (i
<disp
->cArgs
-1))
694 HeapFree(GetProcessHeap(),0,disp
->rgvarg
);
696 hres
= xbuf_add(buf
,(LPBYTE
)&disp
->cNamedArgs
,sizeof(disp
->cNamedArgs
));
700 if (debugout
) MESSAGE("}{");
701 for (i
=0;i
<disp
->cNamedArgs
;i
++) {
711 (DWORD
*)(disp
->rgdispidNamedArgs
+i
),
714 if (debugout
&& (i
<disp
->cNamedArgs
-1))
717 if (debugout
) MESSAGE("}");
719 HeapFree(GetProcessHeap(),0,disp
->rgdispidNamedArgs
);
720 HeapFree(GetProcessHeap(),0,disp
);
737 TRACE("vt %d at %p\n",tdesc
->vt
,arg
);
742 if (debugout
) MESSAGE("<empty>");
745 if (debugout
) MESSAGE("<null>");
748 VARIANT
*vt
= (VARIANT
*)arg
;
753 hres
= xbuf_get(buf
,(LPBYTE
)&vttype
,sizeof(vttype
));
755 FIXME("vt type not read?\n");
758 memset(&tdesc2
,0,sizeof(tdesc2
));
761 if (debugout
) MESSAGE("Vt(%ld)(",vttype
);
762 hres
= deserialize_param(tinfo
, readit
, debugout
, alloc
, &tdesc2
, &(V_I4(vt
)), buf
);
771 case VT_BOOL
: case VT_I4
: case VT_UI4
: case VT_UINT
: case VT_R4
:
775 hres
= xbuf_get(buf
,(LPBYTE
)arg
,sizeof(DWORD
));
776 if (hres
) FIXME("Failed to read integer 4 byte\n");
778 if (debugout
) MESSAGE("%lx",*arg
);
785 hres
= xbuf_get(buf
,(LPBYTE
)&len
,sizeof(DWORD
));
787 FIXME("failed to read bstr klen\n");
792 if (debugout
) MESSAGE("<bstr NULL>");
794 str
= HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY
,len
+sizeof(WCHAR
));
795 hres
= xbuf_get(buf
,(LPBYTE
)str
,len
);
797 FIXME("Failed to read BSTR.\n");
800 *arg
= (DWORD
)SysAllocStringLen(str
,len
);
801 if (debugout
) MESSAGE("%s",debugstr_w(str
));
802 HeapFree(GetProcessHeap(),0,str
);
813 derefhere
= (tdesc
->u
.lptdesc
->vt
!= VT_USERDEFINED
);
816 hres
= xbuf_get(buf
,(LPBYTE
)&cookie
,sizeof(cookie
));
818 FIXME("Failed to load pointer cookie.\n");
821 if (cookie
!= 0x42424242) {
822 if (debugout
) MESSAGE("NULL");
826 if (debugout
) MESSAGE("*");
830 *arg
=(DWORD
)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY
,_xsize(tdesc
->u
.lptdesc
));
833 return deserialize_param(tinfo
, readit
, debugout
, alloc
, tdesc
->u
.lptdesc
, (LPDWORD
)*arg
, buf
);
835 return deserialize_param(tinfo
, readit
, debugout
, alloc
, tdesc
->u
.lptdesc
, arg
, buf
);
838 /* FIXME: UNKNOWN is unknown ..., but allocate 4 byte for it */
840 *arg
=(DWORD
)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY
,sizeof(DWORD
));
843 hres
= _unmarshal_interface(buf
,&IID_IUnknown
,(LPUNKNOWN
*)arg
);
845 MESSAGE("unk(%p)",arg
);
850 hres
= _unmarshal_interface(buf
,&IID_IDispatch
,(LPUNKNOWN
*)arg
);
852 MESSAGE("idisp(%p)",arg
);
855 if (debugout
) MESSAGE("<void>");
857 case VT_USERDEFINED
: {
861 hres
= ITypeInfo_GetRefTypeInfo(tinfo
,tdesc
->u
.hreftype
,&tinfo2
);
863 FIXME("Could not get typeinfo of hreftype %lx for VT_USERDEFINED.\n",tdesc
->u
.hreftype
);
866 hres
= ITypeInfo_GetTypeAttr(tinfo2
,&tattr
);
868 FIXME("Could not get typeattr in VT_USERDEFINED.\n");
871 *arg
= (DWORD
)HeapAlloc(GetProcessHeap(),0,tattr
->cbSizeInstance
);
872 switch (tattr
->typekind
) {
874 case TKIND_INTERFACE
:
876 hres
= _unmarshal_interface(buf
,&(tattr
->guid
),(LPUNKNOWN
*)arg
);
881 if (debugout
) MESSAGE("{");
882 for (i
=0;i
<tattr
->cVars
;i
++) {
885 hres
= ITypeInfo2_GetVarDesc(tinfo2
, i
, &vdesc
);
887 FIXME("Could not get vardesc of %d\n",i
);
890 hres
= deserialize_param(
895 &vdesc
->elemdescVar
.tdesc
,
896 (DWORD
*)(((LPBYTE
)*arg
)+vdesc
->u
.oInst
),
899 if (debugout
&& (i
<tattr
->cVars
-1)) MESSAGE(",");
901 if (buf
->thisisiid
&& (tattr
->cbSizeInstance
==sizeof(GUID
)))
902 memcpy(&(buf
->iid
),(LPBYTE
)*arg
,sizeof(buf
->iid
));
903 if (debugout
) MESSAGE("}");
907 ERR("Unhandled typekind %d\n",tattr
->typekind
);
913 FIXME("failed to stuballoc in TKIND_RECORD.\n");
914 ITypeInfo_Release(tinfo2
);
918 /* arg is pointing to the start of the array. */
919 ARRAYDESC
*adesc
= tdesc
->u
.lpadesc
;
922 if (adesc
->cDims
> 1) FIXME("cDims > 1 in VT_CARRAY. Does it work?\n");
923 for (i
=0;i
<adesc
->cDims
;i
++)
924 arrsize
*= adesc
->rgbounds
[i
].cElements
;
925 for (i
=0;i
<arrsize
;i
++)
932 (DWORD
*)((LPBYTE
)(arg
)+i
*_xsize(&adesc
->tdescElem
)),
938 ERR("No handler for VT type %d!\n",tdesc
->vt
);
945 deserialize_LPVOID_ptr(
957 if ((tdesc
->vt
!= VT_PTR
) ||
958 (tdesc
->u
.lptdesc
->vt
!= VT_PTR
) ||
959 (tdesc
->u
.lptdesc
->u
.lptdesc
->vt
!= VT_VOID
)
961 FIXME("ppvObject not expressed as VT_PTR -> VT_PTR -> VT_VOID?\n");
965 *arg
=(DWORD
)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY
,sizeof(LPVOID
));
967 hres
= xbuf_get(buf
, (LPVOID
)&cookie
, sizeof(cookie
));
970 if (cookie
!= 0x42424242) {
972 if (debugout
) MESSAGE("<lpvoid NULL>");
977 hres
= _unmarshal_interface(buf
,&buf
->iid
,(LPUNKNOWN
*)*arg
);
981 if (debugout
) MESSAGE("ppv(%p)",(LPVOID
)*arg
);
986 deserialize_DISPPARAM_ptr(
1000 if ((tdesc
->vt
!= VT_PTR
) || (tdesc
->u
.lptdesc
->vt
!= VT_USERDEFINED
)) {
1001 FIXME("DISPPARAMS not expressed as VT_PTR -> VT_USERDEFINED?\n");
1005 hres
= xbuf_get(buf
,(LPBYTE
)&cookie
,sizeof(cookie
));
1010 if (debugout
) MESSAGE("<DISPPARAMS NULL>");
1015 *arg
= (DWORD
)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY
,sizeof(DISPPARAMS
));
1016 disps
= (DISPPARAMS
*)*arg
;
1019 hres
= xbuf_get(buf
, (LPBYTE
)&disps
->cArgs
, sizeof(disps
->cArgs
));
1023 disps
->rgvarg
= HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY
,sizeof(VARIANT
)*disps
->cArgs
);
1024 if (debugout
) MESSAGE("D{");
1025 for (i
=0; i
< disps
->cArgs
; i
++) {
1028 vdesc
.vt
= VT_VARIANT
;
1029 hres
= deserialize_param(
1035 (DWORD
*)(disps
->rgvarg
+i
),
1039 if (debugout
) MESSAGE("}{");
1040 hres
= xbuf_get(buf
, (LPBYTE
)&disps
->cNamedArgs
, sizeof(disps
->cNamedArgs
));
1043 if (disps
->cNamedArgs
) {
1045 disps
->rgdispidNamedArgs
= HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY
,sizeof(DISPID
)*disps
->cNamedArgs
);
1046 for (i
=0; i
< disps
->cNamedArgs
; i
++) {
1050 hres
= deserialize_param(
1056 (DWORD
*)(disps
->rgdispidNamedArgs
+i
),
1059 if (debugout
&& i
<(disps
->cNamedArgs
-1)) MESSAGE(",");
1062 if (debugout
) MESSAGE("}");
1066 /* Searches function, also in inherited interfaces */
1069 ITypeInfo
*tinfo
, int iMethod
, FUNCDESC
**fdesc
, BSTR
*iname
, BSTR
*fname
1074 if (fname
) *fname
= NULL
;
1075 if (iname
) *iname
= NULL
;
1078 hres
= ITypeInfo_GetFuncDesc(tinfo
, i
, fdesc
);
1084 hres
= ITypeInfo_GetTypeAttr(tinfo
, &attr
);
1086 FIXME("GetTypeAttr failed with %lx\n",hres
);
1089 /* Not found, so look in inherited ifaces. */
1090 for (j
=0;j
<attr
->cImplTypes
;j
++) {
1091 hres
= ITypeInfo_GetRefTypeOfImplType(tinfo
, j
, &href
);
1093 FIXME("Did not find a reftype for interface offset %d?\n",j
);
1096 hres
= ITypeInfo_GetRefTypeInfo(tinfo
, href
, &tinfo2
);
1098 FIXME("Did not find a typeinfo for reftype %ld?\n",href
);
1101 hres
= _get_funcdesc(tinfo2
,iMethod
,fdesc
,iname
,fname
);
1102 ITypeInfo_Release(tinfo2
);
1103 if (!hres
) return S_OK
;
1107 if (((*fdesc
)->oVft
/4) == iMethod
) {
1109 ITypeInfo_GetDocumentation(tinfo
,(*fdesc
)->memid
,fname
,NULL
,NULL
,NULL
);
1111 ITypeInfo_GetDocumentation(tinfo
,-1,iname
,NULL
,NULL
,NULL
);
1120 xCall(LPVOID retptr
, int method
, TMProxyImpl
*tpinfo
/*, args */) {
1121 DWORD
*args
= ((DWORD
*)&tpinfo
)+1, *xargs
;
1124 int i
, relaydeb
= TRACE_ON(olerelay
);
1132 hres
= _get_funcdesc(tpinfo
->tinfo
,method
,&fdesc
,&iname
,&fname
);
1134 ERR("Did not find typeinfo/funcdesc entry for method %d!\n",method
);
1138 /*dump_FUNCDESC(fdesc);*/
1140 TRACE_(olerelay
)("->");
1142 MESSAGE("%s:",debugstr_w(iname
));
1144 MESSAGE("%s(%d)",debugstr_w(fname
),method
);
1146 MESSAGE("%d",method
);
1148 if (iname
) SysFreeString(iname
);
1149 if (fname
) SysFreeString(fname
);
1151 /* Need them for hack below */
1152 memset(names
,0,sizeof(names
));
1153 if (ITypeInfo_GetNames(tpinfo
->tinfo
,fdesc
->memid
,names
,sizeof(names
)/sizeof(names
[0]),&nrofnames
))
1155 if (nrofnames
> sizeof(names
)/sizeof(names
[0]))
1156 ERR("Need more names!\n");
1158 memset(&buf
,0,sizeof(buf
));
1159 buf
.iid
= IID_IUnknown
;
1161 xbuf_add(&buf
,(LPBYTE
)args
[0],sizeof(IID
));
1162 if (relaydeb
) MESSAGE("riid=%s,[out]",debugstr_guid((REFIID
)args
[0]));
1165 for (i
=0;i
<fdesc
->cParams
;i
++) {
1166 ELEMDESC
*elem
= fdesc
->lprgelemdescParam
+i
;
1167 BOOL isserialized
= FALSE
;
1169 if (i
) MESSAGE(",");
1170 if (i
+1<nrofnames
&& names
[i
+1])
1171 MESSAGE("%s=",debugstr_w(names
[i
+1]));
1173 /* No need to marshal other data than FIN */
1174 if (!(elem
->u
.paramdesc
.wParamFlags
& PARAMFLAG_FIN
)) {
1175 xargs
+=_argsize(elem
->tdesc
.vt
);
1176 if (relaydeb
) MESSAGE("[out]");
1179 if (((i
+1)<nrofnames
) && !IsBadStringPtrW(names
[i
+1],1)) {
1180 /* If the parameter is 'riid', we use it as interface IID
1181 * for a later ppvObject serialization.
1183 buf
.thisisiid
= !lstrcmpW(names
[i
+1],riidW
);
1185 /* DISPPARAMS* needs special serializer */
1186 if (!lstrcmpW(names
[i
+1],pdispparamsW
)) {
1187 hres
= serialize_DISPPARAM_ptr(
1189 elem
->u
.paramdesc
.wParamFlags
& PARAMFLAG_FIN
,
1196 isserialized
= TRUE
;
1198 if (!lstrcmpW(names
[i
+1],ppvObjectW
)) {
1199 hres
= serialize_LPVOID_ptr(
1201 elem
->u
.paramdesc
.wParamFlags
& PARAMFLAG_FIN
,
1209 isserialized
= TRUE
;
1213 hres
= serialize_param(
1215 elem
->u
.paramdesc
.wParamFlags
& PARAMFLAG_FIN
,
1224 FIXME("Failed to serialize param, hres %lx\n",hres
);
1227 xargs
+=_argsize(elem
->tdesc
.vt
);
1230 if (relaydeb
) MESSAGE(")");
1231 memset(&msg
,0,sizeof(msg
));
1232 msg
.cbBuffer
= buf
.curoff
;
1233 msg
.iMethod
= method
;
1234 hres
= IRpcChannelBuffer_GetBuffer(tpinfo
->chanbuf
,&msg
,&(tpinfo
->iid
));
1236 FIXME("RpcChannelBuffer GetBuffer failed, %lx\n",hres
);
1239 memcpy(msg
.Buffer
,buf
.base
,buf
.curoff
);
1240 if (relaydeb
) MESSAGE("\n");
1241 hres
= IRpcChannelBuffer_SendReceive(tpinfo
->chanbuf
,&msg
,&status
);
1243 FIXME("RpcChannelBuffer SendReceive failed, %lx\n",hres
);
1246 relaydeb
= TRACE_ON(olerelay
);
1247 if (relaydeb
) MESSAGE(" = %08lx (",status
);
1249 buf
.base
= HeapReAlloc(GetProcessHeap(),0,buf
.base
,msg
.cbBuffer
);
1251 buf
.base
= HeapAlloc(GetProcessHeap(),0,msg
.cbBuffer
);
1252 buf
.size
= msg
.cbBuffer
;
1253 memcpy(buf
.base
,msg
.Buffer
,buf
.size
);
1256 _unmarshal_interface(&buf
,(REFIID
)args
[0],(LPUNKNOWN
*)args
[1]);
1257 if (relaydeb
) MESSAGE("[in],%p",*((DWORD
**)args
[1]));
1260 for (i
=0;i
<fdesc
->cParams
;i
++) {
1261 ELEMDESC
*elem
= fdesc
->lprgelemdescParam
+i
;
1262 BOOL isdeserialized
= FALSE
;
1265 if (i
) MESSAGE(",");
1266 if (i
+1<nrofnames
&& names
[i
+1]) MESSAGE("%s=",debugstr_w(names
[i
+1]));
1268 /* No need to marshal other data than FOUT I think */
1269 if (!(elem
->u
.paramdesc
.wParamFlags
& PARAMFLAG_FOUT
)) {
1270 xargs
+= _argsize(elem
->tdesc
.vt
);
1271 if (relaydeb
) MESSAGE("[in]");
1274 if (((i
+1)<nrofnames
) && !IsBadStringPtrW(names
[i
+1],1)) {
1275 /* If the parameter is 'riid', we use it as interface IID
1276 * for a later ppvObject serialization.
1278 buf
.thisisiid
= !lstrcmpW(names
[i
+1],riidW
);
1280 /* deserialize DISPPARAM */
1281 if (!lstrcmpW(names
[i
+1],pdispparamsW
)) {
1282 hres
= deserialize_DISPPARAM_ptr(
1284 elem
->u
.paramdesc
.wParamFlags
& PARAMFLAG_FOUT
,
1292 FIXME("Failed to deserialize DISPPARAM*, hres %lx\n",hres
);
1295 isdeserialized
= TRUE
;
1297 if (!lstrcmpW(names
[i
+1],ppvObjectW
)) {
1298 hres
= deserialize_LPVOID_ptr(
1300 elem
->u
.paramdesc
.wParamFlags
& PARAMFLAG_FOUT
,
1308 isdeserialized
= TRUE
;
1311 if (!isdeserialized
)
1312 hres
= deserialize_param(
1314 elem
->u
.paramdesc
.wParamFlags
& PARAMFLAG_FOUT
,
1322 FIXME("Failed to unmarshall param, hres %lx\n",hres
);
1325 xargs
+= _argsize(elem
->tdesc
.vt
);
1328 if (relaydeb
) MESSAGE(")\n\n");
1329 HeapFree(GetProcessHeap(),0,buf
.base
);
1333 static HRESULT WINAPI
1334 PSFacBuf_CreateProxy(
1335 LPPSFACTORYBUFFER iface
, IUnknown
* pUnkOuter
, REFIID riid
,
1336 IRpcProxyBuffer
**ppProxy
, LPVOID
*ppv
1344 TRACE("(...%s...)\n",debugstr_guid(riid
));
1345 hres
= _get_typeinfo_for_iid(riid
,&tinfo
);
1347 FIXME("No typeinfo for %s?\n",debugstr_guid(riid
));
1350 nroffuncs
= _nroffuncs(tinfo
);
1351 proxy
= HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY
,sizeof(TMProxyImpl
));
1352 if (!proxy
) return E_OUTOFMEMORY
;
1353 proxy
->asmstubs
=HeapAlloc(GetProcessHeap(),0,sizeof(TMAsmProxy
)*nroffuncs
);
1355 assert(sizeof(TMAsmProxy
) == 12);
1357 proxy
->lpvtbl
= HeapAlloc(GetProcessHeap(),0,sizeof(LPBYTE
)*nroffuncs
);
1358 for (i
=0;i
<nroffuncs
;i
++) {
1360 TMAsmProxy
*xasm
= proxy
->asmstubs
+i
;
1362 /* nrofargs without This */
1364 case 0: nrofargs
= 2;
1366 case 1: case 2: nrofargs
= 0;
1370 hres
= _get_funcdesc(tinfo
,i
,&fdesc
,NULL
,NULL
);
1372 FIXME("GetFuncDesc %lx should not fail here.\n",hres
);
1375 /* some args take more than 4 byte on the stack */
1377 for (j
=0;j
<fdesc
->cParams
;j
++)
1378 nrofargs
+= _argsize(fdesc
->lprgelemdescParam
[j
].tdesc
.vt
);
1380 if (fdesc
->callconv
!= CC_STDCALL
) {
1381 ERR("calling convention is not stdcall????\n");
1387 /* popl %eax - return ptr
1394 * arg3 arg2 arg1 <method> <returnptr>
1396 xasm
->popleax
= 0x58;
1397 xasm
->pushlval
= 0x6a;
1399 xasm
->pushleax
= 0x50;
1400 xasm
->lcall
= 0xe8; /* relative jump */
1401 xasm
->xcall
= (DWORD
)xCall
;
1402 xasm
->xcall
-= (DWORD
)&(xasm
->lret
);
1404 xasm
->bytestopop
= (nrofargs
+2)*4; /* pop args, This, iMethod */
1405 proxy
->lpvtbl
[i
] = (DWORD
)xasm
;
1407 proxy
->lpvtbl2
= &tmproxyvtable
;
1409 proxy
->tinfo
= tinfo
;
1410 memcpy(&proxy
->iid
,riid
,sizeof(*riid
));
1411 *ppv
= (LPVOID
)proxy
;
1412 *ppProxy
= (IRpcProxyBuffer
*)&(proxy
->lpvtbl2
);
1416 typedef struct _TMStubImpl
{
1417 ICOM_VTABLE(IRpcStubBuffer
) *lpvtbl
;
1425 static HRESULT WINAPI
1426 TMStubImpl_QueryInterface(LPRPCSTUBBUFFER iface
, REFIID riid
, LPVOID
*ppv
) {
1427 if (IsEqualIID(riid
,&IID_IRpcStubBuffer
)||IsEqualIID(riid
,&IID_IUnknown
)){
1428 *ppv
= (LPVOID
)iface
;
1429 IRpcStubBuffer_AddRef(iface
);
1432 FIXME("%s, not supported IID.\n",debugstr_guid(riid
));
1433 return E_NOINTERFACE
;
1437 TMStubImpl_AddRef(LPRPCSTUBBUFFER iface
) {
1438 ICOM_THIS(TMStubImpl
,iface
);
1445 TMStubImpl_Release(LPRPCSTUBBUFFER iface
) {
1446 ICOM_THIS(TMStubImpl
,iface
);
1451 HeapFree(GetProcessHeap(),0,This
);
1455 static HRESULT WINAPI
1456 TMStubImpl_Connect(LPRPCSTUBBUFFER iface
, LPUNKNOWN pUnkServer
) {
1457 ICOM_THIS(TMStubImpl
,iface
);
1459 IUnknown_AddRef(pUnkServer
);
1460 This
->pUnk
= pUnkServer
;
1465 TMStubImpl_Disconnect(LPRPCSTUBBUFFER iface
) {
1466 ICOM_THIS(TMStubImpl
,iface
);
1468 IUnknown_Release(This
->pUnk
);
1473 static HRESULT WINAPI
1475 LPRPCSTUBBUFFER iface
, RPCOLEMESSAGE
* xmsg
,IRpcChannelBuffer
*rpcchanbuf
1479 ICOM_THIS(TMStubImpl
,iface
);
1481 DWORD
*args
, res
, *xargs
, nrofargs
;
1486 memset(&buf
,0,sizeof(buf
));
1487 buf
.size
= xmsg
->cbBuffer
;
1488 buf
.base
= xmsg
->Buffer
;
1490 buf
.iid
= IID_IUnknown
;
1493 if (xmsg
->iMethod
== 0) { /* QI */
1495 /* in: IID, out: <iface> */
1497 xbuf_get(&buf
,(LPBYTE
)&xiid
,sizeof(xiid
));
1499 hres
= _marshal_interface(&buf
,&xiid
,This
->pUnk
);
1500 xmsg
->Buffer
= buf
.base
; /* Might have been reallocated */
1501 xmsg
->cbBuffer
= buf
.size
;
1504 hres
= _get_funcdesc(This
->tinfo
,xmsg
->iMethod
,&fdesc
,NULL
,NULL
);
1506 FIXME("GetFuncDesc on method %ld failed with %lx\n",xmsg
->iMethod
,hres
);
1509 /* Need them for hack below */
1510 memset(names
,0,sizeof(names
));
1511 ITypeInfo_GetNames(This
->tinfo
,fdesc
->memid
,names
,sizeof(names
)/sizeof(names
[0]),&nrofnames
);
1512 if (nrofnames
> sizeof(names
)/sizeof(names
[0])) {
1513 ERR("Need more names!\n");
1516 /*dump_FUNCDESC(fdesc);*/
1518 for (i
=0;i
<fdesc
->cParams
;i
++)
1519 nrofargs
+= _argsize(fdesc
->lprgelemdescParam
[i
].tdesc
.vt
);
1520 args
= HeapAlloc(GetProcessHeap(),0,(nrofargs
+1)*sizeof(DWORD
));
1521 if (!args
) return E_OUTOFMEMORY
;
1523 /* Allocate all stuff used by call. */
1525 for (i
=0;i
<fdesc
->cParams
;i
++) {
1526 ELEMDESC
*elem
= fdesc
->lprgelemdescParam
+i
;
1527 BOOL isdeserialized
= FALSE
;
1529 if (((i
+1)<nrofnames
) && !IsBadStringPtrW(names
[i
+1],1)) {
1530 /* If the parameter is 'riid', we use it as interface IID
1531 * for a later ppvObject serialization.
1533 buf
.thisisiid
= !lstrcmpW(names
[i
+1],riidW
);
1535 /* deserialize DISPPARAM */
1536 if (!lstrcmpW(names
[i
+1],pdispparamsW
)) {
1537 hres
= deserialize_DISPPARAM_ptr(
1539 elem
->u
.paramdesc
.wParamFlags
& PARAMFLAG_FIN
,
1547 FIXME("Failed to deserialize DISPPARAM*, hres %lx\n",hres
);
1550 isdeserialized
= TRUE
;
1552 if (!lstrcmpW(names
[i
+1],ppvObjectW
)) {
1553 hres
= deserialize_LPVOID_ptr(
1555 elem
->u
.paramdesc
.wParamFlags
& PARAMFLAG_FOUT
,
1563 isdeserialized
= TRUE
;
1566 if (!isdeserialized
)
1567 hres
= deserialize_param(
1569 elem
->u
.paramdesc
.wParamFlags
& PARAMFLAG_FIN
,
1576 xargs
+= _argsize(elem
->tdesc
.vt
);
1578 FIXME("Failed to deserialize param %s, hres %lx\n",debugstr_w(names
[i
+1]),hres
);
1582 hres
= IUnknown_QueryInterface(This
->pUnk
,&(This
->iid
),(LPVOID
*)&(args
[0]));
1584 ERR("Does not support iface %s\n",debugstr_guid(&(This
->iid
)));
1588 (*((FARPROC
**)args
[0]))[fdesc
->oVft
/4],
1593 IUnknown_Release((LPUNKNOWN
)args
[0]);
1596 for (i
=0;i
<fdesc
->cParams
;i
++) {
1597 ELEMDESC
*elem
= fdesc
->lprgelemdescParam
+i
;
1598 BOOL isserialized
= FALSE
;
1600 if (((i
+1)<nrofnames
) && !IsBadStringPtrW(names
[i
+1],1)) {
1601 /* If the parameter is 'riid', we use it as interface IID
1602 * for a later ppvObject serialization.
1604 buf
.thisisiid
= !lstrcmpW(names
[i
+1],riidW
);
1606 /* DISPPARAMS* needs special serializer */
1607 if (!lstrcmpW(names
[i
+1],pdispparamsW
)) {
1608 hres
= serialize_DISPPARAM_ptr(
1610 elem
->u
.paramdesc
.wParamFlags
& PARAMFLAG_FOUT
,
1617 isserialized
= TRUE
;
1619 if (!lstrcmpW(names
[i
+1],ppvObjectW
)) {
1620 hres
= serialize_LPVOID_ptr(
1622 elem
->u
.paramdesc
.wParamFlags
& PARAMFLAG_FOUT
,
1630 isserialized
= TRUE
;
1634 hres
= serialize_param(
1636 elem
->u
.paramdesc
.wParamFlags
& PARAMFLAG_FOUT
,
1643 xargs
+= _argsize(elem
->tdesc
.vt
);
1645 FIXME("Failed to stuballoc param, hres %lx\n",hres
);
1649 /* might need to use IRpcChannelBuffer_GetBuffer ? */
1650 xmsg
->cbBuffer
= buf
.curoff
;
1651 xmsg
->Buffer
= buf
.base
;
1652 HeapFree(GetProcessHeap(),0,args
);
1656 static LPRPCSTUBBUFFER WINAPI
1657 TMStubImpl_IsIIDSupported(LPRPCSTUBBUFFER iface
, REFIID riid
) {
1658 FIXME("Huh (%s)?\n",debugstr_guid(riid
));
1663 TMStubImpl_CountRefs(LPRPCSTUBBUFFER iface
) {
1664 ICOM_THIS(TMStubImpl
,iface
);
1666 return This
->ref
; /*FIXME? */
1669 static HRESULT WINAPI
1670 TMStubImpl_DebugServerQueryInterface(LPRPCSTUBBUFFER iface
, LPVOID
*ppv
) {
1675 TMStubImpl_DebugServerRelease(LPRPCSTUBBUFFER iface
, LPVOID ppv
) {
1679 ICOM_VTABLE(IRpcStubBuffer
) tmstubvtbl
= {
1680 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1681 TMStubImpl_QueryInterface
,
1685 TMStubImpl_Disconnect
,
1687 TMStubImpl_IsIIDSupported
,
1688 TMStubImpl_CountRefs
,
1689 TMStubImpl_DebugServerQueryInterface
,
1690 TMStubImpl_DebugServerRelease
1693 static HRESULT WINAPI
1694 PSFacBuf_CreateStub(
1695 LPPSFACTORYBUFFER iface
, REFIID riid
,IUnknown
*pUnkServer
,
1696 IRpcStubBuffer
** ppStub
1702 TRACE("(%s,%p,%p)\n",debugstr_guid(riid
),pUnkServer
,ppStub
);
1703 hres
= _get_typeinfo_for_iid(riid
,&tinfo
);
1705 FIXME("No typeinfo for %s?\n",debugstr_guid(riid
));
1708 stub
= HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY
,sizeof(TMStubImpl
));
1710 return E_OUTOFMEMORY
;
1711 stub
->lpvtbl
= &tmstubvtbl
;
1713 stub
->tinfo
= tinfo
;
1714 memcpy(&(stub
->iid
),riid
,sizeof(*riid
));
1715 hres
= IRpcStubBuffer_Connect((LPRPCSTUBBUFFER
)stub
,pUnkServer
);
1716 *ppStub
= (LPRPCSTUBBUFFER
)stub
;
1718 FIXME("Connect to pUnkServer failed?\n");
1722 static ICOM_VTABLE(IPSFactoryBuffer
) psfacbufvtbl
= {
1723 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1724 PSFacBuf_QueryInterface
,
1727 PSFacBuf_CreateProxy
,
1731 /* This is the whole PSFactoryBuffer object, just the vtableptr */
1732 static ICOM_VTABLE(IPSFactoryBuffer
) *lppsfac
= &psfacbufvtbl
;
1734 /***********************************************************************
1735 * DllGetClassObject [OLE32.63]
1738 TypeLibFac_DllGetClassObject(REFCLSID rclsid
, REFIID iid
,LPVOID
*ppv
)
1740 if (IsEqualIID(iid
,&IID_IPSFactoryBuffer
)) {
1744 return E_NOINTERFACE
;