Zebediah Figura : rpcrt4: Add a stub implementation of CreateStubFromTypeInfo().
Alexandre Julliard
julliard at winehq.org
Thu Nov 8 14:47:26 CST 2018
Module: wine
Branch: master
Commit: 57493dc224fcfcb0cffc2894cf8c9522e8de8c5d
URL: https://source.winehq.org/git/wine.git/?a=commit;h=57493dc224fcfcb0cffc2894cf8c9522e8de8c5d
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Sat Nov 3 18:07:14 2018 -0500
rpcrt4: Add a stub implementation of CreateStubFromTypeInfo().
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/rpcrt4/cproxy.c | 21 ---------------------
dlls/rpcrt4/ndr_typelib.c | 36 ++++++++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+), 21 deletions(-)
diff --git a/dlls/rpcrt4/cproxy.c b/dlls/rpcrt4/cproxy.c
index 7ca05e7..6f15ed5 100644
--- a/dlls/rpcrt4/cproxy.c
+++ b/dlls/rpcrt4/cproxy.c
@@ -512,24 +512,3 @@ HRESULT WINAPI NdrProxyErrorHandler(DWORD dwExceptionCode)
else
return HRESULT_FROM_WIN32(dwExceptionCode);
}
-
-HRESULT WINAPI
-CreateStubFromTypeInfo(ITypeInfo *pTypeInfo, REFIID riid, IUnknown *pUnkServer,
- IRpcStubBuffer **ppStub )
-{
- typedef INT (WINAPI *MessageBoxA)(HWND,LPCSTR,LPCSTR,UINT);
- HMODULE hUser32 = LoadLibraryA("user32");
- MessageBoxA pMessageBoxA = (void *)GetProcAddress(hUser32, "MessageBoxA");
-
- FIXME("%p %s %p %p\n", pTypeInfo, debugstr_guid(riid), pUnkServer, ppStub);
- if (pMessageBoxA)
- {
- pMessageBoxA(NULL,
- "The native implementation of OLEAUT32.DLL cannot be used "
- "with Wine's RPCRT4.DLL. Remove OLEAUT32.DLL and try again.\n",
- "Wine: Unimplemented CreateProxyFromTypeInfo",
- 0x10);
- ExitProcess(1);
- }
- return E_NOTIMPL;
-}
diff --git a/dlls/rpcrt4/ndr_typelib.c b/dlls/rpcrt4/ndr_typelib.c
index 13075ac..c0db6b7 100644
--- a/dlls/rpcrt4/ndr_typelib.c
+++ b/dlls/rpcrt4/ndr_typelib.c
@@ -91,3 +91,39 @@ HRESULT WINAPI CreateProxyFromTypeInfo(ITypeInfo *typeinfo, IUnknown *outer,
return hr;
}
+
+struct typelib_stub
+{
+ CStdStubBuffer stub;
+};
+
+static HRESULT typelib_stub_init(struct typelib_stub *stub, IUnknown *server,
+ IRpcStubBuffer **stub_buffer)
+{
+ stub->stub.RefCount = 1;
+ *stub_buffer = (IRpcStubBuffer *)&stub->stub;
+
+ return E_NOTIMPL;
+}
+
+HRESULT WINAPI CreateStubFromTypeInfo(ITypeInfo *typeinfo, REFIID iid,
+ IUnknown *server, IRpcStubBuffer **stub_buffer)
+{
+ struct typelib_stub *stub;
+ HRESULT hr;
+
+ TRACE("typeinfo %p, iid %s, server %p, stub_buffer %p.\n",
+ typeinfo, debugstr_guid(iid), server, stub_buffer);
+
+ if (!(stub = heap_alloc_zero(sizeof(*stub))))
+ {
+ ERR("Failed to allocate stub object.\n");
+ return E_OUTOFMEMORY;
+ }
+
+ hr = typelib_stub_init(stub, server, stub_buffer);
+ if (FAILED(hr))
+ heap_free(stub);
+
+ return hr;
+}
More information about the wine-cvs
mailing list