Jacek Caban : shdocvw: Store object passed in DOCHOST_DOCCANNAVIGATE command.

Alexandre Julliard julliard at winehq.org
Mon Mar 15 12:19:35 CDT 2010


Module: wine
Branch: master
Commit: fab9304721a05b1b8b0369c554f1209218cf695d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=fab9304721a05b1b8b0369c554f1209218cf695d

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Sat Mar 13 16:43:24 2010 +0100

shdocvw: Store object passed in DOCHOST_DOCCANNAVIGATE command.

---

 dlls/shdocvw/dochost.c |   40 ++++++++++++++++++++++++++++++++++++++--
 dlls/shdocvw/shdocvw.h |    1 +
 2 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/dlls/shdocvw/dochost.c b/dlls/shdocvw/dochost.c
index e8982e4..6eb8199 100644
--- a/dlls/shdocvw/dochost.c
+++ b/dlls/shdocvw/dochost.c
@@ -21,9 +21,14 @@
 #include "hlink.h"
 #include "exdispid.h"
 #include "mshtml.h"
+#include "initguid.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
 
+DEFINE_OLEGUID(CGID_DocHostCmdPriv, 0x000214D4L, 0, 0);
+
+#define DOCHOST_DOCCANNAVIGATE  0
+
 static ATOM doc_view_atom = 0;
 
 void push_dochost_task(DocHost *This, task_header_t *task, task_proc_t proc, BOOL send)
@@ -314,6 +319,11 @@ void deactivate_document(DocHost *This)
     IHlinkTarget *hlink = NULL;
     HRESULT hres;
 
+    if(This->doc_navigate) {
+        IUnknown_Release(This->doc_navigate);
+        This->doc_navigate = NULL;
+    }
+
     if(This->is_prop_notif)
         advise_prop_notif(This, FALSE);
 
@@ -425,8 +435,34 @@ static HRESULT WINAPI ClOleCommandTarget_Exec(IOleCommandTarget *iface,
         VARIANT *pvaOut)
 {
     DocHost *This = OLECMD_THIS(iface);
-    FIXME("(%p)->(%s %d %d %p %p)\n", This, debugstr_guid(pguidCmdGroup), nCmdID,
-          nCmdexecopt, pvaIn, pvaOut);
+
+    TRACE("(%p)->(%s %d %d %p %p)\n", This, debugstr_guid(pguidCmdGroup), nCmdID,
+          nCmdexecopt, debugstr_variant(pvaIn), debugstr_variant(pvaOut));
+
+    if(!pguidCmdGroup) {
+        FIXME("Unimplemented cmdid %d\n", nCmdID);
+        return E_NOTIMPL;
+    }
+
+    if(IsEqualGUID(pguidCmdGroup, &CGID_DocHostCmdPriv)) {
+        switch(nCmdID) {
+        case DOCHOST_DOCCANNAVIGATE:
+            if(!pvaIn || V_VT(pvaIn) != VT_UNKNOWN)
+                return E_INVALIDARG;
+
+            if(This->doc_navigate)
+                IUnknown_Release(This->doc_navigate);
+            IUnknown_AddRef(V_UNKNOWN(pvaIn));
+            This->doc_navigate = V_UNKNOWN(pvaIn);
+            return S_OK;
+
+        default:
+            FIXME("unsupported command %d of CGID_DocHostCmdPriv\n", nCmdID);
+            return E_NOTIMPL;
+        }
+    }
+
+    FIXME("Unimplemented group %s\n", debugstr_guid(pguidCmdGroup));
     return E_NOTIMPL;
 }
 
diff --git a/dlls/shdocvw/shdocvw.h b/dlls/shdocvw/shdocvw.h
index c734f04..1641222 100644
--- a/dlls/shdocvw/shdocvw.h
+++ b/dlls/shdocvw/shdocvw.h
@@ -92,6 +92,7 @@ struct DocHost {
 
     IUnknown *document;
     IOleDocumentView *view;
+    IUnknown *doc_navigate;
 
     HWND hwnd;
     HWND frame_hwnd;




More information about the wine-cvs mailing list