<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 09.08.2017 20:12, Zebediah Figura
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:126a9cc2-820f-5189-35b2-0b77e357524e@gmail.com">On
      08/09/2017 06:07 AM, Jacek Caban wrote:
      <br>
      <blockquote type="cite" style="color: #000000;">Hi Zebediah,
        <br>
        <br>
        On 08.08.2017 20:04, Zebediah Figura wrote:
        <br>
        <blockquote type="cite" style="color: #000000;">  HRESULT
          register_class_object(BOOL do_reg)
          <br>
            {
          <br>
                HRESULT hres;
          <br>
            -    static DWORD cookie;
          <br>
          +    static DWORD ie_cookie, iem_cookie;
          <br>
                  if(do_reg) {
          <br>
                    hres =
          CoRegisterClassObject(&CLSID_InternetExplorer,
          <br>
                            (IUnknown*)&InternetExplorerFactory,
          CLSCTX_SERVER,
          <br>
          -                REGCLS_MULTIPLEUSE|REGCLS_SUSPENDED,
          &cookie);
          <br>
          -        if (FAILED(hres)) {
          <br>
          +                REGCLS_MULTIPLEUSE, &ie_cookie);
          <br>
          +        if (FAILED(hres))
          <br>
          +            ERR("failed to register object %08x\n", hres);
          <br>
          +        hres =
          CoRegisterClassObject(&CLSID_InternetExplorerManager,
          <br>
          +               
          (IUnknown*)&InternetExplorerManagerFactory, CLSCTX_SERVER,
          <br>
          +                REGCLS_MULTIPLEUSE, &iem_cookie);
          <br>
          +        if (FAILED(hres))
          <br>
                        ERR("failed to register object %08x\n", hres);
          <br>
          -            return hres;
          <br>
          -        }
          <br>
          -
          <br>
          -        hres = CoResumeClassObjects();
          <br>
          -        if(SUCCEEDED(hres))
          <br>
          -            return hres;
          <br>
          -
          <br>
          -        ERR("failed to resume object %08x\n", hres);
          <br>
                }
          <br>
          -
          <br>
          -    return CoRevokeClassObject(cookie);
          <br>
          +    else
          <br>
          +    {
          <br>
          +        hres = CoRevokeClassObject(ie_cookie);
          <br>
          +        if (FAILED(hres))
          <br>
          +            ERR("failed to register object %08x\n", hres);
          <br>
          +        hres = CoRevokeClassObject(iem_cookie);
          <br>
          +        if (FAILED(hres))
          <br>
          +            ERR("failed to register object %08x\n", hres);
          <br>
          +    }
          <br>
          +    return hres;
          <br>
            }
          <br>
        </blockquote>
        <br>
        Are you sure that's how it's supposed to work? I didn't test it
        myself, but given how it's registered and documented, I'd expect
        that CLSID_InternetExplorerManager should live in a different
        process from CLSID_InternetExplorer. It should be easy to
        distinguish those processes with -startmanager command line
        argument.
        <br>
        <br>
      </blockquote>
      <br>
      I'm sorry, I don't understand what you mean. Isn't
      CoRegisterClassObject process-agnostic?
    </blockquote>
    <p><br>
    </p>
    <p>It is in a sense that created proxy/stub abstract where the
      object lives, yes. But note that the actual instance of IE object
      must live in one process or another. There is a lot of different
      aspects like pluggable protocols, script engines, ActiveX objects,
      document objects that live in its process and it's quite important
      for them which process it is. I did a bit of testing and it seems
      to be a separated process on Windows, so we should follow that.</p>
    <p><br>
    </p>
    <p>Jacek<br>
    </p>
  </body>
</html>