On 10.08.2017 20:52, Zebediah Figura wrote:
v2: register IE and IEM separately, and the latter with SINGLEUSE (thanks Jacek)
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> --- dlls/ieframe/ieframe.h | 5 +- dlls/ieframe/ieframe_main.c | 35 ++++--------- dlls/ieframe/iexplore.c | 111 ++++++++++++++++++++++++++++++++++++++--- dlls/ieframe/tests/ie.c | 21 ++++++++ programs/iexplore/iexplore.inf | 3 ++ 5 files changed, 142 insertions(+), 33 deletions(-)
diff --git a/dlls/ieframe/ieframe.h b/dlls/ieframe/ieframe.h index d1f1c5daf24..c690d5c6878 100644 --- a/dlls/ieframe/ieframe.h +++ b/dlls/ieframe/ieframe.h @@ -312,13 +312,16 @@ TID_LIST } tid_t;
HRESULT get_typeinfo(tid_t,ITypeInfo**) DECLSPEC_HIDDEN; -HRESULT register_class_object(BOOL) DECLSPEC_HIDDEN;
HRESULT WINAPI CUrlHistory_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN; HRESULT WINAPI InternetExplorer_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN; HRESULT WINAPI InternetShortcut_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN; HRESULT WINAPI WebBrowser_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN; HRESULT WINAPI WebBrowserV1_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN; +HRESULT WINAPI InternetExplorerManager_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN; + +extern IClassFactory InternetExplorerFactory; +extern IClassFactory InternetExplorerManagerFactory;
This is missing DECLSPEC_HIDDEN.
+/****************************************************************** + * IInternetExplorerManager implementation + */ +struct internet_explorer_manager { + IInternetExplorerManager IInternetExplorerManager_iface; + LONG ref; +};
Please use the type from public declaration (coclass). See how InternetExplorer object is declared.
+HRESULT WINAPI InternetExplorerManager_Create(IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **ppv) +{ + struct internet_explorer_manager *ret; + + TRACE("(%p %s %p)\n", pOuter, debugstr_guid(riid), ppv); + + if (!(ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ret)))) + return E_OUTOFMEMORY; + + ret->IInternetExplorerManager_iface.lpVtbl = &InternetExplorerManager_vtbl; + return IInternetExplorerManager_QueryInterface(&ret->IInternetExplorerManager_iface, riid, ppv); +}
This leaks the object if QueryInterface fails. The usual way to handle is to set initial ref to 1 and release the object after QI() call.
+static void test_InternetExplorerManager(void) +{ + IUnknown *unk; + ULONG ref; + HRESULT hres; + + hres = CoCreateInstance(&CLSID_InternetExplorerManager, NULL, CLSCTX_LOCAL_SERVER, + &IID_IInternetExplorerManager, (void**)&unk); + ok(hres == S_OK || hres == REGDB_E_CLASSNOTREG, "Could not create InternetExplorerManager instance: %08x\n", hres);
Use broken() for failure with older versions.
+ + if(hres != S_OK) + return;
This could use a win_skip(). Thanks, Jacek