ReactOS  0.4.14-dev-49-gfb4591c
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 IStreamget_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 release_dochost_client (DocHost *This)
 
static DocHostimpl_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 DocHostimpl_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 DocHostimpl_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 {
72  task_header_t *task, *cursor;
73 
74  LIST_FOR_EACH_ENTRY_SAFE(task, cursor, &This->task_queue, task_header_t, entry) {
75  if(proc && proc != task->proc)
76  continue;
77 
78  list_remove(&task->entry);
79  task->destr(task);
80  }
81 }
static HANDLE proc()
Definition: pdb.c:32
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
uint32_t entry
Definition: isohybrid.c:63
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
const char cursor[]
Definition: icontest.c:13
async_task_proc_t proc
Definition: internet.h:390

Referenced by async_doc_navigate(), and DocHost_Release().

◆ advise_prop_notif()

static void advise_prop_notif ( DocHost This,
BOOL  set 
)
static

Definition at line 210 of file dochost.c.

211 {
212  IConnectionPointContainer *cp_container;
214  HRESULT hres;
215 
216  hres = IUnknown_QueryInterface(This->document, &IID_IConnectionPointContainer, (void**)&cp_container);
217  if(FAILED(hres))
218  return;
219 
220  hres = IConnectionPointContainer_FindConnectionPoint(cp_container, &IID_IPropertyNotifySink, &cp);
221  IConnectionPointContainer_Release(cp_container);
222  if(FAILED(hres))
223  return;
224 
225  if(set)
226  hres = IConnectionPoint_Advise(cp, (IUnknown*)&This->IPropertyNotifySink_iface, &This->prop_notif_cookie);
227  else
228  hres = IConnectionPoint_Unadvise(cp, This->prop_notif_cookie);
229  IConnectionPoint_Release(cp);
230 
231  if(SUCCEEDED(hres))
232  This->is_prop_notif = set;
233 }
const GUID IID_IConnectionPointContainer
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static UINT set(struct ID3DXConstantTableImpl *table, IDirect3DDevice9 *device, struct ctab_constant *constant, const void **indata, D3DXPARAMETER_TYPE intype, UINT *size, UINT incol, D3DXPARAMETER_CLASS inclass, UINT index, BOOL is_pointer)
Definition: shader.c:1095
const GUID IID_IPropertyNotifySink
POINT cp
Definition: magnifier.c:59
Definition: _set.h:46
#define SUCCEEDED(hr)
Definition: intsafe.h:57

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

◆ ClOleCommandTarget_AddRef()

static ULONG WINAPI ClOleCommandTarget_AddRef ( IOleCommandTarget iface)
static

Definition at line 642 of file dochost.c.

643 {
645  return IOleClientSite_AddRef(&This->IOleClientSite_iface);
646 }
static DocHost * impl_from_IOleCommandTarget(IOleCommandTarget *iface)
Definition: dochost.c:630

◆ ClOleCommandTarget_Exec()

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

Definition at line 668 of file dochost.c.

671 {
673 
674  TRACE("(%p)->(%s %d %d %s %s)\n", This, debugstr_guid(pguidCmdGroup), nCmdID, nCmdexecopt,
675  debugstr_variant(pvaIn), debugstr_variant(pvaOut));
676 
677  if(!pguidCmdGroup) {
678  switch(nCmdID) {
679  case OLECMDID_UPDATECOMMANDS:
680  if(!This->olecmd)
681  return E_NOTIMPL;
682  return IOleCommandTarget_Exec(This->olecmd, pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);
683  case OLECMDID_SETDOWNLOADSTATE:
684  if(This->olecmd)
685  return IOleCommandTarget_Exec(This->olecmd, pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);
686 
687  if(!pvaIn || V_VT(pvaIn) != VT_I4)
688  return E_INVALIDARG;
689 
691  return S_OK;
692  default:
693  TRACE("Unimplemented cmdid %d\n", nCmdID);
694  return E_NOTIMPL;
695  }
696  }
697 
698  if(IsEqualGUID(pguidCmdGroup, &CGID_DocHostCmdPriv)) {
699  switch(nCmdID) {
701  if(!pvaIn || V_VT(pvaIn) != VT_UNKNOWN)
702  return E_INVALIDARG;
703 
704  if(This->doc_navigate)
705  IUnknown_Release(This->doc_navigate);
706  IUnknown_AddRef(V_UNKNOWN(pvaIn));
707  This->doc_navigate = V_UNKNOWN(pvaIn);
708  return S_OK;
709 
710  case 1: {
711  IHTMLWindow2 *win2;
712  SAFEARRAY *sa = V_ARRAY(pvaIn);
713  VARIANT status_code, url, htmlwindow;
714  LONG ind;
715  HRESULT hres;
716 
717  if(V_VT(pvaIn) != VT_ARRAY || !sa || (SafeArrayGetDim(sa) != 1))
718  return E_INVALIDARG;
719 
720  ind = 0;
722  if(FAILED(hres) || V_VT(&status_code)!=VT_I4)
723  return E_INVALIDARG;
724 
725  ind = 1;
726  hres = SafeArrayGetElement(sa, &ind, &url);
727  if(FAILED(hres) || V_VT(&url)!=VT_BSTR)
728  return E_INVALIDARG;
729 
730  ind = 3;
731  hres = SafeArrayGetElement(sa, &ind, &htmlwindow);
732  if(FAILED(hres) || V_VT(&htmlwindow)!=VT_UNKNOWN || !V_UNKNOWN(&htmlwindow))
733  return E_INVALIDARG;
734 
735  hres = IUnknown_QueryInterface(V_UNKNOWN(&htmlwindow), &IID_IHTMLWindow2, (void**)&win2);
736  if(FAILED(hres))
737  return E_INVALIDARG;
738 
740  IHTMLWindow2_Release(win2);
741  return S_OK;
742  }
743 
744  default:
745  TRACE("unsupported command %d of CGID_DocHostCmdPriv\n", nCmdID);
746  return E_NOTIMPL;
747  }
748  }
749 
750  if(IsEqualGUID(pguidCmdGroup, &CGID_Explorer)) {
751  switch(nCmdID) {
755  return S_OK;
756 
757  default:
758  TRACE("Unimplemented cmdid %d of CGID_Explorer\n", nCmdID);
759  return E_NOTIMPL;
760  }
761  }
762 
763  if(IsEqualGUID(pguidCmdGroup, &CGID_ShellDocView)) {
764  switch(nCmdID) {
765  default:
766  TRACE("Unimplemented cmdid %d of CGID_ShellDocView\n", nCmdID);
767  return E_NOTIMPL;
768  }
769  }
770 
771  if(IsEqualGUID(&CGID_DocHostCommandHandler, pguidCmdGroup)) {
772  if(!This->olecmd)
773  return E_NOTIMPL;
774  return IOleCommandTarget_Exec(This->olecmd, pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);
775  }
776 
777  TRACE("Unimplemented cmdid %d of group %s\n", nCmdID, debugstr_guid(pguidCmdGroup));
778  return E_NOTIMPL;
779 }
UINT WINAPI SafeArrayGetDim(SAFEARRAY *psa)
Definition: safearray.c:1096
Definition: compat.h:1939
#define V_ARRAY(A)
Definition: oleauto.h:222
static void update_travellog(DocHost *This)
Definition: dochost.c:425
HRESULT WINAPI SafeArrayGetElement(SAFEARRAY *psa, LONG *rgIndices, void *pvData)
Definition: safearray.c:949
__IHTMLWindow2_FWD_DEFINED__ typedef interface IHTMLWindow2 IHTMLWindow2
Definition: mshtmhst.idl:64
static DocHost * impl_from_IOleCommandTarget(IOleCommandTarget *iface)
Definition: dochost.c:630
void update_navigation_commands(DocHost *dochost)
Definition: dochost.c:106
#define V_I4(A)
Definition: oleauto.h:247
struct status_code status_code
void handle_navigation_error(DocHost *, HRESULT, BSTR, IHTMLWindow2 *) DECLSPEC_HIDDEN
Definition: navigate.c:310
long LONG
Definition: pedump.c:60
#define CMDID_EXPLORER_UPDATEHISTORY
Definition: dochost.c:35
#define E_INVALIDARG
Definition: ddrawi.h:101
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR url[]
Definition: encode.c:1432
#define V_VT(A)
Definition: oleauto.h:211
#define DOCHOST_DOCCANNAVIGATE
Definition: dochost.c:32
#define V_UNKNOWN(A)
Definition: oleauto.h:281
#define V_BSTR(A)
Definition: oleauto.h:226
static const char * debugstr_variant(const VARIANT *var)
Definition: container.c:46
#define S_OK
Definition: intsafe.h:59
void notify_download_state(DocHost *, BOOL) DECLSPEC_HIDDEN
Definition: navigate.c:149
#define E_NOTIMPL
Definition: ddrawi.h:99
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
static struct sockaddr_in sa
Definition: adnsresfilter.c:69

◆ ClOleCommandTarget_QueryInterface()

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

Definition at line 635 of file dochost.c.

637 {
639  return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppv);
640 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static DocHost * impl_from_IOleCommandTarget(IOleCommandTarget *iface)
Definition: dochost.c:630

◆ ClOleCommandTarget_QueryStatus()

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

Definition at line 654 of file dochost.c.

656 {
658  ULONG i;
659 
660  TRACE("(%p)->(%s %u %p %p)\n", This, debugstr_guid(pguidCmdGroup), cCmds, prgCmds,
661  pCmdText);
662  for(i=0; prgCmds && i < cCmds; i++)
663  TRACE("unsupported command %u (%x)\n", prgCmds[i].cmdID, prgCmds[i].cmdf);
664 
665  return E_NOTIMPL;
666 }
static DocHost * impl_from_IOleCommandTarget(IOleCommandTarget *iface)
Definition: dochost.c:630
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
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
OLECMDF cmdf
Definition: olecmd.c:709
#define E_NOTIMPL
Definition: ddrawi.h:99
unsigned int ULONG
Definition: retypes.h:1

◆ ClOleCommandTarget_Release()

static ULONG WINAPI ClOleCommandTarget_Release ( IOleCommandTarget iface)
static

Definition at line 648 of file dochost.c.

649 {
651  return IOleClientSite_Release(&This->IOleClientSite_iface);
652 }
static DocHost * impl_from_IOleCommandTarget(IOleCommandTarget *iface)
Definition: dochost.c:630

◆ create_doc_view_hwnd()

void create_doc_view_hwnd ( DocHost This)

Definition at line 480 of file dochost.c.

481 {
482  RECT rect;
483 
484  static const WCHAR wszShell_DocObject_View[] =
485  {'S','h','e','l','l',' ','D','o','c','O','b','j','e','c','t',' ','V','i','e','w',0};
486 
487  if(!doc_view_atom) {
488  static WNDCLASSEXW wndclass = {
489  sizeof(wndclass),
490  CS_PARENTDC,
492  0, 0 /* native uses 4*/, NULL, NULL, NULL,
493  (HBRUSH)(COLOR_WINDOW + 1), NULL,
494  wszShell_DocObject_View,
495  NULL
496  };
497 
498  wndclass.hInstance = ieframe_instance;
499 
500  doc_view_atom = RegisterClassExW(&wndclass);
501  }
502 
503  This->container_vtbl->get_docobj_rect(This, &rect);
504  This->hwnd = CreateWindowExW(0, wszShell_DocObject_View,
505  wszShell_DocObject_View,
507  rect.left, rect.top, rect.right, rect.bottom, This->frame_hwnd,
509 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
HINSTANCE ieframe_instance
Definition: ieframe_main.c:32
#define WS_CHILD
Definition: pedump.c:617
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define COLOR_WINDOW
Definition: winuser.h:908
& rect
Definition: startmenu.cpp:1413
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
static ATOM doc_view_atom
Definition: dochost.c:37
smooth NULL
Definition: ftsmooth.c:416
static LRESULT WINAPI doc_view_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dochost.c:365
__wchar_t WCHAR
Definition: xmlstorage.h:180
HINSTANCE hInstance
Definition: winuser.h:3195
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)
#define WS_TABSTOP
Definition: pedump.c:634
#define WS_VISIBLE
Definition: pedump.c:620
#define CS_PARENTDC
Definition: winuser.h:651

Referenced by create_frame_hwnd(), and navigate_bsc_proc().

◆ deactivate_document()

void deactivate_document ( DocHost This)

Definition at line 511 of file dochost.c.

512 {
514  IOleObject *oleobj = NULL;
515  IHlinkTarget *hlink = NULL;
516  HRESULT hres;
517 
518  if(!This->document) return;
519 
520  if(This->doc_navigate) {
521  IUnknown_Release(This->doc_navigate);
522  This->doc_navigate = NULL;
523  }
524 
525  if(This->is_prop_notif)
527 
528  if(This->view)
529  IOleDocumentView_UIActivate(This->view, FALSE);
530 
531  hres = IUnknown_QueryInterface(This->document, &IID_IOleInPlaceObjectWindowless,
532  (void**)&winobj);
533  if(SUCCEEDED(hres)) {
534  IOleInPlaceObjectWindowless_InPlaceDeactivate(winobj);
535  IOleInPlaceObjectWindowless_Release(winobj);
536  }
537 
538  if(This->view) {
539  IOleDocumentView_Show(This->view, FALSE);
540  IOleDocumentView_CloseView(This->view, 0);
541  IOleDocumentView_SetInPlaceSite(This->view, NULL);
542  IOleDocumentView_Release(This->view);
543  This->view = NULL;
544  }
545 
546  hres = IUnknown_QueryInterface(This->document, &IID_IOleObject, (void**)&oleobj);
547  if(SUCCEEDED(hres))
548  IOleObject_Close(oleobj, OLECLOSE_NOSAVE);
549 
550  hres = IUnknown_QueryInterface(This->document, &IID_IHlinkTarget, (void**)&hlink);
551  if(SUCCEEDED(hres)) {
552  IHlinkTarget_SetBrowseContext(hlink, NULL);
553  IHlinkTarget_Release(hlink);
554  }
555 
556  if(oleobj) {
558 
559  IOleObject_GetClientSite(oleobj, &client_site);
560  if(client_site) {
561  if(client_site == &This->IOleClientSite_iface)
562  IOleObject_SetClientSite(oleobj, NULL);
563  IOleClientSite_Release(client_site);
564  }
565 
566  IOleObject_Release(oleobj);
567  }
568 
569  IUnknown_Release(This->document);
570  This->document = NULL;
571 }
static IOleClientSite * client_site
Definition: activex.c:198
static void advise_prop_notif(DocHost *This, BOOL set)
Definition: dochost.c:210
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IOleObject
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define SUCCEEDED(hr)
Definition: intsafe.h:57

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

◆ DEFINE_OLEGUID()

DEFINE_OLEGUID ( CGID_DocHostCmdPriv  ,
0x000214D4L  ,
,
 
)

◆ doc_view_proc()

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

Definition at line 365 of file dochost.c.

366 {
367  DocHost *This;
368 
369  static const WCHAR wszTHIS[] = {'T','H','I','S',0};
370 
371  if(msg == WM_CREATE) {
372  This = *(DocHost**)lParam;
373  SetPropW(hwnd, wszTHIS, This);
374  }else {
375  This = GetPropW(hwnd, wszTHIS);
376  }
377 
378  switch(msg) {
379  case WM_SIZE:
381  }
382 
383  return DefWindowProcW(hwnd, msg, wParam, lParam);
384 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static LRESULT resize_document(DocHost *This, LONG width, LONG height)
Definition: dochost.c:353
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define WM_SIZE
Definition: winuser.h:1593
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
#define msg(x)
Definition: auth_time.c:54
#define WM_CREATE
Definition: winuser.h:1590
#define HIWORD(l)
Definition: typedefs.h:246
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

Referenced by create_doc_view_hwnd().

◆ DocHost_Init()

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

Definition at line 1105 of file dochost.c.

1106 {
1107  This->IDocHostUIHandler2_iface.lpVtbl = &DocHostUIHandler2Vtbl;
1108  This->IOleCommandTarget_iface.lpVtbl = &OleCommandTargetVtbl;
1109  This->IPropertyNotifySink_iface.lpVtbl = &PropertyNotifySinkVtbl;
1110 
1111  This->wb = wb;
1112  This->container_vtbl = container;
1113 
1114  This->ready_state = READYSTATE_UNINITIALIZED;
1115  list_init(&This->task_queue);
1116 
1117  This->travellog.loading_pos = -1;
1118 
1121 
1125 }
void DocHost_ClientSite_Init(DocHost *This)
Definition: client.c:712
struct container container
static const IDocHostUIHandler2Vtbl DocHostUIHandler2Vtbl
Definition: dochost.c:1015
void ConnectionPointContainer_Init(ConnectionPointContainer *This, IUnknown *impl)
Definition: events.c:431
static const IPropertyNotifySinkVtbl PropertyNotifySinkVtbl
Definition: dochost.c:1097
void DocHost_Frame_Init(DocHost *This)
Definition: frame.c:182
void NewWindowManager_Init(DocHost *) DECLSPEC_HIDDEN
void IEHTMLWindow_Init(DocHost *) DECLSPEC_HIDDEN
Definition: iehtmlwnd.c:692
static const IOleCommandTargetVtbl OleCommandTargetVtbl
Definition: dochost.c:781
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149

Referenced by create_ie(), and create_webbrowser().

◆ dochost_object_available()

HRESULT dochost_object_available ( DocHost This,
IUnknown doc 
)

Definition at line 305 of file dochost.c.

306 {
307  READYSTATE ready_state;
308  task_header_t *task;
309  IOleObject *oleobj;
310  HRESULT hres;
311 
312  IUnknown_AddRef(doc);
313  This->document = doc;
314 
315  hres = IUnknown_QueryInterface(doc, &IID_IOleObject, (void**)&oleobj);
316  if(SUCCEEDED(hres)) {
317  CLSID clsid;
318 
319  hres = IOleObject_GetUserClassID(oleobj, &clsid);
320  if(SUCCEEDED(hres))
321  TRACE("Got clsid %s\n",
322  IsEqualGUID(&clsid, &CLSID_HTMLDocument) ? "CLSID_HTMLDocument" : debugstr_guid(&clsid));
323 
324  hres = IOleObject_SetClientSite(oleobj, &This->IOleClientSite_iface);
325  if(FAILED(hres))
326  FIXME("SetClientSite failed: %08x\n", hres);
327 
328  IOleObject_Release(oleobj);
329  }else {
330  FIXME("Could not get IOleObject iface: %08x\n", hres);
331  }
332 
333  /* FIXME: Call SetAdvise */
334 
335  task = heap_alloc(sizeof(*task));
337 
338  hres = get_doc_ready_state(This, &ready_state);
339  if(SUCCEEDED(hres)) {
340  if(ready_state == READYSTATE_COMPLETE)
341  push_ready_state_task(This, READYSTATE_COMPLETE);
342  if(ready_state != READYSTATE_COMPLETE || This->doc_navigate)
344  }else if(!This->doc_navigate) {
345  /* If we can't get document's ready state, there is not much we can do.
346  * Assume that document is complete at this point. */
347  push_ready_state_task(This, READYSTATE_COMPLETE);
348  }
349 
350  return S_OK;
351 }
#define TRUE
Definition: types.h:120
static void object_available_proc(DocHost *This, task_header_t *task)
Definition: dochost.c:300
static void advise_prop_notif(DocHost *This, BOOL set)
Definition: dochost.c:210
static void object_available_task_destr(task_header_t *task)
Definition: dochost.c:295
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define FIXME(fmt,...)
Definition: debug.h:110
static void push_ready_state_task(DocHost *This, READYSTATE ready_state)
Definition: dochost.c:284
#define debugstr_guid
Definition: kernel32.h:35
const GUID IID_IOleObject
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
REFCLSID clsid
Definition: msctf.c:84
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 HRESULT get_doc_ready_state(DocHost *This, READYSTATE *ret)
Definition: dochost.c:180
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by BindStatusCallback_OnObjectAvailable().

◆ DocHost_Release()

void DocHost_Release ( DocHost This)

Definition at line 1127 of file dochost.c.

1128 {
1129  if(This->shell_ui_helper)
1130  IShellUIHelper2_Release(This->shell_ui_helper);
1131 
1135 
1137 
1138  while(This->travellog.length)
1139  free_travellog_entry(This->travellog.log + --This->travellog.length);
1140  heap_free(This->travellog.log);
1141 
1142  heap_free(This->url);
1143 }
void release_dochost_client(DocHost *This)
Definition: dochost.c:602
static void free_travellog_entry(travellog_entry_t *entry)
Definition: dochost.c:386
smooth NULL
Definition: ftsmooth.c:416
void abort_dochost_tasks(DocHost *This, task_proc_t proc)
Definition: dochost.c:70
void ConnectionPointContainer_Destroy(ConnectionPointContainer *This)
Definition: events.c:442
void DocHost_ClientSite_Release(DocHost *This)
Definition: client.c:722
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by InternetExplorer_Release(), and WebBrowser_Release().

◆ DocHostUIHandler_AddRef()

static ULONG WINAPI DocHostUIHandler_AddRef ( IDocHostUIHandler2 iface)
static

Definition at line 801 of file dochost.c.

802 {
804  return IOleClientSite_AddRef(&This->IOleClientSite_iface);
805 }
static DocHost * impl_from_IDocHostUIHandler2(IDocHostUIHandler2 *iface)
Definition: dochost.c:789

◆ DocHostUIHandler_EnableModeless()

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

Definition at line 881 of file dochost.c.

883 {
885  FIXME("(%p)->(%x)\n", This, fEnable);
886  return E_NOTIMPL;
887 }
static DocHost * impl_from_IDocHostUIHandler2(IDocHostUIHandler2 *iface)
Definition: dochost.c:789
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DocHostUIHandler_FilterDataObject()

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

Definition at line 984 of file dochost.c.

986 {
988  FIXME("(%p)->(%p %p)\n", This, pDO, ppDORet);
989  return E_NOTIMPL;
990 }
static DocHost * impl_from_IDocHostUIHandler2(IDocHostUIHandler2 *iface)
Definition: dochost.c:789
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DocHostUIHandler_GetDropTarget()

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

Definition at line 939 of file dochost.c.

941 {
943  FIXME("(%p)\n", This);
944  return E_NOTIMPL;
945 }
static DocHost * impl_from_IDocHostUIHandler2(IDocHostUIHandler2 *iface)
Definition: dochost.c:789
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DocHostUIHandler_GetExternal()

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

Definition at line 947 of file dochost.c.

949 {
951 
952  TRACE("(%p)->(%p)\n", This, ppDispatch);
953 
954  if(This->hostui)
955  return IDocHostUIHandler_GetExternal(This->hostui, ppDispatch);
956 
957  if(!This->shell_ui_helper) {
958  HRESULT hres;
959 
960  hres = create_shell_ui_helper(&This->shell_ui_helper);
961  if(FAILED(hres))
962  return hres;
963  }
964 
965  *ppDispatch = (IDispatch*)This->shell_ui_helper;
966  IDispatch_AddRef(*ppDispatch);
967  return S_OK;
968 }
static DocHost * impl_from_IDocHostUIHandler2(IDocHostUIHandler2 *iface)
Definition: dochost.c:789
HRESULT create_shell_ui_helper(IShellUIHelper2 **) DECLSPEC_HIDDEN
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59

◆ DocHostUIHandler_GetHostInfo()

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

Definition at line 832 of file dochost.c.

834 {
836  HRESULT hres;
837 
838  TRACE("(%p)->(%p)\n", This, pInfo);
839 
840  if(This->hostui) {
841  hres = IDocHostUIHandler_GetHostInfo(This->hostui, pInfo);
842  if(SUCCEEDED(hres))
843  return hres;
844  }
845 
849  return S_OK;
850 }
static DocHost * impl_from_IDocHostUIHandler2(IDocHostUIHandler2 *iface)
Definition: dochost.c:789
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ DocHostUIHandler_GetOptionKeyPath()

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

Definition at line 926 of file dochost.c.

928 {
930 
931  TRACE("(%p)->(%p %d)\n", This, pchKey, dw);
932 
933  if(This->hostui)
934  return IDocHostUIHandler_GetOptionKeyPath(This->hostui, pchKey, dw);
935 
936  return S_OK;
937 }
static DocHost * impl_from_IDocHostUIHandler2(IDocHostUIHandler2 *iface)
Definition: dochost.c:789
#define TRACE(s)
Definition: solgame.cpp:4
REFIID LPVOID DWORD dw
Definition: atlbase.h:40
#define S_OK
Definition: intsafe.h:59

◆ DocHostUIHandler_GetOverrideKeyPath()

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

Definition at line 992 of file dochost.c.

994 {
997  HRESULT hres;
998 
999  TRACE("(%p)->(%p %d)\n", This, pchKey, dw);
1000 
1001  if(!This->hostui)
1002  return S_OK;
1003 
1004  hres = IDocHostUIHandler_QueryInterface(This->hostui, &IID_IDocHostUIHandler2,
1005  (void**)&handler);
1006  if(SUCCEEDED(hres)) {
1007  hres = IDocHostUIHandler2_GetOverrideKeyPath(handler, pchKey, dw);
1008  IDocHostUIHandler2_Release(handler);
1009  return hres;
1010  }
1011 
1012  return S_OK;
1013 }
static DocHost * impl_from_IDocHostUIHandler2(IDocHostUIHandler2 *iface)
Definition: dochost.c:789
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
REFIID LPVOID DWORD dw
Definition: atlbase.h:40
#define S_OK
Definition: intsafe.h:59
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7786
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ DocHostUIHandler_HideUI()

static HRESULT WINAPI DocHostUIHandler_HideUI ( IDocHostUIHandler2 iface)
static

Definition at line 862 of file dochost.c.

863 {
865  FIXME("(%p)\n", This);
866  return E_NOTIMPL;
867 }
static DocHost * impl_from_IDocHostUIHandler2(IDocHostUIHandler2 *iface)
Definition: dochost.c:789
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DocHostUIHandler_OnDocWindowActivate()

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

Definition at line 889 of file dochost.c.

891 {
893  FIXME("(%p)->(%x)\n", This, fActivate);
894  return E_NOTIMPL;
895 }
static DocHost * impl_from_IDocHostUIHandler2(IDocHostUIHandler2 *iface)
Definition: dochost.c:789
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DocHostUIHandler_OnFrameWindowActivate()

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

Definition at line 897 of file dochost.c.

899 {
901  FIXME("(%p)->(%x)\n", This, fActivate);
902  return E_NOTIMPL;
903 }
static DocHost * impl_from_IDocHostUIHandler2(IDocHostUIHandler2 *iface)
Definition: dochost.c:789
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DocHostUIHandler_QueryInterface()

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

Definition at line 794 of file dochost.c.

796 {
798  return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppv);
799 }
static DocHost * impl_from_IDocHostUIHandler2(IDocHostUIHandler2 *iface)
Definition: dochost.c:789
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39

◆ DocHostUIHandler_Release()

static ULONG WINAPI DocHostUIHandler_Release ( IDocHostUIHandler2 iface)
static

Definition at line 807 of file dochost.c.

808 {
810  return IOleClientSite_Release(&This->IOleClientSite_iface);
811 }
static DocHost * impl_from_IDocHostUIHandler2(IDocHostUIHandler2 *iface)
Definition: dochost.c:789

◆ DocHostUIHandler_ResizeBorder()

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

Definition at line 905 of file dochost.c.

907 {
909  FIXME("(%p)->(%p %p %X)\n", This, prcBorder, pUIWindow, fRameWindow);
910  return E_NOTIMPL;
911 }
static DocHost * impl_from_IDocHostUIHandler2(IDocHostUIHandler2 *iface)
Definition: dochost.c:789
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DocHostUIHandler_ShowContextMenu()

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

Definition at line 813 of file dochost.c.

815 {
817  HRESULT hres;
818 
819  TRACE("(%p)->(%d %p %p %p)\n", This, dwID, ppt, pcmdtReserved, pdispReserved);
820 
821  if(This->hostui) {
822  hres = IDocHostUIHandler_ShowContextMenu(This->hostui, dwID, ppt, pcmdtReserved,
823  pdispReserved);
824  if(hres == S_OK)
825  return S_OK;
826  }
827 
828  FIXME("default action not implemented\n");
829  return E_NOTIMPL;
830 }
static DocHost * impl_from_IDocHostUIHandler2(IDocHostUIHandler2 *iface)
Definition: dochost.c:789
#define FIXME(fmt,...)
Definition: debug.h:110
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DocHostUIHandler_ShowUI()

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

Definition at line 852 of file dochost.c.

855 {
857  FIXME("(%p)->(%d %p %p %p %p)\n", This, dwID, pActiveObject, pCommandTarget,
858  pFrame, pDoc);
859  return E_NOTIMPL;
860 }
static DocHost * impl_from_IDocHostUIHandler2(IDocHostUIHandler2 *iface)
Definition: dochost.c:789
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DocHostUIHandler_TranslateAccelerator()

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

Definition at line 913 of file dochost.c.

915 {
917  HRESULT hr = S_FALSE;
918  TRACE("(%p)->(%p %p %d)\n", This, lpMsg, pguidCmdGroup, nCmdID);
919 
920  if(This->hostui)
921  hr = IDocHostUIHandler_TranslateAccelerator(This->hostui, lpMsg, pguidCmdGroup, nCmdID);
922 
923  return hr;
924 }
static DocHost * impl_from_IDocHostUIHandler2(IDocHostUIHandler2 *iface)
Definition: dochost.c:789
HRESULT hr
Definition: shlfolder.c:183
#define S_FALSE
Definition: winerror.h:2357
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77

◆ DocHostUIHandler_TranslateUrl()

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

Definition at line 970 of file dochost.c.

972 {
974 
975  TRACE("(%p)->(%d %s %p)\n", This, dwTranslate, debugstr_w(pchURLIn), ppchURLOut);
976 
977  if(This->hostui)
978  return IDocHostUIHandler_TranslateUrl(This->hostui, dwTranslate,
979  pchURLIn, ppchURLOut);
980 
981  return S_FALSE;
982 }
static DocHost * impl_from_IDocHostUIHandler2(IDocHostUIHandler2 *iface)
Definition: dochost.c:789
#define debugstr_w
Definition: kernel32.h:32
#define S_FALSE
Definition: winerror.h:2357
#define TRACE(s)
Definition: solgame.cpp:4

◆ DocHostUIHandler_UpdateUI()

static HRESULT WINAPI DocHostUIHandler_UpdateUI ( IDocHostUIHandler2 iface)
static

Definition at line 869 of file dochost.c.

870 {
872 
873  TRACE("(%p)\n", This);
874 
875  if(!This->hostui)
876  return S_FALSE;
877 
878  return IDocHostUIHandler_UpdateUI(This->hostui);
879 }
static DocHost * impl_from_IDocHostUIHandler2(IDocHostUIHandler2 *iface)
Definition: dochost.c:789
#define S_FALSE
Definition: winerror.h:2357
#define TRACE(s)
Definition: solgame.cpp:4

◆ dump_travellog()

static void dump_travellog ( DocHost This)
static

Definition at line 415 of file dochost.c.

416 {
417  unsigned i;
418 
419  for(i=0; i < This->travellog.length; i++)
420  TRACE("%d: %s %s\n", i, i == This->travellog.position ? "=>" : " ", debugstr_w(This->travellog.log[i].url));
421  if(i == This->travellog.position)
422  TRACE("%d: =>\n", i);
423 }
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
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by update_travellog().

◆ free_travellog_entry()

static void free_travellog_entry ( travellog_entry_t entry)
static

Definition at line 386 of file dochost.c.

387 {
388  if(entry->stream)
389  IStream_Release(entry->stream);
390  heap_free(entry->url);
391 }
uint32_t entry
Definition: isohybrid.c:63
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

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 180 of file dochost.c.

181 {
182  DISPPARAMS dp = {NULL,NULL,0,0};
183  IDispatch *disp;
184  EXCEPINFO ei;
185  VARIANT var;
186  HRESULT hres;
187 
188  hres = IUnknown_QueryInterface(This->document, &IID_IDispatch, (void**)&disp);
189  if(FAILED(hres))
190  return hres;
191 
193  &dp, &var, &ei, NULL);
194  IDispatch_Release(disp);
195  if(FAILED(hres)) {
196  WARN("Invoke(DISPID_READYSTATE failed: %08x\n", hres);
197  return hres;
198  }
199 
200  if(V_VT(&var) != VT_I4) {
201  WARN("V_VT(var) = %d\n", V_VT(&var));
202  VariantClear(&var);
203  return E_FAIL;
204  }
205 
206  *ret = V_I4(&var);
207  return S_OK;
208 }
disp
Definition: i386-dis.c:3181
Definition: compat.h:1939
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
#define WARN(fmt,...)
Definition: debug.h:111
#define E_FAIL
Definition: ddrawi.h:102
#define V_I4(A)
Definition: oleauto.h:247
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define LOCALE_SYSTEM_DEFAULT
const GUID IID_IDispatch
int ret
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651
#define IID_NULL
Definition: guiddef.h:98
#define V_VT(A)
Definition: oleauto.h:211
struct stdole::EXCEPINFO EXCEPINFO
#define S_OK
Definition: intsafe.h:59
#define DISPID_READYSTATE
Definition: idispids.h:22
struct stdole::DISPPARAMS DISPPARAMS

Referenced by dochost_object_available(), and PropertyNotifySink_OnChanged().

◆ get_travellog_stream()

static IStream* get_travellog_stream ( DocHost This)
static

Definition at line 393 of file dochost.c.

394 {
395  IPersistHistory *persist_history;
396  IStream *stream;
397  HRESULT hres;
398 
399  hres = IUnknown_QueryInterface(This->document, &IID_IPersistHistory, (void**)&persist_history);
400  if(FAILED(hres))
401  return NULL;
402 
404  if(SUCCEEDED(hres))
405  hres = IPersistHistory_SaveHistory(persist_history, stream);
406  IPersistHistory_Release(persist_history);
407  if(FAILED(hres)) {
408  IStream_Release(stream);
409  return NULL;
410  }
411 
412  return stream;
413 }
#define TRUE
Definition: types.h:120
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM *ppstm)
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
Definition: parse.h:22
GLuint GLuint stream
Definition: glext.h:7522
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by update_travellog().

◆ impl_from_IDocHostUIHandler2()

◆ impl_from_IOleCommandTarget()

static DocHost* impl_from_IOleCommandTarget ( IOleCommandTarget iface)
inlinestatic

Definition at line 630 of file dochost.c.

631 {
632  return CONTAINING_RECORD(iface, DocHost, IOleCommandTarget_iface);
633 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by ClOleCommandTarget_AddRef(), ClOleCommandTarget_Exec(), ClOleCommandTarget_QueryInterface(), ClOleCommandTarget_QueryStatus(), and ClOleCommandTarget_Release().

◆ impl_from_IPropertyNotifySink()

static DocHost* impl_from_IPropertyNotifySink ( IPropertyNotifySink iface)
inlinestatic

Definition at line 1037 of file dochost.c.

1038 {
1039  return CONTAINING_RECORD(iface, DocHost, IPropertyNotifySink_iface);
1040 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by PropertyNotifySink_AddRef(), PropertyNotifySink_OnChanged(), PropertyNotifySink_OnRequestEdit(), PropertyNotifySink_QueryInterface(), and PropertyNotifySink_Release().

◆ notif_complete()

static void notif_complete ( DocHost This,
DISPID  dispid 
)
static

Definition at line 114 of file dochost.c.

115 {
116  DISPPARAMS dispparams;
117  VARIANTARG params[2];
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 
128  V_VT(params+1) = VT_DISPATCH;
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("%d >>>\n", dispid);
135  call_sink(This->cps.wbe2, dispid, &dispparams);
136  TRACE("%d <<<\n", dispid);
137 
139  This->busy = VARIANT_FALSE;
140 }
#define V_DISPATCH(A)
Definition: oleauto.h:239
GLenum const GLfloat * params
Definition: glext.h:5645
void call_sink(ConnectionPoint *This, DISPID dispid, DISPPARAMS *dispparams)
Definition: events.c:391
#define V_BYREF(A)
Definition: oleauto.h:228
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
#define TRACE(s)
Definition: solgame.cpp:4
static const WCHAR url[]
Definition: encode.c:1432
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
struct stdole::DISPPARAMS DISPPARAMS

Referenced by update_ready_state().

◆ object_available()

static void object_available ( DocHost This)
static

Definition at line 142 of file dochost.c.

143 {
144  IHlinkTarget *hlink;
145  HRESULT hres;
146 
147  TRACE("(%p)\n", This);
148 
149  if(!This->document) {
150  WARN("document == NULL\n");
151  return;
152  }
153 
154  hres = IUnknown_QueryInterface(This->document, &IID_IHlinkTarget, (void**)&hlink);
155  if(SUCCEEDED(hres)) {
156  hres = IHlinkTarget_Navigate(hlink, 0, NULL);
157  IHlinkTarget_Release(hlink);
158  if(FAILED(hres))
159  FIXME("Navigate failed\n");
160  }else {
161  IOleObject *ole_object;
162  RECT rect;
163 
164  TRACE("No IHlink iface\n");
165 
166  hres = IUnknown_QueryInterface(This->document, &IID_IOleObject, (void**)&ole_object);
167  if(FAILED(hres)) {
168  FIXME("Could not get IOleObject iface: %08x\n", hres);
169  return;
170  }
171 
172  GetClientRect(This->hwnd, &rect);
173  hres = IOleObject_DoVerb(ole_object, OLEIVERB_SHOW, NULL, &This->IOleClientSite_iface, -1, This->hwnd, &rect);
174  IOleObject_Release(ole_object);
175  if(FAILED(hres))
176  FIXME("DoVerb failed: %08x\n", hres);
177  }
178 }
#define WARN(fmt,...)
Definition: debug.h:111
& rect
Definition: startmenu.cpp:1413
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IOleObject
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define OLEIVERB_SHOW
Definition: ole2.h:39
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by object_available_proc().

◆ object_available_proc()

static void object_available_proc ( DocHost This,
task_header_t task 
)
static

Definition at line 300 of file dochost.c.

301 {
303 }
static void object_available(DocHost *This)
Definition: dochost.c:142

Referenced by dochost_object_available().

◆ object_available_task_destr()

static void object_available_task_destr ( task_header_t task)
static

Definition at line 295 of file dochost.c.

296 {
297  heap_free(task);
298 }
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

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;
86  VARIANTARG params[2];
87 
88  TRACE("command=%d enable=%d\n", command, enable);
89 
90  dispparams.cArgs = 2;
91  dispparams.cNamedArgs = 0;
92  dispparams.rgdispidNamedArgs = NULL;
93  dispparams.rgvarg = params;
94 
95  V_VT(params) = VT_BOOL;
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 
103  doc_host->container_vtbl->on_command_state_change(doc_host, command, enable);
104 }
#define DISPID_COMMANDSTATECHANGE
Definition: webchild.h:40
Definition: compat.h:1939
void(* on_command_state_change)(DocHost *, LONG, BOOL)
Definition: ieframe.h:115
const IDocHostContainerVtbl * container_vtbl
Definition: ieframe.h:144
#define V_I4(A)
Definition: oleauto.h:247
ConnectionPointContainer cps
Definition: ieframe.h:173
GLenum const GLfloat * params
Definition: glext.h:5645
void call_sink(ConnectionPoint *This, DISPID dispid, DISPPARAMS *dispparams)
Definition: events.c:391
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define V_BOOL(A)
Definition: oleauto.h:224
#define V_VT(A)
Definition: oleauto.h:211
ConnectionPoint * wbe2
Definition: ieframe.h:55
GLboolean enable
Definition: glext.h:11120
int command(const char *fmt,...)
Definition: ftp.c:266
struct stdole::DISPPARAMS DISPPARAMS

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 {
57  task_header_t *task;
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 }
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
uint32_t entry
Definition: isohybrid.c:63
__WINE_SERVER_LIST_INLINE int list_empty(const struct list *list)
Definition: list.h:143
async_task_proc_t proc
Definition: internet.h:390
#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 1049 of file dochost.c.

1050 {
1052  return IOleClientSite_AddRef(&This->IOleClientSite_iface);
1053 }
static DocHost * impl_from_IPropertyNotifySink(IPropertyNotifySink *iface)
Definition: dochost.c:1037

◆ PropertyNotifySink_OnChanged()

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

Definition at line 1061 of file dochost.c.

1062 {
1064 
1065  TRACE("(%p)->(%d)\n", This, dispID);
1066 
1067  switch(dispID) {
1068  case DISPID_READYSTATE: {
1069  READYSTATE ready_state;
1070  HRESULT hres;
1071 
1072  hres = get_doc_ready_state(This, &ready_state);
1073  if(FAILED(hres))
1074  return hres;
1075 
1076  if(ready_state == READYSTATE_COMPLETE && !This->doc_navigate)
1078 
1079  update_ready_state(This, ready_state);
1080  break;
1081  }
1082  default:
1083  FIXME("unimplemented dispid %d\n", dispID);
1084  return E_NOTIMPL;
1085  }
1086 
1087  return S_OK;
1088 }
static void advise_prop_notif(DocHost *This, BOOL set)
Definition: dochost.c:210
static void update_ready_state(DocHost *This, READYSTATE ready_state)
Definition: dochost.c:242
#define FIXME(fmt,...)
Definition: debug.h:110
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static DocHost * impl_from_IPropertyNotifySink(IPropertyNotifySink *iface)
Definition: dochost.c:1037
static HRESULT get_doc_ready_state(DocHost *This, READYSTATE *ret)
Definition: dochost.c:180
#define S_OK
Definition: intsafe.h:59
#define E_NOTIMPL
Definition: ddrawi.h:99
#define DISPID_READYSTATE
Definition: idispids.h:22

◆ PropertyNotifySink_OnRequestEdit()

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

Definition at line 1090 of file dochost.c.

1091 {
1093  FIXME("(%p)->(%d)\n", This, dispID);
1094  return E_NOTIMPL;
1095 }
#define FIXME(fmt,...)
Definition: debug.h:110
static DocHost * impl_from_IPropertyNotifySink(IPropertyNotifySink *iface)
Definition: dochost.c:1037
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ PropertyNotifySink_QueryInterface()

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

Definition at line 1042 of file dochost.c.

1044 {
1046  return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppv);
1047 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static DocHost * impl_from_IPropertyNotifySink(IPropertyNotifySink *iface)
Definition: dochost.c:1037

◆ PropertyNotifySink_Release()

static ULONG WINAPI PropertyNotifySink_Release ( IPropertyNotifySink iface)
static

Definition at line 1055 of file dochost.c.

1056 {
1058  return IOleClientSite_Release(&This->IOleClientSite_iface);
1059 }
static DocHost * impl_from_IPropertyNotifySink(IPropertyNotifySink *iface)
Definition: dochost.c:1037

◆ 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 HANDLE proc()
Definition: pdb.c:32
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
unsigned int BOOL
Definition: ntddk_ex.h:94
#define WM_DOCHOSTTASK
Definition: ieframe.h:293
INT WSAAPI send(IN SOCKET s, IN CONST CHAR FAR *buf, IN INT len, IN INT flags)
Definition: send.c:23
__WINE_SERVER_LIST_INLINE int list_empty(const struct list *list)
Definition: list.h:143
async_task_proc_t proc
Definition: internet.h:390
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI PostMessageW(_In_opt_ 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 284 of file dochost.c.

285 {
287 
288  IUnknown_AddRef(This->document);
289  task->doc = This->document;
290  task->ready_state = ready_state;
291 
293 }
IUnknown * doc
Definition: dochost.c:264
static void ready_state_task_destr(task_header_t *_task)
Definition: dochost.c:268
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
static void ready_state_proc(DocHost *This, task_header_t *_task)
Definition: dochost.c:276
void push_dochost_task(DocHost *This, task_header_t *task, task_proc_t proc, task_destr_t destr, BOOL send)
Definition: dochost.c:39
task_header_t header
Definition: dochost.c:263
READYSTATE ready_state
Definition: dochost.c:265

Referenced by dochost_object_available().

◆ ready_state_proc()

static void ready_state_proc ( DocHost This,
task_header_t _task 
)
static

Definition at line 276 of file dochost.c.

277 {
278  ready_state_task_t *task = (ready_state_task_t*)_task;
279 
280  if(task->doc == This->document)
282 }
IUnknown * doc
Definition: dochost.c:264
static void update_ready_state(DocHost *This, READYSTATE ready_state)
Definition: dochost.c:242
READYSTATE ready_state
Definition: dochost.c:265

Referenced by push_ready_state_task().

◆ ready_state_task_destr()

static void ready_state_task_destr ( task_header_t _task)
static

Definition at line 268 of file dochost.c.

269 {
270  ready_state_task_t *task = (ready_state_task_t*)_task;
271 
272  IUnknown_Release(task->doc);
273  heap_free(task);
274 }
IUnknown * doc
Definition: dochost.c:264
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by push_ready_state_task().

◆ refresh_document()

HRESULT refresh_document ( DocHost This,
const VARIANT level 
)

Definition at line 573 of file dochost.c.

574 {
575  IOleCommandTarget *cmdtrg;
576  VARIANT vin, vout;
577  HRESULT hres;
578 
579  if(level && (V_VT(level) != VT_I4 || V_I4(level) != REFRESH_NORMAL))
580  FIXME("Unsupported refresh level %s\n", debugstr_variant(level));
581 
582  if(!This->document) {
583  FIXME("no document\n");
584  return E_FAIL;
585  }
586 
587  hres = IUnknown_QueryInterface(This->document, &IID_IOleCommandTarget, (void**)&cmdtrg);
588  if(FAILED(hres))
589  return hres;
590 
591  V_VT(&vin) = VT_EMPTY;
592  V_VT(&vout) = VT_EMPTY;
593  hres = IOleCommandTarget_Exec(cmdtrg, NULL, OLECMDID_REFRESH, OLECMDEXECOPT_PROMPTUSER, &vin, &vout);
594  IOleCommandTarget_Release(cmdtrg);
595  if(FAILED(hres))
596  return hres;
597 
598  VariantClear(&vout);
599  return S_OK;
600 }
GLint level
Definition: gl.h:1546
Definition: compat.h:1939
#define E_FAIL
Definition: ddrawi.h:102
#define V_I4(A)
Definition: oleauto.h:247
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651
#define V_VT(A)
Definition: oleauto.h:211
static const char * debugstr_variant(const VARIANT *var)
Definition: container.c:46
#define S_OK
Definition: intsafe.h:59

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

◆ release_dochost_client()

void release_dochost_client ( DocHost This)

Definition at line 602 of file dochost.c.

603 {
604  if(This->hwnd) {
605  DestroyWindow(This->hwnd);
606  This->hwnd = NULL;
607  }
608 
609  if(This->hostui) {
610  IDocHostUIHandler_Release(This->hostui);
611  This->hostui = NULL;
612  }
613 
614  if(This->client_disp) {
615  IDispatch_Release(This->client_disp);
616  This->client_disp = NULL;
617  }
618 
619  if(This->frame) {
620  IOleInPlaceFrame_Release(This->frame);
621  This->frame = NULL;
622  }
623 
624  if(This->olecmd) {
625  IOleCommandTarget_Release(This->olecmd);
626  This->olecmd = NULL;
627  }
628 }
BOOL WINAPI DestroyWindow(_In_ HWND)
smooth NULL
Definition: ftsmooth.c:416

Referenced by DocHost_Release(), and release_client_site().

◆ resize_document()

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

Definition at line 353 of file dochost.c.

354 {
355  RECT rect = {0, 0, width, height};
356 
357  TRACE("(%p)->(%d %d)\n", This, width, height);
358 
359  if(This->view)
360  IOleDocumentView_SetRect(This->view, &rect);
361 
362  return 0;
363 }
GLint GLint GLsizei width
Definition: gl.h:1546
& rect
Definition: startmenu.cpp:1413
#define TRACE(s)
Definition: solgame.cpp:4
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546

Referenced by doc_view_proc().

◆ set_doc_state()

void set_doc_state ( DocHost This,
READYSTATE  doc_state 
)

Definition at line 235 of file dochost.c.

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

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 
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::@408 travellog
SHDocVw::uuid CSC_NAVIGATEBACK
SHDocVw::uuid CSC_NAVIGATEFORWARD

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 242 of file dochost.c.

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

Referenced by PropertyNotifySink_OnChanged(), and ready_state_proc().

◆ update_travellog()

static void update_travellog ( DocHost This)
static

Definition at line 425 of file dochost.c.

426 {
427  travellog_entry_t *new_entry;
428 
429  static const WCHAR about_schemeW[] = {'a','b','o','u','t',':'};
430 
431  if(This->url && !strncmpiW(This->url, about_schemeW, ARRAY_SIZE(about_schemeW))) {
432  TRACE("Skipping about URL\n");
433  return;
434  }
435 
436  if(!This->travellog.log) {
437  This->travellog.log = heap_alloc(4 * sizeof(*This->travellog.log));
438  if(!This->travellog.log)
439  return;
440 
441  This->travellog.size = 4;
442  }else if(This->travellog.size < This->travellog.position+1) {
443  travellog_entry_t *new_travellog;
444 
445  new_travellog = heap_realloc(This->travellog.log, This->travellog.size*2*sizeof(*This->travellog.log));
446  if(!new_travellog)
447  return;
448 
449  This->travellog.log = new_travellog;
450  This->travellog.size *= 2;
451  }
452 
453  if(This->travellog.loading_pos == -1) {
454  /* Clear forward history. */
455  while(This->travellog.length > This->travellog.position)
456  free_travellog_entry(This->travellog.log + --This->travellog.length);
457  }
458 
459  new_entry = This->travellog.log + This->travellog.position;
460 
461  new_entry->url = heap_strdupW(This->url);
462  TRACE("Adding %s at %d\n", debugstr_w(This->url), This->travellog.position);
463  if(!new_entry->url)
464  return;
465 
466  new_entry->stream = get_travellog_stream(This);
467 
468  if(This->travellog.loading_pos == -1) {
469  This->travellog.position++;
470  }else {
471  This->travellog.position = This->travellog.loading_pos;
472  This->travellog.loading_pos = -1;
473  }
474  if(This->travellog.position > This->travellog.length)
475  This->travellog.length = This->travellog.position;
476 
478 }
static IStream * get_travellog_stream(DocHost *This)
Definition: dochost.c:393
IStream * stream
Definition: ieframe.h:106
WCHAR * url
Definition: ieframe.h:105
#define strncmpiW(s1, s2, n)
Definition: unicode.h:40
static void free_travellog_entry(travellog_entry_t *entry)
Definition: dochost.c:386
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:70
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
#define debugstr_w
Definition: kernel32.h:32
Definition: ieframe.h:104
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
static void dump_travellog(DocHost *This)
Definition: dochost.c:415
#define ARRAY_SIZE(a)
Definition: main.h:24

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_ShowUI(IDocHostUIHandler2 *iface, DWORD dwID, IOleInPlaceActiveObject *pActiveObject, IOleCommandTarget *pCommandTarget, IOleInPlaceFrame *pFrame, IOleInPlaceUIWindow *pDoc)
Definition: dochost.c:852
static ULONG WINAPI DocHostUIHandler_AddRef(IDocHostUIHandler2 *iface)
Definition: dochost.c:801
static HRESULT WINAPI DocHostUIHandler_GetOverrideKeyPath(IDocHostUIHandler2 *iface, LPOLESTR *pchKey, DWORD dw)
Definition: dochost.c:992
static HRESULT WINAPI DocHostUIHandler_TranslateUrl(IDocHostUIHandler2 *iface, DWORD dwTranslate, OLECHAR *pchURLIn, OLECHAR **ppchURLOut)
Definition: dochost.c:970
static HRESULT WINAPI DocHostUIHandler_GetExternal(IDocHostUIHandler2 *iface, IDispatch **ppDispatch)
Definition: dochost.c:947
static HRESULT WINAPI DocHostUIHandler_OnFrameWindowActivate(IDocHostUIHandler2 *iface, BOOL fActivate)
Definition: dochost.c:897
static HRESULT WINAPI DocHostUIHandler_HideUI(IDocHostUIHandler2 *iface)
Definition: dochost.c:862
static HRESULT WINAPI DocHostUIHandler_UpdateUI(IDocHostUIHandler2 *iface)
Definition: dochost.c:869
static HRESULT WINAPI DocHostUIHandler_TranslateAccelerator(IDocHostUIHandler2 *iface, LPMSG lpMsg, const GUID *pguidCmdGroup, DWORD nCmdID)
Definition: dochost.c:913
static HRESULT WINAPI DocHostUIHandler_QueryInterface(IDocHostUIHandler2 *iface, REFIID riid, void **ppv)
Definition: dochost.c:794
static ULONG WINAPI DocHostUIHandler_Release(IDocHostUIHandler2 *iface)
Definition: dochost.c:807
static HRESULT WINAPI DocHostUIHandler_EnableModeless(IDocHostUIHandler2 *iface, BOOL fEnable)
Definition: dochost.c:881
static HRESULT WINAPI DocHostUIHandler_GetHostInfo(IDocHostUIHandler2 *iface, DOCHOSTUIINFO *pInfo)
Definition: dochost.c:832
static HRESULT WINAPI DocHostUIHandler_ShowContextMenu(IDocHostUIHandler2 *iface, DWORD dwID, POINT *ppt, IUnknown *pcmdtReserved, IDispatch *pdispReserved)
Definition: dochost.c:813
static HRESULT WINAPI DocHostUIHandler_FilterDataObject(IDocHostUIHandler2 *iface, IDataObject *pDO, IDataObject **ppDORet)
Definition: dochost.c:984
static HRESULT WINAPI DocHostUIHandler_OnDocWindowActivate(IDocHostUIHandler2 *iface, BOOL fActivate)
Definition: dochost.c:889
static HRESULT WINAPI DocHostUIHandler_ResizeBorder(IDocHostUIHandler2 *iface, LPCRECT prcBorder, IOleInPlaceUIWindow *pUIWindow, BOOL fRameWindow)
Definition: dochost.c:905
static HRESULT WINAPI DocHostUIHandler_GetOptionKeyPath(IDocHostUIHandler2 *iface, LPOLESTR *pchKey, DWORD dw)
Definition: dochost.c:926
static HRESULT WINAPI DocHostUIHandler_GetDropTarget(IDocHostUIHandler2 *iface, IDropTarget *pDropTarget, IDropTarget **ppDropTarget)
Definition: dochost.c:939

Definition at line 1015 of file dochost.c.

Referenced by DocHost_Init().

◆ OleCommandTargetVtbl

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

Definition at line 781 of file dochost.c.

Referenced by DocHost_Init().

◆ PropertyNotifySinkVtbl

const IPropertyNotifySinkVtbl PropertyNotifySinkVtbl
static
Initial value:
= {
}
static ULONG WINAPI PropertyNotifySink_Release(IPropertyNotifySink *iface)
Definition: dochost.c:1055
static ULONG WINAPI PropertyNotifySink_AddRef(IPropertyNotifySink *iface)
Definition: dochost.c:1049
static HRESULT WINAPI PropertyNotifySink_OnChanged(IPropertyNotifySink *iface, DISPID dispID)
Definition: dochost.c:1061
static HRESULT WINAPI PropertyNotifySink_OnRequestEdit(IPropertyNotifySink *iface, DISPID dispID)
Definition: dochost.c:1090
static HRESULT WINAPI PropertyNotifySink_QueryInterface(IPropertyNotifySink *iface, REFIID riid, void **ppv)
Definition: dochost.c:1042

Definition at line 1097 of file dochost.c.

Referenced by DocHost_Init().