rpcrt4: Add a stub implementation of CreateStubFromTypeInfo().

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2018-11-03 18:07:14 -05:00 committed by Alexandre Julliard
parent 12021a565a
commit 57493dc224
2 changed files with 36 additions and 21 deletions

View File

@ -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;
}

View File

@ -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;
}