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
40 #include "wine/unicode.h"
41 #include "wine/winbase16.h"
42 #include "compobj_private.h"
45 #include "wine/debug.h"
47 WINE_DEFAULT_DEBUG_CHANNEL(ole
);
49 extern const CLSID CLSID_DfMarshal
;
51 /* Marshalling just passes a unique identifier to the remote client,
52 * that makes it possible to find the passed interface again.
54 * So basically we need a set of values that make it unique.
56 * Process Identifier, Object IUnknown ptr, IID
58 * Note that the IUnknown_QI(ob,xiid,&ppv) always returns the SAME ppv value!
62 get_facbuf_for_iid(REFIID riid
,IPSFactoryBuffer
**facbuf
) {
66 if ((hres
= CoGetPSClsid(riid
,&pxclsid
)))
68 return CoGetClassObject(&pxclsid
,CLSCTX_INPROC_SERVER
,NULL
,&IID_IPSFactoryBuffer
,(LPVOID
*)facbuf
);
71 typedef struct _wine_marshal_data
{
76 typedef struct _mid2unknown
{
81 typedef struct _mid2stub
{
88 static mid2stub
*stubs
= NULL
;
89 static int nrofstubs
= 0;
91 static mid2unknown
*proxies
= NULL
;
92 static int nrofproxies
= 0;
95 MARSHAL_Find_Stub_Server(wine_marshal_id
*mid
,LPUNKNOWN
*punk
) {
98 for (i
=0;i
<nrofstubs
;i
++) {
99 if (!stubs
[i
].valid
) continue;
101 if (MARSHAL_Compare_Mids_NoInterface(mid
,&(stubs
[i
].mid
))) {
102 *punk
= stubs
[i
].pUnkServer
;
103 IUnknown_AddRef((*punk
));
111 MARSHAL_Find_Stub_Buffer(wine_marshal_id
*mid
,IRpcStubBuffer
**stub
) {
114 for (i
=0;i
<nrofstubs
;i
++) {
115 if (!stubs
[i
].valid
) continue;
117 if (MARSHAL_Compare_Mids(mid
,&(stubs
[i
].mid
))) {
118 *stub
= stubs
[i
].stub
;
119 IUnknown_AddRef((*stub
));
127 MARSHAL_Find_Stub(wine_marshal_id
*mid
,LPUNKNOWN
*pUnk
) {
130 for (i
=0;i
<nrofstubs
;i
++) {
131 if (!stubs
[i
].valid
) continue;
133 if (MARSHAL_Compare_Mids(mid
,&(stubs
[i
].mid
))) {
134 *pUnk
= stubs
[i
].pUnkServer
;
135 IUnknown_AddRef((*pUnk
));
143 MARSHAL_Register_Stub(wine_marshal_id
*mid
,LPUNKNOWN pUnk
,IRpcStubBuffer
*stub
) {
145 if (!MARSHAL_Find_Stub(mid
,&xPunk
)) {
146 FIXME("Already have entry for (%lx/%s)!\n",mid
->objectid
,debugstr_guid(&(mid
->iid
)));
150 stubs
=HeapReAlloc(GetProcessHeap(),0,stubs
,sizeof(stubs
[0])*(nrofstubs
+1));
152 stubs
=HeapAlloc(GetProcessHeap(),0,sizeof(stubs
[0]));
153 if (!stubs
) return E_OUTOFMEMORY
;
154 stubs
[nrofstubs
].stub
= stub
;
155 stubs
[nrofstubs
].pUnkServer
= pUnk
;
156 memcpy(&(stubs
[nrofstubs
].mid
),mid
,sizeof(*mid
));
157 stubs
[nrofstubs
].valid
= TRUE
; /* set to false when released by ReleaseMarshalData */
163 MARSHAL_Find_Proxy(wine_marshal_id
*mid
,LPUNKNOWN
*punk
) {
166 for (i
=0;i
<nrofproxies
;i
++)
167 if (MARSHAL_Compare_Mids(mid
,&(proxies
[i
].mid
))) {
168 *punk
= proxies
[i
].pUnk
;
169 IUnknown_AddRef((*punk
));
176 MARSHAL_Find_Proxy_Object(wine_marshal_id
*mid
,LPUNKNOWN
*punk
) {
179 for (i
=0;i
<nrofproxies
;i
++)
180 if (MARSHAL_Compare_Mids_NoInterface(mid
,&(proxies
[i
].mid
))) {
181 *punk
= proxies
[i
].pUnk
;
182 IUnknown_AddRef((*punk
));
189 MARSHAL_Register_Proxy(wine_marshal_id
*mid
,LPUNKNOWN punk
) {
192 for (i
=0;i
<nrofproxies
;i
++) {
193 if (MARSHAL_Compare_Mids(mid
,&(proxies
[i
].mid
))) {
194 ERR("Already have mid?\n");
199 proxies
= HeapReAlloc(GetProcessHeap(),0,proxies
,sizeof(proxies
[0])*(nrofproxies
+1));
201 proxies
= HeapAlloc(GetProcessHeap(),0,sizeof(proxies
[0]));
202 memcpy(&(proxies
[nrofproxies
].mid
),mid
,sizeof(*mid
));
203 proxies
[nrofproxies
].pUnk
= punk
;
205 IUnknown_AddRef(punk
);
209 /********************** StdMarshal implementation ****************************/
210 typedef struct _StdMarshalImpl
{
211 ICOM_VTABLE(IMarshal
) *lpvtbl
;
216 LPVOID pvDestContext
;
221 StdMarshalImpl_QueryInterface(LPMARSHAL iface
,REFIID riid
,LPVOID
*ppv
) {
223 if (IsEqualIID(&IID_IUnknown
,riid
) || IsEqualIID(&IID_IMarshal
,riid
)) {
225 IUnknown_AddRef(iface
);
228 FIXME("No interface for %s.\n",debugstr_guid(riid
));
229 return E_NOINTERFACE
;
233 StdMarshalImpl_AddRef(LPMARSHAL iface
) {
234 ICOM_THIS(StdMarshalImpl
,iface
);
240 StdMarshalImpl_Release(LPMARSHAL iface
) {
241 ICOM_THIS(StdMarshalImpl
,iface
);
246 HeapFree(GetProcessHeap(),0,This
);
251 StdMarshalImpl_GetUnmarshalClass(
252 LPMARSHAL iface
, REFIID riid
, void* pv
, DWORD dwDestContext
,
253 void* pvDestContext
, DWORD mshlflags
, CLSID
* pCid
255 memcpy(pCid
,&CLSID_DfMarshal
,sizeof(CLSID_DfMarshal
));
260 StdMarshalImpl_GetMarshalSizeMax(
261 LPMARSHAL iface
, REFIID riid
, void* pv
, DWORD dwDestContext
,
262 void* pvDestContext
, DWORD mshlflags
, DWORD
* pSize
264 *pSize
= sizeof(wine_marshal_id
)+sizeof(wine_marshal_data
);
269 StdMarshalImpl_MarshalInterface(
270 LPMARSHAL iface
, IStream
*pStm
,REFIID riid
, void* pv
, DWORD dwDestContext
,
271 void* pvDestContext
, DWORD mshlflags
274 wine_marshal_data md
;
278 IRpcStubBuffer
*stub
;
279 IPSFactoryBuffer
*psfacbuf
;
281 TRACE("(...,%s,...)\n",debugstr_guid(riid
));
283 IUnknown_QueryInterface((LPUNKNOWN
)pv
,&IID_IUnknown
,(LPVOID
*)&pUnk
);
284 mid
.processid
= GetCurrentProcessId();
285 mid
.objectid
= (DWORD
)pUnk
; /* FIXME */
286 IUnknown_Release(pUnk
);
287 memcpy(&mid
.iid
,riid
,sizeof(mid
.iid
));
288 md
.dwDestContext
= dwDestContext
;
289 md
.mshlflags
= mshlflags
;
290 hres
= IStream_Write(pStm
,&mid
,sizeof(mid
),&res
);
291 if (hres
) return hres
;
292 hres
= IStream_Write(pStm
,&md
,sizeof(md
),&res
);
293 if (hres
) return hres
;
295 if (SUCCEEDED(MARSHAL_Find_Stub_Buffer(&mid
,&stub
))) {
296 /* Find_Stub_Buffer gives us a ref but we want to keep it, as if we'd created a new one */
297 TRACE("Found RpcStubBuffer %p\n", stub
);
300 hres
= get_facbuf_for_iid(riid
,&psfacbuf
);
301 if (hres
) return hres
;
303 hres
= IPSFactoryBuffer_CreateStub(psfacbuf
,riid
,pv
,&stub
);
304 IPSFactoryBuffer_Release(psfacbuf
);
306 FIXME("Failed to create a stub for %s\n",debugstr_guid(riid
));
309 IUnknown_QueryInterface((LPUNKNOWN
)pv
,riid
,(LPVOID
*)&pUnk
);
310 MARSHAL_Register_Stub(&mid
,pUnk
,stub
);
311 IUnknown_Release(pUnk
);
316 StdMarshalImpl_UnmarshalInterface(
317 LPMARSHAL iface
, IStream
*pStm
, REFIID riid
, void **ppv
320 wine_marshal_data md
;
323 IPSFactoryBuffer
*psfacbuf
;
324 IRpcProxyBuffer
*rpcproxy
;
325 IRpcChannelBuffer
*chanbuf
;
327 TRACE("(...,%s,....)\n",debugstr_guid(riid
));
328 hres
= IStream_Read(pStm
,&mid
,sizeof(mid
),&res
);
329 if (hres
) return hres
;
330 hres
= IStream_Read(pStm
,&md
,sizeof(md
),&res
);
331 if (hres
) return hres
;
332 if (SUCCEEDED(MARSHAL_Find_Stub(&mid
,(LPUNKNOWN
*)ppv
))) {
333 FIXME("Calling back to ourselves for %s!\n",debugstr_guid(riid
));
336 hres
= get_facbuf_for_iid(riid
,&psfacbuf
);
337 if (hres
) return hres
;
338 hres
= IPSFactoryBuffer_CreateProxy(psfacbuf
,NULL
,riid
,&rpcproxy
,ppv
);
340 FIXME("Failed to create a proxy for %s\n",debugstr_guid(riid
));
343 hres
= PIPE_GetNewPipeBuf(&mid
,&chanbuf
);
344 IPSFactoryBuffer_Release(psfacbuf
);
346 ERR("Failed to get an rpc channel buffer for %s\n",debugstr_guid(riid
));
348 /* Connect the channel buffer to the proxy and release the no longer
350 * NOTE: The proxy should have taken an extra reference because it also
351 * aggregates the object, so we can safely release our reference to it. */
352 IRpcProxyBuffer_Connect(rpcproxy
,chanbuf
);
353 IRpcProxyBuffer_Release(rpcproxy
);
354 /* IRpcProxyBuffer takes a reference on the channel buffer and
355 * we no longer need it, so release it */
356 IRpcChannelBuffer_Release(chanbuf
);
362 StdMarshalImpl_ReleaseMarshalData(LPMARSHAL iface
, IStream
*pStm
) {
366 IRpcStubBuffer
*stub
= NULL
;
369 hres
= IStream_Read(pStm
,&mid
,sizeof(mid
),&res
);
370 if (hres
) return hres
;
372 for (i
=0; i
< nrofstubs
; i
++)
374 if (!stubs
[i
].valid
) continue;
376 if (MARSHAL_Compare_Mids(&mid
, &(stubs
[i
].mid
)))
378 stub
= stubs
[i
].stub
;
385 FIXME("Could not map MID to stub??\n");
389 res
= IRpcStubBuffer_Release(stub
);
390 stubs
[i
].valid
= FALSE
;
391 TRACE("stub refcount of %p is %ld\n", stub
, res
);
397 StdMarshalImpl_DisconnectObject(LPMARSHAL iface
, DWORD dwReserved
) {
398 FIXME("(), stub!\n");
402 ICOM_VTABLE(IMarshal
) stdmvtbl
= {
403 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
404 StdMarshalImpl_QueryInterface
,
405 StdMarshalImpl_AddRef
,
406 StdMarshalImpl_Release
,
407 StdMarshalImpl_GetUnmarshalClass
,
408 StdMarshalImpl_GetMarshalSizeMax
,
409 StdMarshalImpl_MarshalInterface
,
410 StdMarshalImpl_UnmarshalInterface
,
411 StdMarshalImpl_ReleaseMarshalData
,
412 StdMarshalImpl_DisconnectObject
415 /***********************************************************************
416 * CoGetStandardMarshal [OLE32.@]
418 * When the COM library in the client process receives a marshalled
419 * interface pointer, it looks for a CLSID to be used in creating a proxy
420 * for the purposes of unmarshalling the packet. If the packet does not
421 * contain a CLSID for the proxy, COM calls CoGetStandardMarshal, passing a
423 * This function creates a standard proxy in the client process and returns
424 * a pointer to that proxy's implementation of IMarshal.
425 * COM uses this pointer to call CoUnmarshalInterface to retrieve the pointer
426 * to the requested interface.
429 CoGetStandardMarshal(
430 REFIID riid
,IUnknown
*pUnk
,DWORD dwDestContext
,LPVOID pvDestContext
,
431 DWORD mshlflags
, LPMARSHAL
*pMarshal
436 FIXME("(%s,NULL,%lx,%p,%lx,%p), unimplemented yet.\n",
437 debugstr_guid(riid
),dwDestContext
,pvDestContext
,mshlflags
,pMarshal
441 TRACE("(%s,%p,%lx,%p,%lx,%p)\n",
442 debugstr_guid(riid
),pUnk
,dwDestContext
,pvDestContext
,mshlflags
,pMarshal
444 *pMarshal
= HeapAlloc(GetProcessHeap(),0,sizeof(StdMarshalImpl
));
445 dm
= (StdMarshalImpl
*) *pMarshal
;
446 if (!dm
) return E_FAIL
;
447 dm
->lpvtbl
= &stdmvtbl
;
450 memcpy(&dm
->iid
,riid
,sizeof(dm
->iid
));
451 dm
->dwDestContext
= dwDestContext
;
452 dm
->pvDestContext
= pvDestContext
;
453 dm
->mshlflags
= mshlflags
;
457 /* Helper function for getting Marshaler */
458 static HRESULT WINAPI
459 _GetMarshaller(REFIID riid
, IUnknown
*pUnk
,DWORD dwDestContext
,
460 void *pvDestContext
, DWORD mshlFlags
, LPMARSHAL
*pMarshal
466 hres
= IUnknown_QueryInterface(pUnk
,&IID_IMarshal
,(LPVOID
*)pMarshal
);
468 hres
= CoGetStandardMarshal(riid
,pUnk
,dwDestContext
,pvDestContext
,mshlFlags
,pMarshal
);
472 /***********************************************************************
473 * CoGetMarshalSizeMax [OLE32.@]
476 CoGetMarshalSizeMax(ULONG
*pulSize
, REFIID riid
, IUnknown
*pUnk
,
477 DWORD dwDestContext
, void *pvDestContext
, DWORD mshlFlags
482 hres
= _GetMarshaller(riid
,pUnk
,dwDestContext
,pvDestContext
,mshlFlags
,&pMarshal
);
485 hres
= IMarshal_GetMarshalSizeMax(pMarshal
,riid
,pUnk
,dwDestContext
,pvDestContext
,mshlFlags
,pulSize
);
486 *pulSize
+= sizeof(wine_marshal_id
)+sizeof(wine_marshal_data
)+sizeof(CLSID
);
487 IMarshal_Release(pMarshal
);
492 /***********************************************************************
493 * CoMarshalInterface [OLE32.@]
496 CoMarshalInterface( IStream
*pStm
, REFIID riid
, IUnknown
*pUnk
,
497 DWORD dwDestContext
, void *pvDestContext
, DWORD mshlflags
504 wine_marshal_data md
;
508 TRACE("(%p, %s, %p, %lx, %p, %lx)\n",
509 pStm
,debugstr_guid(riid
),pUnk
,dwDestContext
,pvDestContext
,mshlflags
515 STUBMGR_Start(); /* Just to be sure we have one running. */
516 mid
.processid
= GetCurrentProcessId();
517 IUnknown_QueryInterface(pUnk
,&IID_IUnknown
,(LPVOID
*)&pUnknown
);
518 mid
.objectid
= (DWORD
)pUnknown
;
519 IUnknown_Release(pUnknown
);
520 memcpy(&mid
.iid
,riid
,sizeof(mid
.iid
));
521 md
.dwDestContext
= dwDestContext
;
522 md
.mshlflags
= mshlflags
;
523 hres
= IStream_Write(pStm
,&mid
,sizeof(mid
),&res
);
524 if (hres
) return hres
;
525 hres
= IStream_Write(pStm
,&md
,sizeof(md
),&res
);
526 if (hres
) return hres
;
527 hres
= _GetMarshaller(riid
,pUnk
,dwDestContext
,pvDestContext
,mshlflags
,&pMarshal
);
529 FIXME("Failed to get marshaller, %lx?\n",hres
);
532 hres
= IMarshal_GetUnmarshalClass(pMarshal
,riid
,pUnk
,dwDestContext
,pvDestContext
,mshlflags
,&xclsid
);
534 FIXME("IMarshal:GetUnmarshalClass failed, %lx\n",hres
);
535 goto release_marshal
;
537 hres
= IStream_Write(pStm
,&xclsid
,sizeof(xclsid
),&writeres
);
539 FIXME("Stream write failed, %lx\n",hres
);
540 goto release_marshal
;
543 TRACE("Calling IMarshal::MarshalInterace\n");
544 hres
= IMarshal_MarshalInterface(pMarshal
,pStm
,riid
,pUnk
,dwDestContext
,pvDestContext
,mshlflags
);
547 if (IsEqualGUID(riid
,&IID_IOleObject
)) {
548 ERR("WINE currently cannot marshal IOleObject interfaces. This means you cannot embed/link OLE objects between applications.\n");
550 FIXME("Failed to marshal the interface %s, %lx?\n",debugstr_guid(riid
),hres
);
554 IMarshal_Release(pMarshal
);
559 /***********************************************************************
560 * CoUnmarshalInterface [OLE32.@]
563 CoUnmarshalInterface(IStream
*pStm
, REFIID riid
, LPVOID
*ppv
) {
566 wine_marshal_data md
;
572 TRACE("(%p,%s,%p)\n",pStm
,debugstr_guid(riid
),ppv
);
574 hres
= IStream_Read(pStm
,&mid
,sizeof(mid
),&res
);
576 FIXME("Stream read 1 failed, %lx, (%ld of %d)\n",hres
,res
,sizeof(mid
));
579 hres
= IStream_Read(pStm
,&md
,sizeof(md
),&res
);
581 FIXME("Stream read 2 failed, %lx, (%ld of %d)\n",hres
,res
,sizeof(md
));
584 hres
= IStream_Read(pStm
,&xclsid
,sizeof(xclsid
),&res
);
586 FIXME("Stream read 3 failed, %lx, (%ld of %d)\n",hres
,res
,sizeof(xclsid
));
589 hres
=CoCreateInstance(&xclsid
,NULL
,CLSCTX_INPROC_SERVER
| CLSCTX_INPROC_HANDLER
| CLSCTX_LOCAL_SERVER
,&IID_IMarshal
,(void**)&pUnk
);
591 FIXME("Failed to create instance of unmarshaller %s.\n",debugstr_guid(&xclsid
));
594 hres
= _GetMarshaller(riid
,pUnk
,md
.dwDestContext
,NULL
,md
.mshlflags
,&pMarshal
);
596 FIXME("Failed to get unmarshaller, %lx?\n",hres
);
599 hres
= IMarshal_UnmarshalInterface(pMarshal
,pStm
,riid
,ppv
);
601 FIXME("Failed to Unmarshal the interface, %lx?\n",hres
);
602 goto release_marshal
;
605 IMarshal_Release(pMarshal
);
609 /***********************************************************************
610 * CoReleaseMarshalData [OLE32.@]
613 CoReleaseMarshalData(IStream
*pStm
) {
616 wine_marshal_data md
;
622 TRACE("(%p)\n",pStm
);
624 hres
= IStream_Read(pStm
,&mid
,sizeof(mid
),&res
);
626 FIXME("Stream read 1 failed, %lx, (%ld of %d)\n",hres
,res
,sizeof(mid
));
629 hres
= IStream_Read(pStm
,&md
,sizeof(md
),&res
);
631 FIXME("Stream read 2 failed, %lx, (%ld of %d)\n",hres
,res
,sizeof(md
));
634 hres
= IStream_Read(pStm
,&xclsid
,sizeof(xclsid
),&res
);
636 FIXME("Stream read 3 failed, %lx, (%ld of %d)\n",hres
,res
,sizeof(xclsid
));
639 hres
=CoCreateInstance(&xclsid
,NULL
,CLSCTX_INPROC_SERVER
| CLSCTX_INPROC_HANDLER
| CLSCTX_LOCAL_SERVER
,&IID_IMarshal
,(void**)(char*)&pUnk
);
641 FIXME("Failed to create instance of unmarshaller %s.\n",debugstr_guid(&xclsid
));
644 hres
= IUnknown_QueryInterface(pUnk
,&IID_IMarshal
,(LPVOID
*)(char*)&pMarshal
);
646 FIXME("Failed to get IMarshal iface, %lx?\n",hres
);
649 hres
= IMarshal_ReleaseMarshalData(pMarshal
,pStm
);
651 FIXME("Failed to releasemarshaldata the interface, %lx?\n",hres
);
653 IMarshal_Release(pMarshal
);
654 IUnknown_Release(pUnk
);
659 /***********************************************************************
660 * CoMarshalInterThreadInterfaceInStream [OLE32.@]
662 * Marshal an interface across threads in the same process.
665 * riid [I] Identifier of the interface to be marshalled.
666 * pUnk [I] Pointer to IUnknown-derived interface that will be marshalled.
667 * ppStm [O] Pointer to IStream object that is created and then used to store the marshalled inteface.
671 * Failure: E_OUTOFMEMORY and other COM error codes
674 * CoMarshalInterface(), CoUnmarshalInterface() and CoGetInterfaceAndReleaseStream()
677 CoMarshalInterThreadInterfaceInStream(
678 REFIID riid
, LPUNKNOWN pUnk
, LPSTREAM
* ppStm
)
681 LARGE_INTEGER seekto
;
684 TRACE("(%s, %p, %p)\n",debugstr_guid(riid
), pUnk
, ppStm
);
686 hres
= CreateStreamOnHGlobal(0, TRUE
, ppStm
);
687 if (FAILED(hres
)) return hres
;
688 hres
= CoMarshalInterface(*ppStm
, riid
, pUnk
, MSHCTX_INPROC
, NULL
, MSHLFLAGS_NORMAL
);
690 /* FIXME: is this needed? */
691 memset(&seekto
,0,sizeof(seekto
));
692 IStream_Seek(*ppStm
,seekto
,SEEK_SET
,&xpos
);
697 /***********************************************************************
698 * CoGetInterfaceAndReleaseStream [OLE32.@]
700 * Unmarshalls an inteface from a stream and then releases the stream.
703 * pStm [I] Stream that contains the marshalled inteface.
704 * riid [I] Interface identifier of the object to unmarshall.
705 * ppv [O] Address of pointer where the requested interface object will be stored.
709 * Failure: A COM error code
712 * CoMarshalInterThreadInterfaceInStream() and CoUnmarshalInteface()
715 CoGetInterfaceAndReleaseStream(LPSTREAM pStm
,REFIID riid
, LPVOID
*ppv
)
719 TRACE("(%p, %s, %p)\n", pStm
, debugstr_guid(riid
), ppv
);
721 hres
= CoUnmarshalInterface(pStm
, riid
, ppv
);
722 IStream_Release(pStm
);
726 static HRESULT WINAPI
727 SMCF_QueryInterface(LPCLASSFACTORY iface
,REFIID riid
, LPVOID
*ppv
) {
729 if (IsEqualIID(riid
,&IID_IUnknown
) || IsEqualIID(riid
,&IID_IClassFactory
)) {
730 *ppv
= (LPVOID
)iface
;
733 return E_NOINTERFACE
;
735 static ULONG WINAPI
SMCF_AddRef(LPCLASSFACTORY iface
) { return 2; }
736 static ULONG WINAPI
SMCF_Release(LPCLASSFACTORY iface
) { return 1; }
738 static HRESULT WINAPI
740 LPCLASSFACTORY iface
, LPUNKNOWN pUnk
, REFIID riid
, LPVOID
*ppv
742 if (IsEqualIID(riid
,&IID_IMarshal
)) {
744 dm
=(StdMarshalImpl
*)HeapAlloc(GetProcessHeap(),0,sizeof(StdMarshalImpl
));
747 dm
->lpvtbl
= &stdmvtbl
;
752 FIXME("(%s), not supported.\n",debugstr_guid(riid
));
753 return E_NOINTERFACE
;
756 static HRESULT WINAPI
757 SMCF_LockServer(LPCLASSFACTORY iface
, BOOL fLock
) {
758 FIXME("(%d), stub!\n",fLock
);
762 static ICOM_VTABLE(IClassFactory
) dfmarshalcfvtbl
= {
763 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
770 static ICOM_VTABLE(IClassFactory
) *pdfmarshalcfvtbl
= &dfmarshalcfvtbl
;
773 MARSHAL_GetStandardMarshalCF(LPVOID
*ppv
) {
774 *ppv
= &pdfmarshalcfvtbl
;