From 94ee4096ec4459105e8f22d39be843ae65980420 Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Fri, 9 Oct 2015 11:13:24 +0100 Subject: [PATCH] ole32: Add a stub for OleCreateFromFileEx. Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- dlls/ole32/compobj_private.h | 2 ++ dlls/ole32/datacache.c | 2 +- dlls/ole32/ole2impl.c | 31 +++++++++++++++++++++++++++++++ dlls/ole32/ole2stubs.c | 11 ----------- dlls/ole32/ole32.spec | 4 ++-- include/ole2.h | 3 +++ 6 files changed, 39 insertions(+), 14 deletions(-) diff --git a/dlls/ole32/compobj_private.h b/dlls/ole32/compobj_private.h index c63d6457a72..857943ada12 100644 --- a/dlls/ole32/compobj_private.h +++ b/dlls/ole32/compobj_private.h @@ -315,6 +315,8 @@ extern LSTATUS open_classes_key(HKEY, const WCHAR *, REGSAM, HKEY *) DECLSPEC_HI extern BOOL actctx_get_miscstatus(const CLSID*, DWORD, DWORD*) DECLSPEC_HIDDEN; +extern const char *debugstr_formatetc(const FORMATETC *formatetc) DECLSPEC_HIDDEN; + static inline void *heap_alloc(size_t len) { return HeapAlloc(GetProcessHeap(), 0, len); diff --git a/dlls/ole32/datacache.c b/dlls/ole32/datacache.c index 1076a37d4a5..2e2478a2c21 100644 --- a/dlls/ole32/datacache.c +++ b/dlls/ole32/datacache.c @@ -216,7 +216,7 @@ static inline DataCache *impl_from_IAdviseSink( IAdviseSink *iface ) return CONTAINING_RECORD(iface, DataCache, IAdviseSink_iface); } -static const char * debugstr_formatetc(const FORMATETC *formatetc) +const char *debugstr_formatetc(const FORMATETC *formatetc) { return wine_dbg_sprintf("{ cfFormat = 0x%x, ptd = %p, dwAspect = %d, lindex = %d, tymed = %d }", formatetc->cfFormat, formatetc->ptd, formatetc->dwAspect, diff --git a/dlls/ole32/ole2impl.c b/dlls/ole32/ole2impl.c index 4be79a7f71c..71b01455254 100644 --- a/dlls/ole32/ole2impl.c +++ b/dlls/ole32/ole2impl.c @@ -232,6 +232,37 @@ HRESULT WINAPI OleCreateStaticFromData(IDataObject *data, REFIID iid, return OleCreateFromData(data, iid, renderopt, fmt, client_site, stg, obj); } +/****************************************************************************** + * OleCreateFromFileEx [OLE32.@] + */ +HRESULT WINAPI OleCreateFromFileEx(REFCLSID clsid, const OLECHAR *filename, REFIID iid, DWORD flags, + DWORD renderopt, ULONG num_fmts, DWORD *adv_flags, FORMATETC *fmts, IAdviseSink *sink, + DWORD *conns, IOleClientSite *client_site, IStorage *stg, void **obj) +{ + ULONG i; + + FIXME("%s: stub!\n", debugstr_w(filename)); + TRACE("cls %s, %s, iid %s, flags %d, render opts %d, num fmts %d, adv flags %p, fmts %p\n", debugstr_guid(clsid), + debugstr_w(filename), debugstr_guid(iid), flags, renderopt, num_fmts, adv_flags, fmts); + TRACE("sink %p, conns %p, client site %p, storage %p, obj %p\n", sink, conns, client_site, stg, obj); + for (i = 0; i < num_fmts; i++) + TRACE("\t%d: fmt %s adv flags %d\n", i, debugstr_formatetc(fmts + i), adv_flags[i]); + + return E_NOTIMPL; +} + +/****************************************************************************** + * OleCreateFromFile [OLE32.@] + */ +HRESULT WINAPI OleCreateFromFile(REFCLSID clsid, const OLECHAR *filename, REFIID iid, DWORD renderopt, + FORMATETC *fmt, IOleClientSite *client_site, IStorage *storage, void **obj) +{ + DWORD advf = ADVF_PRIMEFIRST; + + return OleCreateFromFileEx(clsid, filename, iid, 0, renderopt, fmt ? 1 : 0, fmt ? &advf : NULL, fmt, + NULL, NULL, client_site, storage, obj); +} + /****************************************************************************** * OleDuplicateData [OLE32.@] * diff --git a/dlls/ole32/ole2stubs.c b/dlls/ole32/ole2stubs.c index ba321658f1b..de357476b0f 100644 --- a/dlls/ole32/ole2stubs.c +++ b/dlls/ole32/ole2stubs.c @@ -51,17 +51,6 @@ HRESULT WINAPI OleCreateLink(LPMONIKER pmkLinkSrc, REFIID riid, DWORD renderopt, return E_NOTIMPL; } -/****************************************************************************** - * OleCreateFromFile [OLE32.@] - */ -HRESULT WINAPI OleCreateFromFile(REFCLSID rclsid, LPCOLESTR lpszFileName, REFIID riid, - DWORD renderopt, LPFORMATETC lpFormatEtc, LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, LPVOID* ppvObj) -{ - FIXME("(not shown), stub!\n"); - return E_NOTIMPL; -} - - /****************************************************************************** * OleGetIconOfClass [OLE32.@] */ diff --git a/dlls/ole32/ole32.spec b/dlls/ole32/ole32.spec index 8c4e8e389ea..04c9f1e3ccd 100644 --- a/dlls/ole32/ole32.spec +++ b/dlls/ole32/ole32.spec @@ -188,8 +188,8 @@ @ stub OleCreateEx @ stdcall OleCreateFromData(ptr ptr long ptr ptr ptr ptr) @ stdcall OleCreateFromDataEx(ptr ptr long long long ptr ptr ptr ptr ptr ptr ptr) -@ stdcall OleCreateFromFile(ptr ptr ptr long ptr ptr ptr ptr) -@ stub OleCreateFromFileEx +@ stdcall OleCreateFromFile(ptr wstr ptr long ptr ptr ptr ptr) +@ stdcall OleCreateFromFileEx(ptr wstr ptr long long long ptr ptr ptr ptr ptr ptr ptr) @ stdcall OleCreateLink(ptr ptr long ptr ptr ptr ptr) @ stub OleCreateLinkEx @ stdcall OleCreateLinkFromData(ptr ptr long ptr ptr ptr ptr) diff --git a/include/ole2.h b/include/ole2.h index a555c70d6ce..05c1b5502c7 100644 --- a/include/ole2.h +++ b/include/ole2.h @@ -107,6 +107,9 @@ HGLOBAL WINAPI OleMetafilePictFromIconAndLabel(HICON hIcon, LPOLESTR lpszLab HRESULT WINAPI OleLockRunning(LPUNKNOWN pUnknown, BOOL fLock, BOOL fLastUnlockCloses); HRESULT WINAPI OleCreateFromFile(REFCLSID rclsid, LPCOLESTR lpszFileName, REFIID riid, DWORD renderopt, LPFORMATETC lpFormatEtc, LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, LPVOID* ppvObj); +HRESULT WINAPI OleCreateFromFileEx(REFCLSID clsid, LPCOLESTR filename, REFIID iid, DWORD flags, + DWORD renderopt, ULONG num_fmts, DWORD *adv_flags, LPFORMATETC fmts, IAdviseSink *sink, + DWORD *conns, LPOLECLIENTSITE client_site, LPSTORAGE storage, LPVOID* obj); HRESULT WINAPI OleCreateLink(LPMONIKER pmkLinkSrc, REFIID riid, DWORD renderopt, LPFORMATETC lpFormatEtc, LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, LPVOID* ppvObj); HRESULT WINAPI OleCreate(REFCLSID rclsid, REFIID riid, DWORD renderopt, LPFORMATETC pFormatEtc, LPOLECLIENTSITE pClientSite,