<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 10.08.2017 20:52, Zebediah Figura
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:20170810185233.1356-5-zfigura@codeweavers.com">
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 12px;"
        lang="x-unicode">
        <pre wrap="">v2: register IE and IEM separately, and the latter with SINGLEUSE
(thanks Jacek)

Signed-off-by: Zebediah Figura <a class="moz-txt-link-rfc2396E" href="mailto:zfigura@codeweavers.com" moz-do-not-send="true"><zfigura@codeweavers.com></a>
---
 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;</pre>
      </div>
    </blockquote>
    <br>
    This is missing DECLSPEC_HIDDEN.<br>
    <br>
    <blockquote type="cite"
      cite="mid:20170810185233.1356-5-zfigura@codeweavers.com">
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 12px;"
        lang="x-unicode">
        <pre wrap=""> 
+/******************************************************************
+ *      IInternetExplorerManager implementation
+ */
+struct internet_explorer_manager {
+    IInternetExplorerManager IInternetExplorerManager_iface;
+    LONG ref;
+};</pre>
      </div>
    </blockquote>
    <br>
    Please use the type from public declaration (coclass). See how
    InternetExplorer object is declared.<br>
    <br>
    <blockquote type="cite"
      cite="mid:20170810185233.1356-5-zfigura@codeweavers.com">
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 12px;"
        lang="x-unicode">
        <pre wrap="">+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);
+}</pre>
      </div>
    </blockquote>
    <br>
    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.<br>
    <br>
    <br>
    <blockquote type="cite"
      cite="mid:20170810185233.1356-5-zfigura@codeweavers.com">
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 12px;"
        lang="x-unicode">
        <pre wrap="">+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);</pre>
      </div>
    </blockquote>
    <br>
    Use broken() for failure with older versions.<br>
    <br>
    <blockquote type="cite"
      cite="mid:20170810185233.1356-5-zfigura@codeweavers.com">
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 12px;"
        lang="x-unicode">
        <pre wrap="">+
+    if(hres != S_OK)
+        return;</pre>
      </div>
    </blockquote>
    <br>
    This could use a win_skip().<br>
    <br>
    Thanks,<br>
    Jacek<br>
  </body>
</html>