ReactOS 0.4.17-dev-1190-g4c812f4
dochost.c File Reference
#include "ieframe.h"
#include "exdispid.h"
#include "mshtml.h"
#include "perhist.h"
#include "initguid.h"
#include "wine/debug.h"
Include dependency graph for dochost.c:

Go to the source code of this file.

Classes

struct  ready_state_task_t
 

Macros

#define DOCHOST_DOCCANNAVIGATE   0
 
#define CMDID_EXPLORER_UPDATEHISTORY   38
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (ieframe)
 
 DEFINE_OLEGUID (CGID_DocHostCmdPriv, 0x000214D4L, 0, 0)
 
void push_dochost_task (DocHost *This, task_header_t *task, task_proc_t proc, task_destr_t destr, BOOL send)
 
LRESULT process_dochost_tasks (DocHost *This)
 
void abort_dochost_tasks (DocHost *This, task_proc_t proc)
 
void on_commandstate_change (DocHost *doc_host, LONG command, BOOL enable)
 
void update_navigation_commands (DocHost *dochost)
 
static void notif_complete (DocHost *This, DISPID dispid)
 
static void object_available (DocHost *This)
 
static HRESULT get_doc_ready_state (DocHost *This, READYSTATE *ret)
 
static void advise_prop_notif (DocHost *This, BOOL set)
 
void set_doc_state (DocHost *This, READYSTATE doc_state)
 
static void update_ready_state (DocHost *This, READYSTATE ready_state)
 
static void ready_state_task_destr (task_header_t *_task)
 
static void ready_state_proc (DocHost *This, task_header_t *_task)
 
static void push_ready_state_task (DocHost *This, READYSTATE ready_state)
 
static void object_available_task_destr (task_header_t *task)
 
static void object_available_proc (DocHost *This, task_header_t *task)
 
HRESULT dochost_object_available (DocHost *This, IUnknown *doc)
 
static LRESULT resize_document (DocHost *This, LONG width, LONG height)
 
static LRESULT WINAPI doc_view_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static void free_travellog_entry (travellog_entry_t *entry)
 
static IStream * get_travellog_stream (DocHost *This)
 
static void dump_travellog (DocHost *This)
 
static void update_travellog (DocHost *This)
 
void create_doc_view_hwnd (DocHost *This)
 
void deactivate_document (DocHost *This)
 
HRESULT refresh_document (DocHost *This, const VARIANT *level)
 
void activate_document (DocHost *This)
 
void release_dochost_client (DocHost *This)
 
static DocHost * impl_from_IOleCommandTarget (IOleCommandTarget *iface)
 
static HRESULT WINAPI ClOleCommandTarget_QueryInterface (IOleCommandTarget *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ClOleCommandTarget_AddRef (IOleCommandTarget *iface)
 
static ULONG WINAPI ClOleCommandTarget_Release (IOleCommandTarget *iface)
 
static HRESULT WINAPI ClOleCommandTarget_QueryStatus (IOleCommandTarget *iface, const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText)
 
static HRESULT WINAPI ClOleCommandTarget_Exec (IOleCommandTarget *iface, const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static DocHost * impl_from_IDocHostUIHandler2 (IDocHostUIHandler2 *iface)
 
static HRESULT WINAPI DocHostUIHandler_QueryInterface (IDocHostUIHandler2 *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI DocHostUIHandler_AddRef (IDocHostUIHandler2 *iface)
 
static ULONG WINAPI DocHostUIHandler_Release (IDocHostUIHandler2 *iface)
 
static HRESULT WINAPI DocHostUIHandler_ShowContextMenu (IDocHostUIHandler2 *iface, DWORD dwID, POINT *ppt, IUnknown *pcmdtReserved, IDispatch *pdispReserved)
 
static HRESULT WINAPI DocHostUIHandler_GetHostInfo (IDocHostUIHandler2 *iface, DOCHOSTUIINFO *pInfo)
 
static HRESULT WINAPI DocHostUIHandler_ShowUI (IDocHostUIHandler2 *iface, DWORD dwID, IOleInPlaceActiveObject *pActiveObject, IOleCommandTarget *pCommandTarget, IOleInPlaceFrame *pFrame, IOleInPlaceUIWindow *pDoc)
 
static HRESULT WINAPI DocHostUIHandler_HideUI (IDocHostUIHandler2 *iface)
 
static HRESULT WINAPI DocHostUIHandler_UpdateUI (IDocHostUIHandler2 *iface)
 
static HRESULT WINAPI DocHostUIHandler_EnableModeless (IDocHostUIHandler2 *iface, BOOL fEnable)
 
static HRESULT WINAPI DocHostUIHandler_OnDocWindowActivate (IDocHostUIHandler2 *iface, BOOL fActivate)
 
static HRESULT WINAPI DocHostUIHandler_OnFrameWindowActivate (IDocHostUIHandler2 *iface, BOOL fActivate)
 
static HRESULT WINAPI DocHostUIHandler_ResizeBorder (IDocHostUIHandler2 *iface, LPCRECT prcBorder, IOleInPlaceUIWindow *pUIWindow, BOOL fRameWindow)
 
static HRESULT WINAPI DocHostUIHandler_TranslateAccelerator (IDocHostUIHandler2 *iface, LPMSG lpMsg, const GUID *pguidCmdGroup, DWORD nCmdID)
 
static HRESULT WINAPI DocHostUIHandler_GetOptionKeyPath (IDocHostUIHandler2 *iface, LPOLESTR *pchKey, DWORD dw)
 
static HRESULT WINAPI DocHostUIHandler_GetDropTarget (IDocHostUIHandler2 *iface, IDropTarget *pDropTarget, IDropTarget **ppDropTarget)
 
static HRESULT WINAPI DocHostUIHandler_GetExternal (IDocHostUIHandler2 *iface, IDispatch **ppDispatch)
 
static HRESULT WINAPI DocHostUIHandler_TranslateUrl (IDocHostUIHandler2 *iface, DWORD dwTranslate, OLECHAR *pchURLIn, OLECHAR **ppchURLOut)
 
static HRESULT WINAPI DocHostUIHandler_FilterDataObject (IDocHostUIHandler2 *iface, IDataObject *pDO, IDataObject **ppDORet)
 
static HRESULT WINAPI DocHostUIHandler_GetOverrideKeyPath (IDocHostUIHandler2 *iface, LPOLESTR *pchKey, DWORD dw)
 
static DocHost * impl_from_IPropertyNotifySink (IPropertyNotifySink *iface)
 
static HRESULT WINAPI PropertyNotifySink_QueryInterface (IPropertyNotifySink *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI PropertyNotifySink_AddRef (IPropertyNotifySink *iface)
 
static ULONG WINAPI PropertyNotifySink_Release (IPropertyNotifySink *iface)
 
static HRESULT WINAPI PropertyNotifySink_OnChanged (IPropertyNotifySink *iface, DISPID dispID)
 
static HRESULT WINAPI PropertyNotifySink_OnRequestEdit (IPropertyNotifySink *iface, DISPID dispID)
 
void DocHost_Init (DocHost *This, IWebBrowser2 *wb, const IDocHostContainerVtbl *container)
 
void DocHost_Release (DocHost *This)
 

Variables

static ATOM doc_view_atom = 0
 
static const IOleCommandTargetVtbl OleCommandTargetVtbl
 
static const IDocHostUIHandler2Vtbl DocHostUIHandler2Vtbl
 
static const IPropertyNotifySinkVtbl PropertyNotifySinkVtbl
 

Macro Definition Documentation

◆ CMDID_EXPLORER_UPDATEHISTORY

#define CMDID_EXPLORER_UPDATEHISTORY   38

Definition at line 35 of file dochost.c.

◆ DOCHOST_DOCCANNAVIGATE

#define DOCHOST_DOCCANNAVIGATE   0

Definition at line 32 of file dochost.c.

Function Documentation

◆ abort_dochost_tasks()

void abort_dochost_tasks ( DocHost *  This,
task_proc_t  proc 
)

Definition at line 70 of file dochost.c.

71{
73
75 if(proc && proc != task->proc)
76 continue;
77
78 list_remove(&task->entry);
79 task->destr(task);
80 }
81}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
DWORD task
Definition: delayimp.cpp:484
const char cursor[]
Definition: icontest.c:13
uint32_t entry
Definition: isohybrid.c:63
static HANDLE proc()
Definition: pdb.c:32
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:242

Referenced by async_doc_navigate(), and DocHost_Release().

◆ activate_document()

void activate_document ( DocHost *  This)

Definition at line 606 of file dochost.c.

607{
608 IOleObject *oleobj;
609 IHlinkTarget *hlink;
611
612 if(!This->document) return;
613
614 hres = IUnknown_QueryInterface(This->document, &IID_IHlinkTarget, (void**)&hlink);
615 if(SUCCEEDED(hres)) {
616 IHlinkTarget_Navigate(hlink, 0, NULL);
617 IHlinkTarget_Release(hlink);
618 }
619
620 hres = IUnknown_QueryInterface(This->document, &IID_IOleObject, (void**)&oleobj);
621 if(SUCCEEDED(hres)) {
622 IOleObject_DoVerb(oleobj, OLEIVERB_SHOW, NULL, NULL, -1, 0, NULL);
623 IOleObject_Release(oleobj);
624 }
625
627
628 if(This->view)
629 IOleDocumentView_UIActivate(This->view, TRUE);
630}
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
HRESULT refresh_document(DocHost *This, const VARIANT *level)
Definition: dochost.c:577
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT hres
Definition: protocol.c:432
#define OLEIVERB_SHOW
Definition: ole2.h:39
const GUID IID_IOleObject

Referenced by activate_ui().

◆ advise_prop_notif()

static void advise_prop_notif ( DocHost *  This,
BOOL  set 
)
static

Definition at line 209 of file dochost.c.

210{
211 IConnectionPointContainer *cp_container;
214
215 hres = IUnknown_QueryInterface(This->document, &IID_IConnectionPointContainer, (void**)&cp_container);
216 if(FAILED(hres))
217 return;
218
219 hres = IConnectionPointContainer_FindConnectionPoint(cp_container, &IID_IPropertyNotifySink, &cp);
220 IConnectionPointContainer_Release(cp_container);
221 if(FAILED(hres))
222 return;
223
224 if(set)
225 hres = IConnectionPoint_Advise(cp, (IUnknown*)&This->IPropertyNotifySink_iface, &This->prop_notif_cookie);
226 else
227 hres = IConnectionPoint_Unadvise(cp, This->prop_notif_cookie);
228 IConnectionPoint_Release(cp);
229
230 if(SUCCEEDED(hres))
231 This->is_prop_notif = set;
232}
Definition: _set.h:50
#define FAILED(hr)
Definition: intsafe.h:51
POINT cp
Definition: magnifier.c:59
const GUID IID_IConnectionPointContainer
const GUID IID_IPropertyNotifySink

Referenced by deactivate_document(), dochost_object_available(), and PropertyNotifySink_OnChanged().

◆ ClOleCommandTarget_AddRef()

static ULONG WINAPI ClOleCommandTarget_AddRef ( IOleCommandTarget *  iface)
static

Definition at line 672 of file dochost.c.

673{
675 return IOleClientSite_AddRef(&This->IOleClientSite_iface);
676}
static DocHost * impl_from_IOleCommandTarget(IOleCommandTarget *iface)
Definition: dochost.c:660

◆ ClOleCommandTarget_Exec()

static HRESULT WINAPI ClOleCommandTarget_Exec ( IOleCommandTarget *  iface,
const GUID *  pguidCmdGroup,
DWORD  nCmdID,
DWORD  nCmdexecopt,
VARIANT *  pvaIn,
VARIANT *  pvaOut 
)
static

Definition at line 698 of file dochost.c.

701{
703
704 TRACE("(%p)->(%s %ld %ld %s %s)\n", This, debugstr_guid(pguidCmdGroup), nCmdID, nCmdexecopt,
705 debugstr_variant(pvaIn), debugstr_variant(pvaOut));
706
707 if(!pguidCmdGroup) {
708 switch(nCmdID) {
709 case OLECMDID_UPDATECOMMANDS:
710 if(!This->olecmd)
711 return E_NOTIMPL;
712 return IOleCommandTarget_Exec(This->olecmd, pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);
713 case OLECMDID_SETDOWNLOADSTATE:
714 if(pvaIn && V_VT(pvaIn) == VT_I4)
715 This->busy = V_I4(pvaIn) ? VARIANT_TRUE : VARIANT_FALSE;
716 if(This->olecmd)
717 return IOleCommandTarget_Exec(This->olecmd, pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);
718
719 if(!pvaIn || V_VT(pvaIn) != VT_I4)
720 return E_INVALIDARG;
721
723 return S_OK;
724 default:
725 TRACE("Unimplemented cmdid %ld\n", nCmdID);
726 return E_NOTIMPL;
727 }
728 }
729
730 if(IsEqualGUID(pguidCmdGroup, &CGID_DocHostCmdPriv)) {
731 switch(nCmdID) {
733 if(!pvaIn || V_VT(pvaIn) != VT_UNKNOWN)
734 return E_INVALIDARG;
735
736 if(This->doc_navigate)
737 IUnknown_Release(This->doc_navigate);
738 IUnknown_AddRef(V_UNKNOWN(pvaIn));
739 This->doc_navigate = V_UNKNOWN(pvaIn);
740 return S_OK;
741
742 case 1: {
743 IHTMLWindow2 *win2;
744 SAFEARRAY *sa = V_ARRAY(pvaIn);
745 VARIANT status_code, url, htmlwindow;
746 LONG ind;
748
749 if(V_VT(pvaIn) != VT_ARRAY || !sa || (SafeArrayGetDim(sa) != 1))
750 return E_INVALIDARG;
751
752 ind = 0;
754 if(FAILED(hres) || V_VT(&status_code)!=VT_I4)
755 return E_INVALIDARG;
756
757 ind = 1;
758 hres = SafeArrayGetElement(sa, &ind, &url);
759 if(FAILED(hres) || V_VT(&url)!=VT_BSTR)
760 return E_INVALIDARG;
761
762 ind = 3;
763 hres = SafeArrayGetElement(sa, &ind, &htmlwindow);
764 if(FAILED(hres) || V_VT(&htmlwindow)!=VT_UNKNOWN || !V_UNKNOWN(&htmlwindow))
765 return E_INVALIDARG;
766
767 hres = IUnknown_QueryInterface(V_UNKNOWN(&htmlwindow), &IID_IHTMLWindow2, (void**)&win2);
768 if(FAILED(hres))
769 return E_INVALIDARG;
770
772 IHTMLWindow2_Release(win2);
773 return S_OK;
774 }
775
776 default:
777 TRACE("unsupported command %ld of CGID_DocHostCmdPriv\n", nCmdID);
778 return E_NOTIMPL;
779 }
780 }
781
782 if(IsEqualGUID(pguidCmdGroup, &CGID_Explorer)) {
783 switch(nCmdID) {
787 return S_OK;
788
789 default:
790 TRACE("Unimplemented cmdid %ld of CGID_Explorer\n", nCmdID);
791 return E_NOTIMPL;
792 }
793 }
794
795 if(IsEqualGUID(pguidCmdGroup, &CGID_ShellDocView)) {
796 switch(nCmdID) {
797 default:
798 TRACE("Unimplemented cmdid %ld of CGID_ShellDocView\n", nCmdID);
799 return E_NOTIMPL;
800 }
801 }
802
803 if(IsEqualGUID(&CGID_DocHostCommandHandler, pguidCmdGroup)) {
804 if(!This->olecmd)
805 return E_NOTIMPL;
806 return IOleCommandTarget_Exec(This->olecmd, pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);
807 }
808
809 TRACE("Unimplemented cmdid %ld of group %s\n", nCmdID, debugstr_guid(pguidCmdGroup));
810 return E_NOTIMPL;
811}
static struct sockaddr_in sa
Definition: adnsresfilter.c:69
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
@ VT_BSTR
Definition: compat.h:2303
@ VT_UNKNOWN
Definition: compat.h:2308
@ VT_ARRAY
Definition: compat.h:2341
@ VT_I4
Definition: compat.h:2298
HRESULT WINAPI SafeArrayGetElement(SAFEARRAY *psa, LONG *rgIndices, void *pvData)
Definition: safearray.c:947
UINT WINAPI SafeArrayGetDim(SAFEARRAY *psa)
Definition: safearray.c:1094
#define CMDID_EXPLORER_UPDATEHISTORY
Definition: dochost.c:35
static void update_travellog(DocHost *This)
Definition: dochost.c:427
#define DOCHOST_DOCCANNAVIGATE
Definition: dochost.c:32
void update_navigation_commands(DocHost *dochost)
Definition: dochost.c:106
static const char * debugstr_variant(const VARIANT *var)
Definition: dom.c:505
void handle_navigation_error(DocHost *, HRESULT, BSTR, IHTMLWindow2 *)
Definition: navigate.c:313
void notify_download_state(DocHost *, BOOL)
Definition: navigate.c:151
#define S_OK
Definition: intsafe.h:52
#define debugstr_guid
Definition: kernel32.h:35
static const WCHAR url[]
Definition: encode.c:1384
interface IHTMLWindow2 IHTMLWindow2
Definition: mshtmhst.idl:64
#define V_ARRAY(A)
Definition: oleauto.h:222
#define V_UNKNOWN(A)
Definition: oleauto.h:281
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define V_I4(A)
Definition: oleauto.h:247
long LONG
Definition: pedump.c:60
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define TRACE(s)
Definition: solgame.cpp:4

◆ ClOleCommandTarget_QueryInterface()

static HRESULT WINAPI ClOleCommandTarget_QueryInterface ( IOleCommandTarget *  iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 665 of file dochost.c.

667{
669 return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppv);
670}
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39

◆ ClOleCommandTarget_QueryStatus()

static HRESULT WINAPI ClOleCommandTarget_QueryStatus ( IOleCommandTarget *  iface,
const GUID *  pguidCmdGroup,
ULONG  cCmds,
OLECMD  prgCmds[],
OLECMDTEXT *  pCmdText 
)
static

Definition at line 684 of file dochost.c.

686{
688 ULONG i;
689
690 TRACE("(%p)->(%s %lu %p %p)\n", This, debugstr_guid(pguidCmdGroup), cCmds, prgCmds,
691 pCmdText);
692 for(i=0; prgCmds && i < cCmds; i++)
693 TRACE("unsupported command %lu (%lx)\n", prgCmds[i].cmdID, prgCmds[i].cmdf);
694
695 return E_NOTIMPL;
696}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
OLECMDF cmdf
Definition: olecmd.c:716
uint32_t ULONG
Definition: typedefs.h:59

◆ ClOleCommandTarget_Release()

static ULONG WINAPI ClOleCommandTarget_Release ( IOleCommandTarget *  iface)
static

Definition at line 678 of file dochost.c.

679{
681 return IOleClientSite_Release(&This->IOleClientSite_iface);
682}

◆ create_doc_view_hwnd()

void create_doc_view_hwnd ( DocHost *  This)

Definition at line 484 of file dochost.c.

485{
486 RECT rect;
487
488 static const WCHAR wszShell_DocObject_View[] =
489 {'S','h','e','l','l',' ','D','o','c','O','b','j','e','c','t',' ','V','i','e','w',0};
490
491 if(!doc_view_atom) {
492 static WNDCLASSEXW wndclass = {
493 sizeof(wndclass),
496 0, 0 /* native uses 4*/, NULL, NULL, NULL,
497 (HBRUSH)(COLOR_WINDOW + 1), NULL,
498 wszShell_DocObject_View,
499 NULL
500 };
501
502 wndclass.hInstance = ieframe_instance;
503
504 doc_view_atom = RegisterClassExW(&wndclass);
505 }
506
507 This->container_vtbl->get_docobj_rect(This, &rect);
508 This->hwnd = CreateWindowExW(0, wszShell_DocObject_View,
509 wszShell_DocObject_View,
511 rect.left, rect.top, rect.right, rect.bottom, This->frame_hwnd,
513}
RECT rect
Definition: combotst.c:67
static ATOM doc_view_atom
Definition: dochost.c:37
static LRESULT WINAPI doc_view_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dochost.c:364
HINSTANCE ieframe_instance
Definition: ieframe_main.c:32
#define WS_CHILD
Definition: pedump.c:617
#define WS_TABSTOP
Definition: pedump.c:634
short WCHAR
Definition: pedump.c:58
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define COLOR_WINDOW
Definition: winuser.h:929
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
#define CS_PARENTDC
Definition: winuser.h:664
Definition: dcommon.idl:28
long bottom
Definition: dcommon.idl:29
long right
Definition: dcommon.idl:29
long left
Definition: dcommon.idl:29
long top
Definition: dcommon.idl:29
HINSTANCE hInstance
Definition: winuser.h:3329

Referenced by create_frame_hwnd(), and navigate_bsc_proc().

◆ deactivate_document()

void deactivate_document ( DocHost *  This)

Definition at line 515 of file dochost.c.

516{
518 IOleObject *oleobj = NULL;
519 IHlinkTarget *hlink = NULL;
521
522 if(!This->document) return;
523
524 if(This->doc_navigate) {
525 IUnknown_Release(This->doc_navigate);
526 This->doc_navigate = NULL;
527 }
528
529 if(This->is_prop_notif)
531
532 if(This->view)
533 IOleDocumentView_UIActivate(This->view, FALSE);
534
535 hres = IUnknown_QueryInterface(This->document, &IID_IOleInPlaceObjectWindowless,
536 (void**)&winobj);
537 if(SUCCEEDED(hres)) {
538 IOleInPlaceObjectWindowless_InPlaceDeactivate(winobj);
539 IOleInPlaceObjectWindowless_Release(winobj);
540 }
541
542 if(This->view) {
543 IOleDocumentView_Show(This->view, FALSE);
544 IOleDocumentView_CloseView(This->view, 0);
545 IOleDocumentView_SetInPlaceSite(This->view, NULL);
546 IOleDocumentView_Release(This->view);
547 This->view = NULL;
548 }
549
550 hres = IUnknown_QueryInterface(This->document, &IID_IOleObject, (void**)&oleobj);
551 if(SUCCEEDED(hres))
552 IOleObject_Close(oleobj, OLECLOSE_NOSAVE);
553
554 hres = IUnknown_QueryInterface(This->document, &IID_IHlinkTarget, (void**)&hlink);
555 if(SUCCEEDED(hres)) {
556 IHlinkTarget_SetBrowseContext(hlink, NULL);
557 IHlinkTarget_Release(hlink);
558 }
559
560 if(oleobj) {
562
563 IOleObject_GetClientSite(oleobj, &client_site);
564 if(client_site) {
565 if(client_site == &This->IOleClientSite_iface)
566 IOleObject_SetClientSite(oleobj, NULL);
567 IOleClientSite_Release(client_site);
568 }
569
570 IOleObject_Release(oleobj);
571 }
572
573 IUnknown_Release(This->document);
574 This->document = NULL;
575}
#define FALSE
Definition: types.h:117
static void advise_prop_notif(DocHost *This, BOOL set)
Definition: dochost.c:209
static IOleClientSite * client_site
Definition: activex.c:198

Referenced by InternetExplorer_Release(), navigate_bsc(), OleObject_SetClientSite(), and release_extern_ref().

◆ DEFINE_OLEGUID()

DEFINE_OLEGUID ( CGID_DocHostCmdPriv  ,
0x000214D4L  ,
0  ,
0   
)

◆ doc_view_proc()

static LRESULT WINAPI doc_view_proc ( HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 364 of file dochost.c.

365{
366 DocHost *This;
367
368 static const WCHAR wszTHIS[] = {'T','H','I','S',0};
369
370 if(msg == WM_CREATE) {
371 This = *(DocHost**)lParam;
372 SetPropW(hwnd, wszTHIS, This);
373 }else {
374 This = GetPropW(hwnd, wszTHIS);
375 }
376
377 switch(msg) {
378 case WM_SIZE:
380 }
381
383}
#define msg(x)
Definition: auth_time.c:54
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
static LRESULT resize_document(DocHost *This, LONG width, LONG height)
Definition: dochost.c:352
#define LOWORD(l)
Definition: pedump.c:82
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_CREATE
Definition: winuser.h:1636
#define WM_SIZE
Definition: winuser.h:1639
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
#define HIWORD(l)
Definition: typedefs.h:247
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

Referenced by create_doc_view_hwnd().

◆ DocHost_Init()

void DocHost_Init ( DocHost *  This,
IWebBrowser2 *  wb,
const IDocHostContainerVtbl *  container 
)

Definition at line 1137 of file dochost.c.

1138{
1139 This->IDocHostUIHandler2_iface.lpVtbl = &DocHostUIHandler2Vtbl;
1140 This->IOleCommandTarget_iface.lpVtbl = &OleCommandTargetVtbl;
1141 This->IPropertyNotifySink_iface.lpVtbl = &PropertyNotifySinkVtbl;
1142
1143 This->wb = wb;
1144 This->container_vtbl = container;
1145
1146 This->ready_state = READYSTATE_UNINITIALIZED;
1147 list_init(&This->task_queue);
1148
1149 This->travellog.loading_pos = -1;
1150
1153
1157}
static void list_init(struct list_entry *head)
Definition: list.h:51
void DocHost_ClientSite_Init(DocHost *This)
Definition: client.c:712
void ConnectionPointContainer_Init(ConnectionPointContainer *This, IUnknown *impl)
Definition: events.c:430
void DocHost_Frame_Init(DocHost *This)
Definition: frame.c:182
static const IPropertyNotifySinkVtbl PropertyNotifySinkVtbl
Definition: dochost.c:1129
static const IDocHostUIHandler2Vtbl DocHostUIHandler2Vtbl
Definition: dochost.c:1047
static const IOleCommandTargetVtbl OleCommandTargetVtbl
Definition: dochost.c:813
void NewWindowManager_Init(DocHost *)
void IEHTMLWindow_Init(DocHost *)
Definition: iehtmlwnd.c:725
static IWebBrowser2 * wb
Definition: webbrowser.c:165

Referenced by create_ie(), and create_webbrowser().

◆ dochost_object_available()

HRESULT dochost_object_available ( DocHost *  This,
IUnknown *  doc 
)

Definition at line 304 of file dochost.c.

305{
306 READYSTATE ready_state;
308 IOleObject *oleobj;
310
311 IUnknown_AddRef(doc);
312 This->document = doc;
313
314 hres = IUnknown_QueryInterface(doc, &IID_IOleObject, (void**)&oleobj);
315 if(SUCCEEDED(hres)) {
316 CLSID clsid;
317
318 hres = IOleObject_GetUserClassID(oleobj, &clsid);
319 if(SUCCEEDED(hres))
320 TRACE("Got clsid %s\n",
321 IsEqualGUID(&clsid, &CLSID_HTMLDocument) ? "CLSID_HTMLDocument" : debugstr_guid(&clsid));
322
323 hres = IOleObject_SetClientSite(oleobj, &This->IOleClientSite_iface);
324 if(FAILED(hres))
325 FIXME("SetClientSite failed: %08lx\n", hres);
326
327 IOleObject_Release(oleobj);
328 }else {
329 FIXME("Could not get IOleObject iface: %08lx\n", hres);
330 }
331
332 /* FIXME: Call SetAdvise */
333
334 task = malloc(sizeof(*task));
336
337 hres = get_doc_ready_state(This, &ready_state);
338 if(SUCCEEDED(hres)) {
339 if(ready_state == READYSTATE_COMPLETE)
340 push_ready_state_task(This, READYSTATE_COMPLETE);
341 if(ready_state != READYSTATE_COMPLETE || This->doc_navigate)
343 }else if(!This->doc_navigate) {
344 /* If we can't get document's ready state, there is not much we can do.
345 * Assume that document is complete at this point. */
346 push_ready_state_task(This, READYSTATE_COMPLETE);
347 }
348
349 return S_OK;
350}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define malloc
Definition: debug_ros.c:4
static void push_ready_state_task(DocHost *This, READYSTATE ready_state)
Definition: dochost.c:283
static void object_available_task_destr(task_header_t *task)
Definition: dochost.c:294
void push_dochost_task(DocHost *This, task_header_t *task, task_proc_t proc, task_destr_t destr, BOOL send)
Definition: dochost.c:39
static void object_available_proc(DocHost *This, task_header_t *task)
Definition: dochost.c:299
static HRESULT get_doc_ready_state(DocHost *This, READYSTATE *ret)
Definition: dochost.c:179
const CLSID * clsid
Definition: msctf.cpp:50

Referenced by BindStatusCallback_OnObjectAvailable().

◆ DocHost_Release()

void DocHost_Release ( DocHost *  This)

Definition at line 1159 of file dochost.c.

1160{
1161 if(This->shell_ui_helper)
1162 IShellUIHelper2_Release(This->shell_ui_helper);
1163
1167
1169
1170 while(This->travellog.length)
1171 free_travellog_entry(This->travellog.log + --This->travellog.length);
1172 free(This->travellog.log);
1173
1174 free(This->url);
1175}
#define free
Definition: debug_ros.c:5
void DocHost_ClientSite_Release(DocHost *This)
Definition: client.c:722
void ConnectionPointContainer_Destroy(ConnectionPointContainer *This)
Definition: events.c:441
void abort_dochost_tasks(DocHost *This, task_proc_t proc)
Definition: dochost.c:70
static void free_travellog_entry(travellog_entry_t *entry)
Definition: dochost.c:385
void release_dochost_client(DocHost *This)
Definition: dochost.c:632

Referenced by InternetExplorer_Release(), and WebBrowser_Release().

◆ DocHostUIHandler_AddRef()

static ULONG WINAPI DocHostUIHandler_AddRef ( IDocHostUIHandler2 *  iface)
static

Definition at line 833 of file dochost.c.

834{
836 return IOleClientSite_AddRef(&This->IOleClientSite_iface);
837}
static DocHost * impl_from_IDocHostUIHandler2(IDocHostUIHandler2 *iface)
Definition: dochost.c:821

◆ DocHostUIHandler_EnableModeless()

static HRESULT WINAPI DocHostUIHandler_EnableModeless ( IDocHostUIHandler2 *  iface,
BOOL  fEnable 
)
static

Definition at line 913 of file dochost.c.

915{
917 FIXME("(%p)->(%x)\n", This, fEnable);
918 return E_NOTIMPL;
919}

◆ DocHostUIHandler_FilterDataObject()

static HRESULT WINAPI DocHostUIHandler_FilterDataObject ( IDocHostUIHandler2 *  iface,
IDataObject *  pDO,
IDataObject **  ppDORet 
)
static

Definition at line 1016 of file dochost.c.

1018{
1020 FIXME("(%p)->(%p %p)\n", This, pDO, ppDORet);
1021 return E_NOTIMPL;
1022}

◆ DocHostUIHandler_GetDropTarget()

static HRESULT WINAPI DocHostUIHandler_GetDropTarget ( IDocHostUIHandler2 *  iface,
IDropTarget *  pDropTarget,
IDropTarget **  ppDropTarget 
)
static

Definition at line 971 of file dochost.c.

973{
975 FIXME("(%p)\n", This);
976 return E_NOTIMPL;
977}

◆ DocHostUIHandler_GetExternal()

static HRESULT WINAPI DocHostUIHandler_GetExternal ( IDocHostUIHandler2 *  iface,
IDispatch **  ppDispatch 
)
static

Definition at line 979 of file dochost.c.

981{
983
984 TRACE("(%p)->(%p)\n", This, ppDispatch);
985
986 if(This->hostui)
987 return IDocHostUIHandler_GetExternal(This->hostui, ppDispatch);
988
989 if(!This->shell_ui_helper) {
991
992 hres = create_shell_ui_helper(&This->shell_ui_helper);
993 if(FAILED(hres))
994 return hres;
995 }
996
997 *ppDispatch = (IDispatch*)This->shell_ui_helper;
998 IDispatch_AddRef(*ppDispatch);
999 return S_OK;
1000}
HRESULT create_shell_ui_helper(IShellUIHelper2 **)

◆ DocHostUIHandler_GetHostInfo()

static HRESULT WINAPI DocHostUIHandler_GetHostInfo ( IDocHostUIHandler2 *  iface,
DOCHOSTUIINFO *  pInfo 
)
static

Definition at line 864 of file dochost.c.

866{
869
870 TRACE("(%p)->(%p)\n", This, pInfo);
871
872 if(This->hostui) {
873 hres = IDocHostUIHandler_GetHostInfo(This->hostui, pInfo);
874 if(SUCCEEDED(hres))
875 return hres;
876 }
877
881 return S_OK;
882}
@ DOCHOSTUIFLAG_DISABLE_HELP_MENU
Definition: mshtmhst.idl:117
@ DOCHOSTUIFLAG_URL_ENCODING_ENABLE_UTF8
Definition: mshtmhst.idl:129
@ DOCHOSTUIFLAG_OPENNEWWIN
Definition: mshtmhst.idl:121
@ DOCHOSTUIFLAG_ENABLE_INPLACE_NAVIGATION
Definition: mshtmhst.idl:131
@ DOCHOSTUIFLAG_IME_ENABLE_RECONVERSION
Definition: mshtmhst.idl:132

◆ DocHostUIHandler_GetOptionKeyPath()

static HRESULT WINAPI DocHostUIHandler_GetOptionKeyPath ( IDocHostUIHandler2 *  iface,
LPOLESTR *  pchKey,
DWORD  dw 
)
static

Definition at line 958 of file dochost.c.

960{
962
963 TRACE("(%p)->(%p %ld)\n", This, pchKey, dw);
964
965 if(This->hostui)
966 return IDocHostUIHandler_GetOptionKeyPath(This->hostui, pchKey, dw);
967
968 return S_OK;
969}
REFIID LPVOID DWORD_PTR dw
Definition: atlbase.h:40

◆ DocHostUIHandler_GetOverrideKeyPath()

static HRESULT WINAPI DocHostUIHandler_GetOverrideKeyPath ( IDocHostUIHandler2 *  iface,
LPOLESTR *  pchKey,
DWORD  dw 
)
static

Definition at line 1024 of file dochost.c.

1026{
1029 HRESULT hres;
1030
1031 TRACE("(%p)->(%p %ld)\n", This, pchKey, dw);
1032
1033 if(!This->hostui)
1034 return S_OK;
1035
1036 hres = IDocHostUIHandler_QueryInterface(This->hostui, &IID_IDocHostUIHandler2,
1037 (void**)&handler);
1038 if(SUCCEEDED(hres)) {
1039 hres = IDocHostUIHandler2_GetOverrideKeyPath(handler, pchKey, dw);
1040 IDocHostUIHandler2_Release(handler);
1041 return hres;
1042 }
1043
1044 return S_OK;
1045}
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7708

◆ DocHostUIHandler_HideUI()

static HRESULT WINAPI DocHostUIHandler_HideUI ( IDocHostUIHandler2 *  iface)
static

Definition at line 894 of file dochost.c.

895{
897 FIXME("(%p)\n", This);
898 return E_NOTIMPL;
899}

◆ DocHostUIHandler_OnDocWindowActivate()

static HRESULT WINAPI DocHostUIHandler_OnDocWindowActivate ( IDocHostUIHandler2 *  iface,
BOOL  fActivate 
)
static

Definition at line 921 of file dochost.c.

923{
925 FIXME("(%p)->(%x)\n", This, fActivate);
926 return E_NOTIMPL;
927}

◆ DocHostUIHandler_OnFrameWindowActivate()

static HRESULT WINAPI DocHostUIHandler_OnFrameWindowActivate ( IDocHostUIHandler2 *  iface,
BOOL  fActivate 
)
static

Definition at line 929 of file dochost.c.

931{
933 FIXME("(%p)->(%x)\n", This, fActivate);
934 return E_NOTIMPL;
935}

◆ DocHostUIHandler_QueryInterface()

static HRESULT WINAPI DocHostUIHandler_QueryInterface ( IDocHostUIHandler2 *  iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 826 of file dochost.c.

828{
830 return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppv);
831}

◆ DocHostUIHandler_Release()

static ULONG WINAPI DocHostUIHandler_Release ( IDocHostUIHandler2 *  iface)
static

Definition at line 839 of file dochost.c.

840{
842 return IOleClientSite_Release(&This->IOleClientSite_iface);
843}

◆ DocHostUIHandler_ResizeBorder()

static HRESULT WINAPI DocHostUIHandler_ResizeBorder ( IDocHostUIHandler2 *  iface,
LPCRECT  prcBorder,
IOleInPlaceUIWindow *  pUIWindow,
BOOL  fRameWindow 
)
static

Definition at line 937 of file dochost.c.

939{
941 FIXME("(%p)->(%p %p %X)\n", This, prcBorder, pUIWindow, fRameWindow);
942 return E_NOTIMPL;
943}

◆ DocHostUIHandler_ShowContextMenu()

static HRESULT WINAPI DocHostUIHandler_ShowContextMenu ( IDocHostUIHandler2 *  iface,
DWORD  dwID,
POINT *  ppt,
IUnknown *  pcmdtReserved,
IDispatch *  pdispReserved 
)
static

Definition at line 845 of file dochost.c.

847{
850
851 TRACE("(%p)->(%ld %p %p %p)\n", This, dwID, ppt, pcmdtReserved, pdispReserved);
852
853 if(This->hostui) {
854 hres = IDocHostUIHandler_ShowContextMenu(This->hostui, dwID, ppt, pcmdtReserved,
855 pdispReserved);
856 if(hres == S_OK)
857 return S_OK;
858 }
859
860 FIXME("default action not implemented\n");
861 return E_NOTIMPL;
862}

◆ DocHostUIHandler_ShowUI()

static HRESULT WINAPI DocHostUIHandler_ShowUI ( IDocHostUIHandler2 *  iface,
DWORD  dwID,
IOleInPlaceActiveObject *  pActiveObject,
IOleCommandTarget *  pCommandTarget,
IOleInPlaceFrame *  pFrame,
IOleInPlaceUIWindow *  pDoc 
)
static

Definition at line 884 of file dochost.c.

887{
889 FIXME("(%p)->(%ld %p %p %p %p)\n", This, dwID, pActiveObject, pCommandTarget,
890 pFrame, pDoc);
891 return E_NOTIMPL;
892}

◆ DocHostUIHandler_TranslateAccelerator()

static HRESULT WINAPI DocHostUIHandler_TranslateAccelerator ( IDocHostUIHandler2 *  iface,
LPMSG  lpMsg,
const GUID *  pguidCmdGroup,
DWORD  nCmdID 
)
static

Definition at line 945 of file dochost.c.

947{
950 TRACE("(%p)->(%p %p %ld)\n", This, lpMsg, pguidCmdGroup, nCmdID);
951
952 if(This->hostui)
953 hr = IDocHostUIHandler_TranslateAccelerator(This->hostui, lpMsg, pguidCmdGroup, nCmdID);
954
955 return hr;
956}
HRESULT hr
Definition: delayimp.cpp:582
#define S_FALSE
Definition: winerror.h:3451

◆ DocHostUIHandler_TranslateUrl()

static HRESULT WINAPI DocHostUIHandler_TranslateUrl ( IDocHostUIHandler2 *  iface,
DWORD  dwTranslate,
OLECHAR *  pchURLIn,
OLECHAR **  ppchURLOut 
)
static

Definition at line 1002 of file dochost.c.

1004{
1006
1007 TRACE("(%p)->(%ld %s %p)\n", This, dwTranslate, debugstr_w(pchURLIn), ppchURLOut);
1008
1009 if(This->hostui)
1010 return IDocHostUIHandler_TranslateUrl(This->hostui, dwTranslate,
1011 pchURLIn, ppchURLOut);
1012
1013 return S_FALSE;
1014}
#define debugstr_w
Definition: kernel32.h:32

◆ DocHostUIHandler_UpdateUI()

static HRESULT WINAPI DocHostUIHandler_UpdateUI ( IDocHostUIHandler2 *  iface)
static

Definition at line 901 of file dochost.c.

902{
904
905 TRACE("(%p)\n", This);
906
907 if(!This->hostui)
908 return S_FALSE;
909
910 return IDocHostUIHandler_UpdateUI(This->hostui);
911}

◆ dump_travellog()

static void dump_travellog ( DocHost *  This)
static

Definition at line 417 of file dochost.c.

418{
419 unsigned i;
420
421 for(i=0; i < This->travellog.length; i++)
422 TRACE("%d: %s %s\n", i, i == This->travellog.position ? "=>" : " ", debugstr_w(This->travellog.log[i].url));
423 if(i == This->travellog.position)
424 TRACE("%d: =>\n", i);
425}

Referenced by update_travellog().

◆ free_travellog_entry()

static void free_travellog_entry ( travellog_entry_t *  entry)
static

Definition at line 385 of file dochost.c.

386{
387 if(entry->stream) {
388 IStream_Release(entry->stream);
389 entry->stream = NULL;
390 }
391 free(entry->url);
392 entry->url = NULL;
393}

Referenced by DocHost_Release(), and update_travellog().

◆ get_doc_ready_state()

static HRESULT get_doc_ready_state ( DocHost *  This,
READYSTATE *  ret 
)
static

Definition at line 179 of file dochost.c.

180{
181 DISPPARAMS dp = {NULL,NULL,0,0};
182 IDispatch *disp;
183 EXCEPINFO ei;
184 VARIANT var;
186
187 hres = IUnknown_QueryInterface(This->document, &IID_IDispatch, (void**)&disp);
188 if(FAILED(hres))
189 return hres;
190
192 &dp, &var, &ei, NULL);
193 IDispatch_Release(disp);
194 if(FAILED(hres)) {
195 WARN("Invoke(DISPID_READYSTATE failed: %08lx\n", hres);
196 return hres;
197 }
198
199 if(V_VT(&var) != VT_I4) {
200 WARN("V_VT(var) = %d\n", V_VT(&var));
202 return E_FAIL;
203 }
204
205 *ret = V_I4(&var);
206 return S_OK;
207}
#define WARN(fmt,...)
Definition: precomp.h:61
#define E_FAIL
Definition: ddrawi.h:102
return ret
Definition: mutex.c:147
#define DISPID_READYSTATE
Definition: idispids.h:22
const char * var
Definition: shader.c:5879
struct stdole::DISPPARAMS DISPPARAMS
struct stdole::EXCEPINFO EXCEPINFO
#define LOCALE_SYSTEM_DEFAULT
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
const GUID IID_IDispatch
#define IID_NULL
Definition: guiddef.h:98
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:626

Referenced by dochost_object_available(), and PropertyNotifySink_OnChanged().

◆ get_travellog_stream()

static IStream * get_travellog_stream ( DocHost *  This)
static

Definition at line 395 of file dochost.c.

396{
397 IPersistHistory *persist_history;
400
401 hres = IUnknown_QueryInterface(This->document, &IID_IPersistHistory, (void**)&persist_history);
402 if(FAILED(hres))
403 return NULL;
404
406 if(SUCCEEDED(hres))
407 hres = IPersistHistory_SaveHistory(persist_history, stream);
408 IPersistHistory_Release(persist_history);
409 if(FAILED(hres)) {
410 IStream_Release(stream);
411 return NULL;
412 }
413
414 return stream;
415}
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL delete_on_release, IStream **stream)
Definition: parse.h:23

Referenced by update_travellog().

◆ impl_from_IDocHostUIHandler2()

◆ impl_from_IOleCommandTarget()

static DocHost * impl_from_IOleCommandTarget ( IOleCommandTarget *  iface)
inlinestatic

◆ impl_from_IPropertyNotifySink()

static DocHost * impl_from_IPropertyNotifySink ( IPropertyNotifySink *  iface)
inlinestatic

◆ notif_complete()

static void notif_complete ( DocHost *  This,
DISPID  dispid 
)
static

Definition at line 114 of file dochost.c.

115{
116 DISPPARAMS dispparams;
118 VARIANT url;
119
120 dispparams.cArgs = 2;
121 dispparams.cNamedArgs = 0;
122 dispparams.rgdispidNamedArgs = NULL;
123 dispparams.rgvarg = params;
124
126 V_BYREF(params) = &url;
127
129 V_DISPATCH(params+1) = (IDispatch*)This->wb;
130
131 V_VT(&url) = VT_BSTR;
132 V_BSTR(&url) = SysAllocString(This->url);
133
134 TRACE("%ld >>>\n", dispid);
135 call_sink(This->cps.wbe2, dispid, &dispparams);
136 TRACE("%ld <<<\n", dispid);
137
139}
@ VT_BYREF
Definition: compat.h:2342
@ VT_VARIANT
Definition: compat.h:2307
@ VT_DISPATCH
Definition: compat.h:2304
void call_sink(ConnectionPoint *This, DISPID dispid, DISPPARAMS *dispparams)
Definition: events.c:390
GLenum const GLfloat * params
Definition: glext.h:5645
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:240
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:273
#define V_BYREF(A)
Definition: oleauto.h:228
#define V_DISPATCH(A)
Definition: oleauto.h:239

Referenced by update_ready_state().

◆ object_available()

static void object_available ( DocHost *  This)
static

Definition at line 141 of file dochost.c.

142{
143 IHlinkTarget *hlink;
145
146 TRACE("(%p)\n", This);
147
148 if(!This->document) {
149 WARN("document == NULL\n");
150 return;
151 }
152
153 hres = IUnknown_QueryInterface(This->document, &IID_IHlinkTarget, (void**)&hlink);
154 if(SUCCEEDED(hres)) {
155 hres = IHlinkTarget_Navigate(hlink, 0, NULL);
156 IHlinkTarget_Release(hlink);
157 if(FAILED(hres))
158 FIXME("Navigate failed\n");
159 }else {
160 IOleObject *ole_object;
161 RECT rect;
162
163 TRACE("No IHlink iface\n");
164
165 hres = IUnknown_QueryInterface(This->document, &IID_IOleObject, (void**)&ole_object);
166 if(FAILED(hres)) {
167 FIXME("Could not get IOleObject iface: %08lx\n", hres);
168 return;
169 }
170
171 GetClientRect(This->hwnd, &rect);
172 hres = IOleObject_DoVerb(ole_object, OLEIVERB_SHOW, NULL, &This->IOleClientSite_iface, -1, This->hwnd, &rect);
173 IOleObject_Release(ole_object);
174 if(FAILED(hres))
175 FIXME("DoVerb failed: %08lx\n", hres);
176 }
177}
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)

Referenced by object_available_proc().

◆ object_available_proc()

static void object_available_proc ( DocHost *  This,
task_header_t *  task 
)
static

Definition at line 299 of file dochost.c.

300{
302}
static void object_available(DocHost *This)
Definition: dochost.c:141

Referenced by dochost_object_available().

◆ object_available_task_destr()

static void object_available_task_destr ( task_header_t *  task)
static

Definition at line 294 of file dochost.c.

295{
296 free(task);
297}

Referenced by dochost_object_available().

◆ on_commandstate_change()

void on_commandstate_change ( DocHost *  doc_host,
LONG  command,
BOOL  enable 
)

Definition at line 83 of file dochost.c.

84{
85 DISPPARAMS dispparams;
87
88 TRACE("command=%ld enable=%d\n", command, enable);
89
90 dispparams.cArgs = 2;
91 dispparams.cNamedArgs = 0;
92 dispparams.rgdispidNamedArgs = NULL;
93 dispparams.rgvarg = params;
94
96 V_BOOL(params) = enable ? VARIANT_TRUE : VARIANT_FALSE;
97
98 V_VT(params+1) = VT_I4;
99 V_I4(params+1) = command;
100
101 call_sink(doc_host->cps.wbe2, DISPID_COMMANDSTATECHANGE, &dispparams);
102
104}
@ VT_BOOL
Definition: compat.h:2306
#define DISPID_COMMANDSTATECHANGE
Definition: exdispid.h:27
GLboolean enable
Definition: glext.h:11120
#define V_BOOL(A)
Definition: oleauto.h:224
ConnectionPoint * wbe2
Definition: ieframe.h:54
const IDocHostContainerVtbl * container_vtbl
Definition: ieframe.h:143
ConnectionPointContainer cps
Definition: ieframe.h:172
void(* on_command_state_change)(DocHost *, LONG, BOOL)
Definition: ieframe.h:114

Referenced by navigate_bsc(), OleObject_SetClientSite(), and update_navigation_commands().

◆ process_dochost_tasks()

LRESULT process_dochost_tasks ( DocHost *  This)

Definition at line 55 of file dochost.c.

56{
58
59 while(!list_empty(&This->task_queue)) {
60 task = LIST_ENTRY(This->task_queue.next, task_header_t, entry);
61 list_remove(&task->entry);
62
63 task->proc(This, task);
64 task->destr(task);
65 }
66
67 return 0;
68}
static int list_empty(struct list_entry *head)
Definition: list.h:58
#define LIST_ENTRY(type)
Definition: queue.h:175

Referenced by ie_window_proc(), and shell_embedding_proc().

◆ PropertyNotifySink_AddRef()

static ULONG WINAPI PropertyNotifySink_AddRef ( IPropertyNotifySink *  iface)
static

Definition at line 1081 of file dochost.c.

1082{
1084 return IOleClientSite_AddRef(&This->IOleClientSite_iface);
1085}
static DocHost * impl_from_IPropertyNotifySink(IPropertyNotifySink *iface)
Definition: dochost.c:1069

◆ PropertyNotifySink_OnChanged()

static HRESULT WINAPI PropertyNotifySink_OnChanged ( IPropertyNotifySink *  iface,
DISPID  dispID 
)
static

Definition at line 1093 of file dochost.c.

1094{
1096
1097 TRACE("(%p)->(%ld)\n", This, dispID);
1098
1099 switch(dispID) {
1100 case DISPID_READYSTATE: {
1101 READYSTATE ready_state;
1102 HRESULT hres;
1103
1104 hres = get_doc_ready_state(This, &ready_state);
1105 if(FAILED(hres))
1106 return hres;
1107
1108 if(ready_state == READYSTATE_COMPLETE && !This->doc_navigate)
1110
1111 update_ready_state(This, ready_state);
1112 break;
1113 }
1114 default:
1115 FIXME("unimplemented dispid %ld\n", dispID);
1116 return E_NOTIMPL;
1117 }
1118
1119 return S_OK;
1120}
static void update_ready_state(DocHost *This, READYSTATE ready_state)
Definition: dochost.c:241

◆ PropertyNotifySink_OnRequestEdit()

static HRESULT WINAPI PropertyNotifySink_OnRequestEdit ( IPropertyNotifySink *  iface,
DISPID  dispID 
)
static

Definition at line 1122 of file dochost.c.

1123{
1125 FIXME("(%p)->(%ld)\n", This, dispID);
1126 return E_NOTIMPL;
1127}

◆ PropertyNotifySink_QueryInterface()

static HRESULT WINAPI PropertyNotifySink_QueryInterface ( IPropertyNotifySink *  iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1074 of file dochost.c.

1076{
1078 return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppv);
1079}

◆ PropertyNotifySink_Release()

static ULONG WINAPI PropertyNotifySink_Release ( IPropertyNotifySink *  iface)
static

Definition at line 1087 of file dochost.c.

1088{
1090 return IOleClientSite_Release(&This->IOleClientSite_iface);
1091}

◆ push_dochost_task()

void push_dochost_task ( DocHost *  This,
task_header_t *  task,
task_proc_t  proc,
task_destr_t  destr,
BOOL  send 
)

Definition at line 39 of file dochost.c.

40{
41 BOOL is_empty;
42
43 task->proc = proc;
44 task->destr = destr;
45
46 is_empty = list_empty(&This->task_queue);
47 list_add_tail(&This->task_queue, &task->entry);
48
49 if(send)
50 SendMessageW(This->frame_hwnd, WM_DOCHOSTTASK, 0, 0);
51 else if(is_empty)
52 PostMessageW(This->frame_hwnd, WM_DOCHOSTTASK, 0, 0);
53}
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
INT WSAAPI send(IN SOCKET s, IN CONST CHAR FAR *buf, IN INT len, IN INT flags)
Definition: send.c:23
unsigned int BOOL
Definition: ntddk_ex.h:94
#define WM_DOCHOSTTASK
Definition: ieframe.h:300
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by async_doc_navigate(), dochost_object_available(), navigate_url(), and push_ready_state_task().

◆ push_ready_state_task()

static void push_ready_state_task ( DocHost *  This,
READYSTATE  ready_state 
)
static

Definition at line 283 of file dochost.c.

284{
286
287 IUnknown_AddRef(This->document);
288 task->doc = This->document;
289 task->ready_state = ready_state;
290
292}
static void ready_state_proc(DocHost *This, task_header_t *_task)
Definition: dochost.c:275
static void ready_state_task_destr(task_header_t *_task)
Definition: dochost.c:267

Referenced by dochost_object_available().

◆ ready_state_proc()

static void ready_state_proc ( DocHost *  This,
task_header_t *  _task 
)
static

Definition at line 275 of file dochost.c.

276{
278
279 if(task->doc == This->document)
280 update_ready_state(This, task->ready_state);
281}

Referenced by push_ready_state_task().

◆ ready_state_task_destr()

static void ready_state_task_destr ( task_header_t *  _task)
static

Definition at line 267 of file dochost.c.

268{
270
271 IUnknown_Release(task->doc);
272 free(task);
273}

Referenced by push_ready_state_task().

◆ refresh_document()

HRESULT refresh_document ( DocHost *  This,
const VARIANT *  level 
)

Definition at line 577 of file dochost.c.

578{
579 IOleCommandTarget *cmdtrg;
580 VARIANT vin, vout;
582
583 if(level && (V_VT(level) != VT_I4 || V_I4(level) != REFRESH_NORMAL))
584 FIXME("Unsupported refresh level %s\n", debugstr_variant(level));
585
586 if(!This->document) {
587 FIXME("no document\n");
588 return E_FAIL;
589 }
590
591 hres = IUnknown_QueryInterface(This->document, &IID_IOleCommandTarget, (void**)&cmdtrg);
592 if(FAILED(hres))
593 return hres;
594
595 V_VT(&vin) = VT_EMPTY;
596 V_VT(&vout) = VT_EMPTY;
597 hres = IOleCommandTarget_Exec(cmdtrg, NULL, OLECMDID_REFRESH, OLECMDEXECOPT_PROMPTUSER, &vin, &vout);
598 IOleCommandTarget_Release(cmdtrg);
599 if(FAILED(hres))
600 return hres;
601
602 VariantClear(&vout);
603 return S_OK;
604}
@ VT_EMPTY
Definition: compat.h:2295
GLint level
Definition: gl.h:1546

Referenced by activate_document(), InternetExplorer_Refresh(), InternetExplorer_Refresh2(), WebBrowser_Refresh(), and WebBrowser_Refresh2().

◆ release_dochost_client()

void release_dochost_client ( DocHost *  This)

Definition at line 632 of file dochost.c.

633{
634 if(This->hwnd) {
635 DestroyWindow(This->hwnd);
636 This->hwnd = NULL;
637 }
638
639 if(This->hostui) {
640 IDocHostUIHandler_Release(This->hostui);
641 This->hostui = NULL;
642 }
643
644 if(This->client_disp) {
645 IDispatch_Release(This->client_disp);
646 This->client_disp = NULL;
647 }
648
649 if(This->frame) {
650 IOleInPlaceFrame_Release(This->frame);
651 This->frame = NULL;
652 }
653
654 if(This->olecmd) {
655 IOleCommandTarget_Release(This->olecmd);
656 This->olecmd = NULL;
657 }
658}
BOOL WINAPI DestroyWindow(_In_ HWND)

Referenced by DocHost_Release(), and release_client_site().

◆ resize_document()

static LRESULT resize_document ( DocHost *  This,
LONG  width,
LONG  height 
)
static

Definition at line 352 of file dochost.c.

353{
354 RECT rect = {0, 0, width, height};
355
356 TRACE("(%p)->(%ld %ld)\n", This, width, height);
357
358 if(This->view)
359 IOleDocumentView_SetRect(This->view, &rect);
360
361 return 0;
362}
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546

Referenced by doc_view_proc().

◆ set_doc_state()

void set_doc_state ( DocHost *  This,
READYSTATE  doc_state 
)

Definition at line 234 of file dochost.c.

235{
236 This->doc_state = doc_state;
237 if(doc_state > This->ready_state)
238 This->ready_state = doc_state;
239}

Referenced by html_window_navigate(), navigate_bsc(), navigate_url(), and update_ready_state().

◆ update_navigation_commands()

void update_navigation_commands ( DocHost *  dochost)

Definition at line 106 of file dochost.c.

107{
108 unsigned pos = dochost->travellog.loading_pos == -1 ? dochost->travellog.position : dochost->travellog.loading_pos;
109
110 on_commandstate_change(dochost, CSC_NAVIGATEBACK, pos > 0);
111 on_commandstate_change(dochost, CSC_NAVIGATEFORWARD, pos < dochost->travellog.length);
112}
void on_commandstate_change(DocHost *doc_host, LONG command, BOOL enable)
Definition: dochost.c:83
struct DocHost::@534 travellog

Referenced by ClOleCommandTarget_Exec(), DocObjectService_FireNavigateComplete2(), and navigate_history().

◆ update_ready_state()

static void update_ready_state ( DocHost *  This,
READYSTATE  ready_state 
)
static

Definition at line 241 of file dochost.c.

242{
243 if(ready_state > READYSTATE_LOADING && This->travellog.loading_pos != -1) {
244 WARN("histupdate not notified\n");
245 This->travellog.position = This->travellog.loading_pos;
246 This->travellog.loading_pos = -1;
247 }
248
249 if(ready_state > READYSTATE_LOADING && This->doc_state <= READYSTATE_LOADING && !This->browser_service /* FIXME */)
251
252 if(ready_state == READYSTATE_COMPLETE && This->doc_state < READYSTATE_COMPLETE) {
253 set_doc_state(This, READYSTATE_COMPLETE);
254 if(!This->browser_service) /* FIXME: Not fully correct */
256 }else {
257 set_doc_state(This, ready_state);
258 }
259}
void set_doc_state(DocHost *This, READYSTATE doc_state)
Definition: dochost.c:234
static void notif_complete(DocHost *This, DISPID dispid)
Definition: dochost.c:114
#define DISPID_NAVIGATECOMPLETE2
Definition: exdispid.h:45
#define DISPID_DOCUMENTCOMPLETE
Definition: exdispid.h:52

Referenced by PropertyNotifySink_OnChanged(), and ready_state_proc().

◆ update_travellog()

static void update_travellog ( DocHost *  This)
static

Definition at line 427 of file dochost.c.

428{
429 travellog_entry_t *new_entry;
430
431 static const WCHAR about_schemeW[] = {'a','b','o','u','t',':'};
432
433 if(This->url && !wcsnicmp(This->url, about_schemeW, ARRAY_SIZE(about_schemeW))) {
434 TRACE("Skipping about URL\n");
435 return;
436 }
437
438 if(!This->travellog.log) {
439 This->travellog.log = malloc(4 * sizeof(*This->travellog.log));
440 if(!This->travellog.log)
441 return;
442
443 This->travellog.size = 4;
444 }else if(This->travellog.size < This->travellog.position+1) {
445 travellog_entry_t *new_travellog;
446
447 new_travellog = realloc(This->travellog.log, This->travellog.size * 2 * sizeof(*This->travellog.log));
448 if(!new_travellog)
449 return;
450
451 This->travellog.log = new_travellog;
452 This->travellog.size *= 2;
453 }
454
455 if(This->travellog.loading_pos == -1) {
456 /* Clear forward history. */
457 while(This->travellog.length > This->travellog.position)
458 free_travellog_entry(This->travellog.log + --This->travellog.length);
459 }
460
461 new_entry = This->travellog.log + This->travellog.position;
462
463 new_entry->url = wcsdup(This->url);
464 TRACE("Adding %s at %d\n", debugstr_w(This->url), This->travellog.position);
465 if(!new_entry->url)
466 return;
467
468 new_entry->stream = get_travellog_stream(This);
469
470 if(This->travellog.loading_pos == -1) {
471 This->travellog.position++;
472 This->travellog.log[This->travellog.position].stream = NULL;
473 This->travellog.log[This->travellog.position].url = NULL;
474 }else {
475 This->travellog.position = This->travellog.loading_pos;
476 This->travellog.loading_pos = -1;
477 }
478 if(This->travellog.position > This->travellog.length)
479 This->travellog.length = This->travellog.position;
480
482}
#define ARRAY_SIZE(A)
Definition: main.h:20
#define realloc
Definition: debug_ros.c:6
#define wcsnicmp
Definition: compat.h:14
static wchar_t * wcsdup(const wchar_t *str)
Definition: string.h:94
static void dump_travellog(DocHost *This)
Definition: dochost.c:417
static IStream * get_travellog_stream(DocHost *This)
Definition: dochost.c:395
Definition: ieframe.h:103
WCHAR * url
Definition: ieframe.h:104
IStream * stream
Definition: ieframe.h:105

Referenced by ClOleCommandTarget_Exec().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( ieframe  )

Variable Documentation

◆ doc_view_atom

ATOM doc_view_atom = 0
static

Definition at line 37 of file dochost.c.

Referenced by create_doc_view_hwnd().

◆ DocHostUIHandler2Vtbl

const IDocHostUIHandler2Vtbl DocHostUIHandler2Vtbl
static
Initial value:
= {
}
static HRESULT WINAPI DocHostUIHandler_ShowContextMenu(IDocHostUIHandler2 *iface, DWORD dwID, POINT *ppt, IUnknown *pcmdtReserved, IDispatch *pdispReserved)
Definition: dochost.c:845
static HRESULT WINAPI DocHostUIHandler_EnableModeless(IDocHostUIHandler2 *iface, BOOL fEnable)
Definition: dochost.c:913
static HRESULT WINAPI DocHostUIHandler_ShowUI(IDocHostUIHandler2 *iface, DWORD dwID, IOleInPlaceActiveObject *pActiveObject, IOleCommandTarget *pCommandTarget, IOleInPlaceFrame *pFrame, IOleInPlaceUIWindow *pDoc)
Definition: dochost.c:884
static HRESULT WINAPI DocHostUIHandler_HideUI(IDocHostUIHandler2 *iface)
Definition: dochost.c:894
static HRESULT WINAPI DocHostUIHandler_UpdateUI(IDocHostUIHandler2 *iface)
Definition: dochost.c:901
static ULONG WINAPI DocHostUIHandler_Release(IDocHostUIHandler2 *iface)
Definition: dochost.c:839
static HRESULT WINAPI DocHostUIHandler_ResizeBorder(IDocHostUIHandler2 *iface, LPCRECT prcBorder, IOleInPlaceUIWindow *pUIWindow, BOOL fRameWindow)
Definition: dochost.c:937
static HRESULT WINAPI DocHostUIHandler_TranslateAccelerator(IDocHostUIHandler2 *iface, LPMSG lpMsg, const GUID *pguidCmdGroup, DWORD nCmdID)
Definition: dochost.c:945
static HRESULT WINAPI DocHostUIHandler_GetExternal(IDocHostUIHandler2 *iface, IDispatch **ppDispatch)
Definition: dochost.c:979
static HRESULT WINAPI DocHostUIHandler_FilterDataObject(IDocHostUIHandler2 *iface, IDataObject *pDO, IDataObject **ppDORet)
Definition: dochost.c:1016
static ULONG WINAPI DocHostUIHandler_AddRef(IDocHostUIHandler2 *iface)
Definition: dochost.c:833
static HRESULT WINAPI DocHostUIHandler_TranslateUrl(IDocHostUIHandler2 *iface, DWORD dwTranslate, OLECHAR *pchURLIn, OLECHAR **ppchURLOut)
Definition: dochost.c:1002
static HRESULT WINAPI DocHostUIHandler_OnFrameWindowActivate(IDocHostUIHandler2 *iface, BOOL fActivate)
Definition: dochost.c:929
static HRESULT WINAPI DocHostUIHandler_GetOptionKeyPath(IDocHostUIHandler2 *iface, LPOLESTR *pchKey, DWORD dw)
Definition: dochost.c:958
static HRESULT WINAPI DocHostUIHandler_GetOverrideKeyPath(IDocHostUIHandler2 *iface, LPOLESTR *pchKey, DWORD dw)
Definition: dochost.c:1024
static HRESULT WINAPI DocHostUIHandler_OnDocWindowActivate(IDocHostUIHandler2 *iface, BOOL fActivate)
Definition: dochost.c:921
static HRESULT WINAPI DocHostUIHandler_QueryInterface(IDocHostUIHandler2 *iface, REFIID riid, void **ppv)
Definition: dochost.c:826
static HRESULT WINAPI DocHostUIHandler_GetHostInfo(IDocHostUIHandler2 *iface, DOCHOSTUIINFO *pInfo)
Definition: dochost.c:864
static HRESULT WINAPI DocHostUIHandler_GetDropTarget(IDocHostUIHandler2 *iface, IDropTarget *pDropTarget, IDropTarget **ppDropTarget)
Definition: dochost.c:971

Definition at line 1047 of file dochost.c.

Referenced by DocHost_Init().

◆ OleCommandTargetVtbl

const IOleCommandTargetVtbl OleCommandTargetVtbl
static
Initial value:
= {
}
static ULONG WINAPI ClOleCommandTarget_AddRef(IOleCommandTarget *iface)
Definition: dochost.c:672
static HRESULT WINAPI ClOleCommandTarget_QueryStatus(IOleCommandTarget *iface, const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText)
Definition: dochost.c:684
static ULONG WINAPI ClOleCommandTarget_Release(IOleCommandTarget *iface)
Definition: dochost.c:678
static HRESULT WINAPI ClOleCommandTarget_Exec(IOleCommandTarget *iface, const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
Definition: dochost.c:698
static HRESULT WINAPI ClOleCommandTarget_QueryInterface(IOleCommandTarget *iface, REFIID riid, void **ppv)
Definition: dochost.c:665

Definition at line 813 of file dochost.c.

Referenced by DocHost_Init().

◆ PropertyNotifySinkVtbl

const IPropertyNotifySinkVtbl PropertyNotifySinkVtbl
static
Initial value:
= {
}
static HRESULT WINAPI PropertyNotifySink_OnChanged(IPropertyNotifySink *iface, DISPID dispID)
Definition: dochost.c:1093
static ULONG WINAPI PropertyNotifySink_AddRef(IPropertyNotifySink *iface)
Definition: dochost.c:1081
static HRESULT WINAPI PropertyNotifySink_OnRequestEdit(IPropertyNotifySink *iface, DISPID dispID)
Definition: dochost.c:1122
static ULONG WINAPI PropertyNotifySink_Release(IPropertyNotifySink *iface)
Definition: dochost.c:1087
static HRESULT WINAPI PropertyNotifySink_QueryInterface(IPropertyNotifySink *iface, REFIID riid, void **ppv)
Definition: dochost.c:1074

Definition at line 1129 of file dochost.c.

Referenced by DocHost_Init().