Huw Davies : rpcrt4: Add a helper function to create a stub.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Aug 29 07:19:34 CDT 2006


Module: wine
Branch: master
Commit: 161f60071e652f9083a63b01297a3552f58994e7
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=161f60071e652f9083a63b01297a3552f58994e7

Author: Huw Davies <huw at codeweavers.com>
Date:   Mon Aug 28 19:05:36 2006 +0100

rpcrt4: Add a helper function to create a stub.

---

 dlls/rpcrt4/cpsf.h    |    2 ++
 dlls/rpcrt4/ndr_ole.c |   26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/dlls/rpcrt4/cpsf.h b/dlls/rpcrt4/cpsf.h
index df8aced..9c3d917 100644
--- a/dlls/rpcrt4/cpsf.h
+++ b/dlls/rpcrt4/cpsf.h
@@ -44,4 +44,6 @@ const MIDL_SERVER_INFO *CStdStubBuffer_G
 
 const IRpcStubBufferVtbl CStdStubBuffer_Vtbl;
 
+HRESULT create_stub(REFIID iid, IUnknown *pUnk, IRpcStubBuffer **ppstub);
+
 #endif  /* __WINE_CPSF_H */
diff --git a/dlls/rpcrt4/ndr_ole.c b/dlls/rpcrt4/ndr_ole.c
index 0f64edd..2e4c67b 100644
--- a/dlls/rpcrt4/ndr_ole.c
+++ b/dlls/rpcrt4/ndr_ole.c
@@ -39,7 +39,9 @@ #include "objbase.h"
 
 #include "ndr_misc.h"
 #include "rpcndr.h"
+#include "rpcproxy.h"
 #include "wine/rpcfc.h"
+#include "cpsf.h"
 
 #include "wine/debug.h"
 
@@ -364,3 +366,27 @@ void WINAPI NdrOleFree(void *NodeToFree)
   if (!LoadCOM()) return;
   COM_MemFree(NodeToFree);
 }
+
+/***********************************************************************
+ * Helper function to create a stub.
+ * This probably looks very much like NdrpCreateStub.
+ */
+HRESULT create_stub(REFIID iid, IUnknown *pUnk, IRpcStubBuffer **ppstub)
+{
+    CLSID clsid;
+    IPSFactoryBuffer *psfac;
+    HRESULT r;
+
+    if(!LoadCOM()) return E_FAIL;
+
+    r = COM_GetPSClsid( iid, &clsid );
+    if(FAILED(r)) return r;
+
+    r = COM_GetClassObject( &clsid, CLSCTX_INPROC_SERVER, NULL, &IID_IPSFactoryBuffer, (void**)&psfac );
+    if(FAILED(r)) return r;
+
+    r = IPSFactoryBuffer_CreateStub(psfac, iid, pUnk, ppstub);
+
+    IPSFactoryBuffer_Release(psfac);
+    return r;
+}




More information about the wine-cvs mailing list