2 * Copyright 2005 Jacek Caban
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
34 #include "wine/debug.h"
36 #include "mshtml_private.h"
38 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
40 /**********************************************************
41 * IOleObject implementation
44 #define OLEOBJ_THIS(iface) DEFINE_THIS(HTMLDocument, OleObject, iface)
46 static HRESULT WINAPI OleObject_QueryInterface(IOleObject *iface, REFIID riid, void **ppvObject)
48 HTMLDocument *This = OLEOBJ_THIS(iface);
49 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
52 static ULONG WINAPI OleObject_AddRef(IOleObject *iface)
54 HTMLDocument *This = OLEOBJ_THIS(iface);
55 return IHTMLDocument2_AddRef(HTMLDOC(This));
58 static ULONG WINAPI OleObject_Release(IOleObject *iface)
60 HTMLDocument *This = OLEOBJ_THIS(iface);
61 return IHTMLDocument2_Release(HTMLDOC(This));
64 static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite *pClientSite)
66 HTMLDocument *This = OLEOBJ_THIS(iface);
67 IDocHostUIHandler *pDocHostUIHandler = NULL;
68 IOleCommandTarget *cmdtrg = NULL;
72 TRACE("(%p)->(%p)\n", This, pClientSite);
74 if(pClientSite == This->client)
78 IOleClientSite_Release(This->client);
80 This->usermode = UNKNOWN_USERMODE;
84 IDocHostUIHandler_Release(This->hostui);
88 memset(&This->hostinfo, 0, sizeof(DOCHOSTUIINFO));
93 hres = IOleObject_QueryInterface(pClientSite, &IID_IDocHostUIHandler, (void**)&pDocHostUIHandler);
95 DOCHOSTUIINFO hostinfo;
96 LPOLESTR key_path = NULL, override_key_path = NULL;
97 IDocHostUIHandler2 *pDocHostUIHandler2;
99 memset(&hostinfo, 0, sizeof(DOCHOSTUIINFO));
100 hostinfo.cbSize = sizeof(DOCHOSTUIINFO);
101 hres = IDocHostUIHandler_GetHostInfo(pDocHostUIHandler, &hostinfo);
102 if(SUCCEEDED(hres)) {
103 TRACE("hostinfo = {%u %08x %08x %s %s}\n",
104 hostinfo.cbSize, hostinfo.dwFlags, hostinfo.dwDoubleClick,
105 debugstr_w(hostinfo.pchHostCss), debugstr_w(hostinfo.pchHostNS));
106 memcpy(&This->hostinfo, &hostinfo, sizeof(DOCHOSTUIINFO));
109 if(!This->has_key_path) {
110 hres = IDocHostUIHandler_GetOptionKeyPath(pDocHostUIHandler, &key_path, 0);
111 if(hres == S_OK && key_path) {
113 /* FIXME: use key_path */
114 TRACE("key_path = %s\n", debugstr_w(key_path));
116 CoTaskMemFree(key_path);
119 hres = IDocHostUIHandler_QueryInterface(pDocHostUIHandler, &IID_IDocHostUIHandler2,
120 (void**)&pDocHostUIHandler2);
121 if(SUCCEEDED(hres)) {
122 hres = IDocHostUIHandler2_GetOverrideKeyPath(pDocHostUIHandler2, &override_key_path, 0);
123 if(hres == S_OK && override_key_path && override_key_path[0]) {
124 if(override_key_path[0]) {
125 /*FIXME: use override_key_path */
126 TRACE("override_key_path = %s\n", debugstr_w(override_key_path));
128 CoTaskMemFree(override_key_path);
130 IDocHostUIHandler2_Release(pDocHostUIHandler2);
133 This->has_key_path = TRUE;
137 /* Native calls here GetWindow. What is it for?
138 * We don't have anything to do with it here (yet). */
140 IOleWindow *pOleWindow = NULL;
143 hres = IOleClientSite_QueryInterface(pClientSite, &IID_IOleWindow, (void**)&pOleWindow);
144 if(SUCCEEDED(hres)) {
145 IOleWindow_GetWindow(pOleWindow, &hwnd);
146 IOleWindow_Release(pOleWindow);
150 hres = IOleClientSite_QueryInterface(pClientSite, &IID_IOleCommandTarget, (void**)&cmdtrg);
151 if(SUCCEEDED(hres)) {
153 OLECMD cmd = {OLECMDID_SETPROGRESSTEXT, 0};
155 IOleCommandTarget_QueryStatus(cmdtrg, NULL, 1, &cmd, NULL);
159 IOleCommandTarget_Exec(cmdtrg, NULL, OLECMDID_SETPROGRESSMAX,
160 OLECMDEXECOPT_DONTPROMPTUSER, &var, NULL);
161 IOleCommandTarget_Exec(cmdtrg, NULL, OLECMDID_SETPROGRESSPOS,
162 OLECMDEXECOPT_DONTPROMPTUSER, &var, NULL);
164 IOleCommandTarget_Release(cmdtrg);
167 IOleClientSite_AddRef(pClientSite);
168 This->client = pClientSite;
169 This->hostui = pDocHostUIHandler;
171 if(This->usermode == UNKNOWN_USERMODE)
172 IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_USERMODE);
174 IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_OFFLINEIFNOTCONNECTED);
176 hres = get_client_disp_property(This->client, DISPID_AMBIENT_SILENT, &silent);
177 if(SUCCEEDED(hres)) {
178 if(V_VT(&silent) != VT_BOOL)
179 WARN("V_VT(silent) = %d\n", V_VT(&silent));
180 else if(V_BOOL(&silent))
181 FIXME("silent == true\n");
184 IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_USERAGENT);
185 IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_PALETTE);
190 static HRESULT WINAPI OleObject_GetClientSite(IOleObject *iface, IOleClientSite **ppClientSite)
192 HTMLDocument *This = OLEOBJ_THIS(iface);
194 TRACE("(%p)->(%p)\n", This, ppClientSite);
200 IOleClientSite_AddRef(This->client);
201 *ppClientSite = This->client;
206 static HRESULT WINAPI OleObject_SetHostNames(IOleObject *iface, LPCOLESTR szContainerApp, LPCOLESTR szContainerObj)
208 HTMLDocument *This = OLEOBJ_THIS(iface);
209 FIXME("(%p)->(%s %s)\n", This, debugstr_w(szContainerApp), debugstr_w(szContainerObj));
213 static HRESULT WINAPI OleObject_Close(IOleObject *iface, DWORD dwSaveOption)
215 HTMLDocument *This = OLEOBJ_THIS(iface);
217 TRACE("(%p)->(%08x)\n", This, dwSaveOption);
219 if(dwSaveOption == OLECLOSE_PROMPTSAVE)
220 FIXME("OLECLOSE_PROMPTSAVE not implemented\n");
222 if(This->in_place_active)
223 IOleInPlaceObjectWindowless_InPlaceDeactivate(INPLACEWIN(This));
225 HTMLDocument_LockContainer(This, FALSE);
230 static HRESULT WINAPI OleObject_SetMoniker(IOleObject *iface, DWORD dwWhichMoniker, IMoniker *pmk)
232 HTMLDocument *This = OLEOBJ_THIS(iface);
233 FIXME("(%p %d %p)->()\n", This, dwWhichMoniker, pmk);
237 static HRESULT WINAPI OleObject_GetMoniker(IOleObject *iface, DWORD dwAssign, DWORD dwWhichMoniker, IMoniker **ppmk)
239 HTMLDocument *This = OLEOBJ_THIS(iface);
240 FIXME("(%p)->(%d %d %p)\n", This, dwAssign, dwWhichMoniker, ppmk);
244 static HRESULT WINAPI OleObject_InitFromData(IOleObject *iface, IDataObject *pDataObject, BOOL fCreation,
247 HTMLDocument *This = OLEOBJ_THIS(iface);
248 FIXME("(%p)->(%p %x %d)\n", This, pDataObject, fCreation, dwReserved);
252 static HRESULT WINAPI OleObject_GetClipboardData(IOleObject *iface, DWORD dwReserved, IDataObject **ppDataObject)
254 HTMLDocument *This = OLEOBJ_THIS(iface);
255 FIXME("(%p)->(%d %p)\n", This, dwReserved, ppDataObject);
259 static HRESULT WINAPI OleObject_DoVerb(IOleObject *iface, LONG iVerb, LPMSG lpmsg, IOleClientSite *pActiveSite,
260 LONG lindex, HWND hwndParent, LPCRECT lprcPosRect)
262 HTMLDocument *This = OLEOBJ_THIS(iface);
263 IOleDocumentSite *pDocSite;
266 TRACE("(%p)->(%d %p %p %d %p %p)\n", This, iVerb, lpmsg, pActiveSite, lindex, hwndParent, lprcPosRect);
268 if(iVerb != OLEIVERB_SHOW && iVerb != OLEIVERB_UIACTIVATE && iVerb != OLEIVERB_INPLACEACTIVATE) {
269 FIXME("iVerb = %d not supported\n", iVerb);
274 pActiveSite = This->client;
276 hres = IOleClientSite_QueryInterface(pActiveSite, &IID_IOleDocumentSite, (void**)&pDocSite);
277 if(SUCCEEDED(hres)) {
278 HTMLDocument_LockContainer(This, TRUE);
280 /* FIXME: Create new IOleDocumentView. See CreateView for more info. */
281 hres = IOleDocumentSite_ActivateMe(pDocSite, DOCVIEW(This));
282 IOleDocumentSite_Release(pDocSite);
284 hres = IOleDocumentView_UIActivate(DOCVIEW(This), TRUE);
285 if(SUCCEEDED(hres)) {
287 RECT rect; /* We need to pass rect as not const pointer */
288 memcpy(&rect, lprcPosRect, sizeof(RECT));
289 IOleDocumentView_SetRect(DOCVIEW(This), &rect);
291 IOleDocumentView_Show(DOCVIEW(This), TRUE);
298 static HRESULT WINAPI OleObject_EnumVerbs(IOleObject *iface, IEnumOLEVERB **ppEnumOleVerb)
300 HTMLDocument *This = OLEOBJ_THIS(iface);
301 FIXME("(%p)->(%p)\n", This, ppEnumOleVerb);
305 static HRESULT WINAPI OleObject_Update(IOleObject *iface)
307 HTMLDocument *This = OLEOBJ_THIS(iface);
308 FIXME("(%p)\n", This);
312 static HRESULT WINAPI OleObject_IsUpToDate(IOleObject *iface)
314 HTMLDocument *This = OLEOBJ_THIS(iface);
315 FIXME("(%p)\n", This);
319 static HRESULT WINAPI OleObject_GetUserClassID(IOleObject *iface, CLSID *pClsid)
321 HTMLDocument *This = OLEOBJ_THIS(iface);
323 TRACE("(%p)->(%p)\n", This, pClsid);
328 memcpy(pClsid, &CLSID_HTMLDocument, sizeof(GUID));
332 static HRESULT WINAPI OleObject_GetUserType(IOleObject *iface, DWORD dwFormOfType, LPOLESTR *pszUserType)
334 HTMLDocument *This = OLEOBJ_THIS(iface);
335 FIXME("(%p)->(%d %p)\n", This, dwFormOfType, pszUserType);
339 static HRESULT WINAPI OleObject_SetExtent(IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel)
341 HTMLDocument *This = OLEOBJ_THIS(iface);
342 FIXME("(%p)->(%d %p)\n", This, dwDrawAspect, psizel);
346 static HRESULT WINAPI OleObject_GetExtent(IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel)
348 HTMLDocument *This = OLEOBJ_THIS(iface);
349 FIXME("(%p)->(%d %p)\n", This, dwDrawAspect, psizel);
353 static HRESULT WINAPI OleObject_Advise(IOleObject *iface, IAdviseSink *pAdvSink, DWORD *pdwConnection)
355 HTMLDocument *This = OLEOBJ_THIS(iface);
356 FIXME("(%p)->(%p %p)\n", This, pAdvSink, pdwConnection);
360 static HRESULT WINAPI OleObject_Unadvise(IOleObject *iface, DWORD dwConnection)
362 HTMLDocument *This = OLEOBJ_THIS(iface);
363 FIXME("(%p)->(%d)\n", This, dwConnection);
367 static HRESULT WINAPI OleObject_EnumAdvise(IOleObject *iface, IEnumSTATDATA **ppenumAdvise)
369 HTMLDocument *This = OLEOBJ_THIS(iface);
370 FIXME("(%p)->(%p)\n", This, ppenumAdvise);
374 static HRESULT WINAPI OleObject_GetMiscStatus(IOleObject *iface, DWORD dwAspect, DWORD *pdwStatus)
376 HTMLDocument *This = OLEOBJ_THIS(iface);
377 FIXME("(%p)->(%d %p)\n", This, dwAspect, pdwStatus);
381 static HRESULT WINAPI OleObject_SetColorScheme(IOleObject *iface, LOGPALETTE *pLogpal)
383 HTMLDocument *This = OLEOBJ_THIS(iface);
384 FIXME("(%p)->(%p)\n", This, pLogpal);
390 static const IOleObjectVtbl OleObjectVtbl = {
391 OleObject_QueryInterface,
394 OleObject_SetClientSite,
395 OleObject_GetClientSite,
396 OleObject_SetHostNames,
398 OleObject_SetMoniker,
399 OleObject_GetMoniker,
400 OleObject_InitFromData,
401 OleObject_GetClipboardData,
405 OleObject_IsUpToDate,
406 OleObject_GetUserClassID,
407 OleObject_GetUserType,
412 OleObject_EnumAdvise,
413 OleObject_GetMiscStatus,
414 OleObject_SetColorScheme
417 /**********************************************************
418 * IOleDocument implementation
421 #define OLEDOC_THIS(iface) DEFINE_THIS(HTMLDocument, OleDocument, iface)
423 static HRESULT WINAPI OleDocument_QueryInterface(IOleDocument *iface, REFIID riid, void **ppvObject)
425 HTMLDocument *This = OLEDOC_THIS(iface);
426 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
429 static ULONG WINAPI OleDocument_AddRef(IOleDocument *iface)
431 HTMLDocument *This = OLEDOC_THIS(iface);
432 return IHTMLDocument2_AddRef(HTMLDOC(This));
435 static ULONG WINAPI OleDocument_Release(IOleDocument *iface)
437 HTMLDocument *This = OLEDOC_THIS(iface);
438 return IHTMLDocument2_Release(HTMLDOC(This));
441 static HRESULT WINAPI OleDocument_CreateView(IOleDocument *iface, IOleInPlaceSite *pIPSite, IStream *pstm,
442 DWORD dwReserved, IOleDocumentView **ppView)
444 HTMLDocument *This = OLEDOC_THIS(iface);
447 TRACE("(%p)->(%p %p %d %p)\n", This, pIPSite, pstm, dwReserved, ppView);
453 * Windows implementation creates new IOleDocumentView when function is called for the
454 * first time and returns E_FAIL when it is called for the second time, but it doesn't matter
455 * if the application uses returned interfaces, passed to ActivateMe or returned by
456 * QueryInterface, so there is no reason to create new interface. This needs more testing.
460 hres = IOleDocumentView_SetInPlaceSite(DOCVIEW(This), pIPSite);
466 FIXME("pstm is not supported\n");
468 IOleDocumentView_AddRef(DOCVIEW(This));
469 *ppView = DOCVIEW(This);
473 static HRESULT WINAPI OleDocument_GetDocMiscStatus(IOleDocument *iface, DWORD *pdwStatus)
475 HTMLDocument *This = OLEDOC_THIS(iface);
476 FIXME("(%p)->(%p)\n", This, pdwStatus);
480 static HRESULT WINAPI OleDocument_EnumViews(IOleDocument *iface, IEnumOleDocumentViews **ppEnum,
481 IOleDocumentView **ppView)
483 HTMLDocument *This = OLEDOC_THIS(iface);
484 FIXME("(%p)->(%p %p)\n", This, ppEnum, ppView);
490 static const IOleDocumentVtbl OleDocumentVtbl = {
491 OleDocument_QueryInterface,
494 OleDocument_CreateView,
495 OleDocument_GetDocMiscStatus,
496 OleDocument_EnumViews
499 /**********************************************************
500 * IOleControl implementation
503 #define CONTROL_THIS(iface) DEFINE_THIS(HTMLDocument, OleControl, iface)
505 static HRESULT WINAPI OleControl_QueryInterface(IOleControl *iface, REFIID riid, void **ppv)
507 HTMLDocument *This = CONTROL_THIS(iface);
508 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppv);
511 static ULONG WINAPI OleControl_AddRef(IOleControl *iface)
513 HTMLDocument *This = CONTROL_THIS(iface);
514 return IHTMLDocument2_AddRef(HTMLDOC(This));
517 static ULONG WINAPI OleControl_Release(IOleControl *iface)
519 HTMLDocument *This = CONTROL_THIS(iface);
520 return IHTMLDocument_Release(HTMLDOC(This));
523 static HRESULT WINAPI OleControl_GetControlInfo(IOleControl *iface, CONTROLINFO *pCI)
525 HTMLDocument *This = CONTROL_THIS(iface);
526 FIXME("(%p)->(%p)\n", This, pCI);
530 static HRESULT WINAPI OleControl_OnMnemonic(IOleControl *iface, MSG *pMsg)
532 HTMLDocument *This = CONTROL_THIS(iface);
533 FIXME("(%p)->(%p)\n", This, pMsg);
537 HRESULT get_client_disp_property(IOleClientSite *client, DISPID dispid, VARIANT *res)
539 IDispatch *disp = NULL;
540 DISPPARAMS dispparams = {NULL, 0};
544 hres = IOleClientSite_QueryInterface(client, &IID_IDispatch, (void**)&disp);
546 TRACE("Could not get IDispatch\n");
552 hres = IDispatch_Invoke(disp, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
553 DISPATCH_PROPERTYGET, &dispparams, res, NULL, &err);
555 IDispatch_Release(disp);
560 static HRESULT on_change_dlcontrol(HTMLDocument *This)
565 hres = get_client_disp_property(This->client, DISPID_AMBIENT_DLCONTROL, &res);
567 FIXME("unsupported dlcontrol %08x\n", V_I4(&res));
572 static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DISPID dispID)
574 HTMLDocument *This = CONTROL_THIS(iface);
579 TRACE("This->client = NULL\n");
584 case DISPID_AMBIENT_USERMODE:
585 TRACE("(%p)->(DISPID_AMBIENT_USERMODE)\n", This);
586 hres = get_client_disp_property(This->client, DISPID_AMBIENT_USERMODE, &res);
590 if(V_VT(&res) == VT_BOOL) {
592 This->usermode = BROWSEMODE;
594 FIXME("edit mode is not supported\n");
595 This->usermode = EDITMODE;
598 FIXME("V_VT(res)=%d\n", V_VT(&res));
601 case DISPID_AMBIENT_DLCONTROL:
602 TRACE("(%p)->(DISPID_AMBIENT_DLCONTROL)\n", This);
603 return on_change_dlcontrol(This);
604 case DISPID_AMBIENT_OFFLINEIFNOTCONNECTED:
605 TRACE("(%p)->(DISPID_AMBIENT_OFFLINEIFNOTCONNECTED)\n", This);
606 on_change_dlcontrol(This);
607 hres = get_client_disp_property(This->client, DISPID_AMBIENT_OFFLINEIFNOTCONNECTED, &res);
611 if(V_VT(&res) == VT_BOOL) {
613 FIXME("offline connection is not supported\n");
617 FIXME("V_VT(res)=%d\n", V_VT(&res));
620 case DISPID_AMBIENT_SILENT:
621 TRACE("(%p)->(DISPID_AMBIENT_SILENT)\n", This);
622 on_change_dlcontrol(This);
623 hres = get_client_disp_property(This->client, DISPID_AMBIENT_SILENT, &res);
627 if(V_VT(&res) == VT_BOOL) {
629 FIXME("silent mode is not supported\n");
633 FIXME("V_VT(res)=%d\n", V_VT(&res));
636 case DISPID_AMBIENT_USERAGENT:
637 TRACE("(%p)->(DISPID_AMBIENT_USERAGENT)\n", This);
638 hres = get_client_disp_property(This->client, DISPID_AMBIENT_USERAGENT, &res);
642 FIXME("not supported AMBIENT_USERAGENT\n");
645 case DISPID_AMBIENT_PALETTE:
646 TRACE("(%p)->(DISPID_AMBIENT_PALETTE)\n", This);
647 hres = get_client_disp_property(This->client, DISPID_AMBIENT_PALETTE, &res);
651 FIXME("not supported AMBIENT_PALETTE\n");
656 FIXME("(%p) unsupported dispID=%d\n", This, dispID);
660 static HRESULT WINAPI OleControl_FreezeEvents(IOleControl *iface, BOOL bFreeze)
662 HTMLDocument *This = CONTROL_THIS(iface);
663 FIXME("(%p)->(%x)\n", This, bFreeze);
669 static const IOleControlVtbl OleControlVtbl = {
670 OleControl_QueryInterface,
673 OleControl_GetControlInfo,
674 OleControl_OnMnemonic,
675 OleControl_OnAmbientPropertyChange,
676 OleControl_FreezeEvents
679 /**********************************************************
680 * ICustomDoc implementation
683 #define CUSTOMDOC_THIS(iface) DEFINE_THIS(HTMLDocument, CustomDoc, iface)
685 static HRESULT WINAPI CustomDoc_QueryInterface(ICustomDoc *iface, REFIID riid, void **ppv)
687 HTMLDocument *This = CUSTOMDOC_THIS(iface);
688 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppv);
691 static ULONG WINAPI CustomDoc_AddRef(ICustomDoc *iface)
693 HTMLDocument *This = CUSTOMDOC_THIS(iface);
694 return IHTMLDocument2_AddRef(HTMLDOC(This));
697 static ULONG WINAPI CustomDoc_Release(ICustomDoc *iface)
699 HTMLDocument *This = CUSTOMDOC_THIS(iface);
700 return IHTMLDocument_Release(HTMLDOC(This));
703 static HRESULT WINAPI CustomDoc_SetUIHandler(ICustomDoc *iface, IDocHostUIHandler *pUIHandler)
705 HTMLDocument *This = CUSTOMDOC_THIS(iface);
706 FIXME("(%p)->(%p)\n", This, pUIHandler);
710 #undef CUSTOMDOC_THIS
712 static const ICustomDocVtbl CustomDocVtbl = {
713 CustomDoc_QueryInterface,
716 CustomDoc_SetUIHandler
719 void HTMLDocument_LockContainer(HTMLDocument *This, BOOL fLock)
721 IOleContainer *container;
724 if(!This->client || This->container_locked == fLock)
727 hres = IOleClientSite_GetContainer(This->client, &container);
728 if(SUCCEEDED(hres)) {
729 IOleContainer_LockContainer(container, fLock);
730 This->container_locked = fLock;
731 IOleContainer_Release(container);
735 void HTMLDocument_OleObj_Init(HTMLDocument *This)
737 This->lpOleObjectVtbl = &OleObjectVtbl;
738 This->lpOleDocumentVtbl = &OleDocumentVtbl;
739 This->lpOleControlVtbl = &OleControlVtbl;
740 This->lpCustomDocVtbl = &CustomDocVtbl;
742 This->usermode = UNKNOWN_USERMODE;
747 This->has_key_path = FALSE;
748 This->container_locked = FALSE;
750 memset(&This->hostinfo, 0, sizeof(DOCHOSTUIINFO));