From 57493dc224fcfcb0cffc2894cf8c9522e8de8c5d Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 3 Nov 2018 18:07:14 -0500 Subject: [PATCH] rpcrt4: Add a stub implementation of CreateStubFromTypeInfo(). Signed-off-by: Zebediah Figura Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- 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 7ca05e72483..6f15ed564d5 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 13075ac571a..c0db6b78fff 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; +} -- 2.11.4.GIT