ReactOS  0.4.11-dev-745-g76daaf9
htmlwindow.c
Go to the documentation of this file.
1 /*
2  * Copyright 2006-2012 Jacek Caban for CodeWeavers
3  *
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.
8  *
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.
13  *
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
17  */
18 
19 #include "mshtml_private.h"
20 
21 #include <exdispid.h>
22 
23 static struct list window_list = LIST_INIT(window_list);
24 
26 {
27  return &window->outer_window->base == window;
28 }
29 
31 {
33 
34  while(!list_empty(&This->children)) {
35  child = LIST_ENTRY(list_tail(&This->children), HTMLOuterWindow, sibling_entry);
36 
37  list_remove(&child->sibling_entry);
38  child->parent = NULL;
39  IHTMLWindow2_Release(&child->base.IHTMLWindow2_iface);
40  }
41 }
42 
44 {
45  if(This->location) {
46  IHTMLLocation_AddRef(&This->location->IHTMLLocation_iface);
47  }else {
48  HRESULT hres;
49 
50  hres = HTMLLocation_Create(This, &This->location);
51  if(FAILED(hres))
52  return hres;
53  }
54 
55  *ret = This->location;
56  return S_OK;
57 }
58 
60 {
61  HTMLOuterWindow *iter;
62 
63  for(iter = window; iter->parent; iter = iter->parent);
64  *ret = iter;
65 }
66 
68 {
69  if(!window->inner_window->doc) {
70  FIXME("No document\n");
71  return E_FAIL;
72  }
73 
74  return set_event_handler(&window->inner_window->event_target, eid, var);
75 }
76 
78 {
79  if(!window->inner_window->doc) {
80  FIXME("No document\n");
81  return E_FAIL;
82  }
83 
84  return get_event_handler(&window->inner_window->event_target, eid, var);
85 }
86 
88 {
89  HTMLOuterWindow *outer_window = window->base.outer_window;
90 
91  if(outer_window && outer_window->doc_obj && outer_window == outer_window->doc_obj->basedoc.window)
93 
94  if(window->doc) {
95  detach_events(window->doc);
96  while(!list_empty(&window->doc->plugin_hosts))
98  }
99 
100  abort_window_bindings(window);
102  release_script_hosts(window);
103  window->base.outer_window = NULL;
104 
105  if(outer_window && outer_window->base.inner_window == window) {
106  outer_window->base.inner_window = NULL;
107  IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface);
108  }
109 }
110 
112 {
113  return CONTAINING_RECORD(iface, HTMLWindow, IHTMLWindow2_iface);
114 }
115 
117 {
118  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
119 
120  TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
121 
122  if(IsEqualGUID(&IID_IUnknown, riid)) {
123  *ppv = &This->IHTMLWindow2_iface;
124  }else if(IsEqualGUID(&IID_IDispatch, riid)) {
125  *ppv = &This->IHTMLWindow2_iface;
126  }else if(IsEqualGUID(&IID_IDispatchEx, riid)) {
127  *ppv = &This->IDispatchEx_iface;
128  }else if(IsEqualGUID(&IID_IHTMLFramesCollection2, riid)) {
129  *ppv = &This->IHTMLWindow2_iface;
130  }else if(IsEqualGUID(&IID_IHTMLWindow2, riid)) {
131  *ppv = &This->IHTMLWindow2_iface;
132  }else if(IsEqualGUID(&IID_IHTMLWindow3, riid)) {
133  *ppv = &This->IHTMLWindow3_iface;
134  }else if(IsEqualGUID(&IID_IHTMLWindow4, riid)) {
135  *ppv = &This->IHTMLWindow4_iface;
136  }else if(IsEqualGUID(&IID_IHTMLWindow5, riid)) {
137  *ppv = &This->IHTMLWindow5_iface;
138  }else if(IsEqualGUID(&IID_IHTMLWindow6, riid)) {
139  *ppv = &This->IHTMLWindow6_iface;
140  }else if(IsEqualGUID(&IID_IHTMLPrivateWindow, riid)) {
141  *ppv = &This->IHTMLPrivateWindow_iface;
142  }else if(IsEqualGUID(&IID_IServiceProvider, riid)) {
143  *ppv = &This->IServiceProvider_iface;
144  }else if(IsEqualGUID(&IID_ITravelLogClient, riid)) {
145  *ppv = &This->ITravelLogClient_iface;
146  }else if(IsEqualGUID(&IID_IObjectIdentity, riid)) {
147  *ppv = &This->IObjectIdentity_iface;
148  }else if(dispex_query_interface(&This->inner_window->event_target.dispex, riid, ppv)) {
149  assert(!*ppv);
150  return E_NOINTERFACE;
151  }else {
152  *ppv = NULL;
153  WARN("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
154  return E_NOINTERFACE;
155  }
156 
157  IUnknown_AddRef((IUnknown*)*ppv);
158  return S_OK;
159 }
160 
162 {
163  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
164  LONG ref = InterlockedIncrement(&This->ref);
165 
166  TRACE("(%p) ref=%d\n", This, ref);
167 
168  return ref;
169 }
170 
172 {
173  if(This->pending_window) {
176  IHTMLWindow2_Release(&This->pending_window->base.IHTMLWindow2_iface);
177  }
178 
180  set_current_mon(This, NULL, 0);
181  if(This->base.inner_window)
183  release_children(This);
184 
185  if(This->secmgr)
186  IInternetSecurityManager_Release(This->secmgr);
187 
188  if(This->frame_element)
190 
191  This->window_ref->window = NULL;
193 
194  if(This->nswindow)
195  nsIDOMWindow_Release(This->nswindow);
196 
197  list_remove(&This->entry);
198  heap_free(This);
199 }
200 
202 {
203  unsigned i;
204 
205  TRACE("%p\n", This);
206 
207  detach_inner_window(This);
208 
209  if(This->doc) {
210  This->doc->window = NULL;
211  htmldoc_release(&This->doc->basedoc);
212  }
213 
215 
216  for(i=0; i < This->global_prop_cnt; i++)
217  heap_free(This->global_props[i].name);
218  heap_free(This->global_props);
219 
220  if(This->location) {
221  This->location->window = NULL;
222  IHTMLLocation_Release(&This->location->IHTMLLocation_iface);
223  }
224 
225  if(This->image_factory) {
226  This->image_factory->window = NULL;
227  IHTMLImageElementFactory_Release(&This->image_factory->IHTMLImageElementFactory_iface);
228  }
229 
230  if(This->option_factory) {
231  This->option_factory->window = NULL;
232  IHTMLOptionElementFactory_Release(&This->option_factory->IHTMLOptionElementFactory_iface);
233  }
234 
235  if(This->xhr_factory) {
236  This->xhr_factory->window = NULL;
237  IHTMLXMLHttpRequestFactory_Release(&This->xhr_factory->IHTMLXMLHttpRequestFactory_iface);
238  }
239 
240  if(This->screen)
241  IHTMLScreen_Release(This->screen);
242 
243  if(This->history) {
244  This->history->window = NULL;
245  IOmHistory_Release(&This->history->IOmHistory_iface);
246  }
247 
248  if(This->session_storage)
249  IHTMLStorage_Release(This->session_storage);
250 
251  if(This->mon)
252  IMoniker_Release(This->mon);
253 
254  heap_free(This);
255 }
256 
258 {
259  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
260  LONG ref = InterlockedDecrement(&This->ref);
261 
262  TRACE("(%p) ref=%d\n", This, ref);
263 
264  if(!ref) {
265  if(is_outer_window(This))
267  else
269  }
270 
271  return ref;
272 }
273 
275 {
276  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
277 
278  return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
279 }
280 
282  LCID lcid, ITypeInfo **ppTInfo)
283 {
284  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
285 
286  return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
287 }
288 
290  LPOLESTR *rgszNames, UINT cNames,
291  LCID lcid, DISPID *rgDispId)
292 {
293  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
294 
295  return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
296  rgDispId);
297 }
298 
300  REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
301  VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
302 {
303  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
304 
305  return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
306  pDispParams, pVarResult, pExcepInfo, puArgErr);
307 }
308 
310 {
311  nsIDOMWindowCollection *nsframes;
312  nsIDOMWindow *nswindow;
313  UINT32 length;
314  nsresult nsres;
315 
316  nsres = nsIDOMWindow_GetFrames(This->nswindow, &nsframes);
317  if(NS_FAILED(nsres)) {
318  FIXME("nsIDOMWindow_GetFrames failed: 0x%08x\n", nsres);
319  return E_FAIL;
320  }
321 
322  nsres = nsIDOMWindowCollection_GetLength(nsframes, &length);
323  assert(nsres == NS_OK);
324 
325  if(index >= length) {
326  nsIDOMWindowCollection_Release(nsframes);
327  return DISP_E_MEMBERNOTFOUND;
328  }
329 
330  nsres = nsIDOMWindowCollection_Item(nsframes, index, &nswindow);
331  nsIDOMWindowCollection_Release(nsframes);
332  if(NS_FAILED(nsres)) {
333  FIXME("nsIDOMWindowCollection_Item failed: 0x%08x\n", nsres);
334  return E_FAIL;
335  }
336 
337  *ret = nswindow_to_window(nswindow);
338 
339  nsIDOMWindow_Release(nswindow);
340  return S_OK;
341 }
342 
344 {
345  nsIDOMWindowCollection *nsframes;
347  nsIDOMWindow *nswindow;
348  nsAString name_str;
349  UINT32 length, i;
350  nsresult nsres;
351  HRESULT hres = S_OK;
352 
353  nsres = nsIDOMWindow_GetFrames(This->nswindow, &nsframes);
354  if(NS_FAILED(nsres)) {
355  FIXME("nsIDOMWindow_GetFrames failed: 0x%08x\n", nsres);
356  return E_FAIL;
357  }
358 
359  if(!nsframes) {
360  WARN("nsIDOMWindow_GetFrames returned NULL nsframes: %p\n", This->nswindow);
361  return DISP_E_MEMBERNOTFOUND;
362  }
363 
364  nsAString_InitDepend(&name_str, name);
365  nsres = nsIDOMWindowCollection_NamedItem(nsframes, &name_str, &nswindow);
366  nsAString_Finish(&name_str);
367  if(NS_FAILED(nsres)) {
368  nsIDOMWindowCollection_Release(nsframes);
369  return E_FAIL;
370  }
371 
372  if(nswindow) {
373  *ret = nswindow_to_window(nswindow);
374  return S_OK;
375  }
376 
377  nsres = nsIDOMWindowCollection_GetLength(nsframes, &length);
378  assert(nsres == NS_OK);
379 
380  for(i = 0; i < length && !window; ++i) {
381  HTMLOuterWindow *window_iter;
382  BSTR id;
383 
384  nsres = nsIDOMWindowCollection_Item(nsframes, i, &nswindow);
385  if(NS_FAILED(nsres)) {
386  FIXME("nsIDOMWindowCollection_Item failed: 0x%08x\n", nsres);
387  hres = E_FAIL;
388  break;
389  }
390 
391  window_iter = nswindow_to_window(nswindow);
392 
393  nsIDOMWindow_Release(nswindow);
394 
395  if(!window_iter) {
396  WARN("nsIDOMWindow without HTMLOuterWindow: %p\n", nswindow);
397  continue;
398  }
399 
400  hres = IHTMLElement_get_id(&window_iter->frame_element->element.IHTMLElement_iface, &id);
401  if(FAILED(hres)) {
402  FIXME("IHTMLElement_get_id failed: 0x%08x\n", hres);
403  break;
404  }
405 
406  if(id && !strcmpiW(id, name))
407  window = window_iter;
408 
409  SysFreeString(id);
410 
411  if(!window && deep)
412  get_frame_by_name(window_iter, name, TRUE, &window);
413  }
414 
415  nsIDOMWindowCollection_Release(nsframes);
416  if(FAILED(hres))
417  return hres;
418 
419  *ret = window;
420  return NS_OK;
421 }
422 
423 static HRESULT WINAPI HTMLWindow2_item(IHTMLWindow2 *iface, VARIANT *pvarIndex, VARIANT *pvarResult)
424 {
425  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
427  HRESULT hres;
428 
429  TRACE("(%p)->(%p %p)\n", This, pvarIndex, pvarResult);
430 
431  switch(V_VT(pvarIndex)) {
432  case VT_I4: {
433  int index = V_I4(pvarIndex);
434  TRACE("Getting index %d\n", index);
435  if(index < 0)
436  return DISP_E_MEMBERNOTFOUND;
437  hres = get_frame_by_index(This->outer_window, index, &window);
438  break;
439  }
440  case VT_UINT: {
441  unsigned int index = V_UINT(pvarIndex);
442  TRACE("Getting index %u\n", index);
443  hres = get_frame_by_index(This->outer_window, index, &window);
444  break;
445  }
446  case VT_BSTR: {
447  BSTR str = V_BSTR(pvarIndex);
448  TRACE("Getting name %s\n", wine_dbgstr_w(str));
449  hres = get_frame_by_name(This->outer_window, str, FALSE, &window);
450  break;
451  }
452  default:
453  WARN("Invalid index %s\n", debugstr_variant(pvarIndex));
454  return E_INVALIDARG;
455  }
456 
457  if(FAILED(hres))
458  return hres;
459  if(!window)
460  return DISP_E_MEMBERNOTFOUND;
461 
462  IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface);
463  V_VT(pvarResult) = VT_DISPATCH;
464  V_DISPATCH(pvarResult) = (IDispatch*)window;
465  return S_OK;
466 }
467 
469 {
470  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
471  nsIDOMWindowCollection *nscollection;
472  UINT32 length;
473  nsresult nsres;
474 
475  TRACE("(%p)->(%p)\n", This, p);
476 
477  nsres = nsIDOMWindow_GetFrames(This->outer_window->nswindow, &nscollection);
478  if(NS_FAILED(nsres)) {
479  ERR("GetFrames failed: %08x\n", nsres);
480  return E_FAIL;
481  }
482 
483  nsres = nsIDOMWindowCollection_GetLength(nscollection, &length);
484  nsIDOMWindowCollection_Release(nscollection);
485  if(NS_FAILED(nsres)) {
486  ERR("GetLength failed: %08x\n", nsres);
487  return E_FAIL;
488  }
489 
490  *p = length;
491  return S_OK;
492 }
493 
494 static HRESULT WINAPI HTMLWindow2_get_frames(IHTMLWindow2 *iface, IHTMLFramesCollection2 **p)
495 {
496  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
497  FIXME("(%p)->(%p): semi-stub\n", This, p);
498 
499  /* FIXME: Should return a separate Window object */
500  *p = (IHTMLFramesCollection2*)&This->IHTMLWindow2_iface;
501  HTMLWindow2_AddRef(iface);
502  return S_OK;
503 }
504 
506 {
507  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
508  FIXME("(%p)->(%s)\n", This, debugstr_w(v));
509  return E_NOTIMPL;
510 }
511 
513 {
514  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
515  FIXME("(%p)->(%p)\n", This, p);
516  return E_NOTIMPL;
517 }
518 
520 {
521  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
522 
523  WARN("(%p)->(%s)\n", This, debugstr_w(v));
524 
525  /*
526  * FIXME: Since IE7, setting status is blocked, but still possible in certain circumstances.
527  * Ignoring the call should be enough for us.
528  */
529  return S_OK;
530 }
531 
533 {
534  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
535 
536  TRACE("(%p)->(%p)\n", This, p);
537 
538  /* See put_status */
539  *p = NULL;
540  return S_OK;
541 }
542 
544  LONG msec, VARIANT *language, LONG *timerID)
545 {
546  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
547  VARIANT expr_var;
548 
549  TRACE("(%p)->(%s %d %p %p)\n", This, debugstr_w(expression), msec, language, timerID);
550 
551  V_VT(&expr_var) = VT_BSTR;
552  V_BSTR(&expr_var) = expression;
553 
554  return IHTMLWindow3_setTimeout(&This->IHTMLWindow3_iface, &expr_var, msec, language, timerID);
555 }
556 
558 {
559  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
560 
561  TRACE("(%p)->(%d)\n", This, timerID);
562 
563  return clear_task_timer(This->inner_window, FALSE, timerID);
564 }
565 
566 #define MAX_MESSAGE_LEN 2000
567 
569 {
570  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
571  WCHAR title[100], *msg = message;
572  DWORD len;
573 
574  TRACE("(%p)->(%s)\n", This, debugstr_w(message));
575 
577  sizeof(title)/sizeof(WCHAR))) {
578  WARN("Could not load message box title: %d\n", GetLastError());
579  return S_OK;
580  }
581 
582  len = SysStringLen(message);
583  if(len > MAX_MESSAGE_LEN) {
584  msg = heap_alloc((MAX_MESSAGE_LEN+1)*sizeof(WCHAR));
585  if(!msg)
586  return E_OUTOFMEMORY;
587  memcpy(msg, message, MAX_MESSAGE_LEN*sizeof(WCHAR));
588  msg[MAX_MESSAGE_LEN] = 0;
589  }
590 
591  MessageBoxW(This->outer_window->doc_obj->hwnd, msg, title, MB_ICONWARNING);
592  if(msg != message)
593  heap_free(msg);
594  return S_OK;
595 }
596 
598  VARIANT_BOOL *confirmed)
599 {
600  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
601  WCHAR wszTitle[100];
602 
603  TRACE("(%p)->(%s %p)\n", This, debugstr_w(message), confirmed);
604 
605  if(!confirmed) return E_INVALIDARG;
606 
608  sizeof(wszTitle)/sizeof(WCHAR))) {
609  WARN("Could not load message box title: %d\n", GetLastError());
610  *confirmed = VARIANT_TRUE;
611  return S_OK;
612  }
613 
614  if(MessageBoxW(This->outer_window->doc_obj->hwnd, message, wszTitle,
616  *confirmed = VARIANT_TRUE;
617  else *confirmed = VARIANT_FALSE;
618 
619  return S_OK;
620 }
621 
622 typedef struct
623 {
627 }prompt_arg;
628 
631 {
632  switch(msg)
633  {
634  case WM_INITDIALOG:
635  {
636  prompt_arg *arg = (prompt_arg*)lparam;
637  WCHAR wszTitle[100];
638 
640  sizeof(wszTitle)/sizeof(WCHAR))) {
641  WARN("Could not load message box title: %d\n", GetLastError());
642  EndDialog(hwnd, wparam);
643  return FALSE;
644  }
645 
646  SetWindowLongPtrW(hwnd, DWLP_USER, lparam);
647  SetWindowTextW(hwnd, wszTitle);
650  return FALSE;
651  }
652  case WM_COMMAND:
653  switch(wparam)
654  {
656  EndDialog(hwnd, wparam);
657  return TRUE;
658  case MAKEWPARAM(IDOK, BN_CLICKED):
659  {
660  prompt_arg *arg =
662  HWND hwndPrompt = GetDlgItem(hwnd, ID_PROMPT_EDIT);
663  INT len = GetWindowTextLengthW(hwndPrompt);
664 
665  if(!arg->textdata)
666  {
667  EndDialog(hwnd, wparam);
668  return TRUE;
669  }
670 
671  V_VT(arg->textdata) = VT_BSTR;
672  if(!len && !arg->dststr)
673  V_BSTR(arg->textdata) = NULL;
674  else
675  {
676  V_BSTR(arg->textdata) = SysAllocStringLen(NULL, len);
677  GetWindowTextW(hwndPrompt, V_BSTR(arg->textdata), len+1);
678  }
679  EndDialog(hwnd, wparam);
680  return TRUE;
681  }
682  }
683  return FALSE;
684  case WM_CLOSE:
685  EndDialog(hwnd, IDCANCEL);
686  return TRUE;
687  default:
688  return FALSE;
689  }
690 }
691 
693  BSTR dststr, VARIANT *textdata)
694 {
695  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
696  prompt_arg arg;
697 
698  TRACE("(%p)->(%s %s %p)\n", This, debugstr_w(message), debugstr_w(dststr), textdata);
699 
700  if(textdata) V_VT(textdata) = VT_NULL;
701 
702  arg.message = message;
703  arg.dststr = dststr;
704  arg.textdata = textdata;
705 
707  This->outer_window->doc_obj->hwnd, prompt_dlgproc, (LPARAM)&arg);
708  return S_OK;
709 }
710 
711 static HRESULT WINAPI HTMLWindow2_get_Image(IHTMLWindow2 *iface, IHTMLImageElementFactory **p)
712 {
713  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
715 
716  TRACE("(%p)->(%p)\n", This, p);
717 
718  if(!window->image_factory) {
719  HRESULT hres;
720 
721  hres = HTMLImageElementFactory_Create(window, &window->image_factory);
722  if(FAILED(hres))
723  return hres;
724  }
725 
727  IHTMLImageElementFactory_AddRef(*p);
728 
729  return S_OK;
730 }
731 
732 static HRESULT WINAPI HTMLWindow2_get_location(IHTMLWindow2 *iface, IHTMLLocation **p)
733 {
734  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
736  HRESULT hres;
737 
738  TRACE("(%p)->(%p)\n", This, p);
739 
740  hres = get_location(This->inner_window, &location);
741  if(FAILED(hres))
742  return hres;
743 
744  *p = &location->IHTMLLocation_iface;
745  return S_OK;
746 }
747 
749 {
750  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
752 
753  TRACE("(%p)->(%p)\n", This, p);
754 
755  if(!window->history) {
756  HRESULT hres;
757 
758  hres = create_history(window, &window->history);
759  if(FAILED(hres))
760  return hres;
761  }
762 
763  IOmHistory_AddRef(&window->history->IOmHistory_iface);
764  *p = &window->history->IOmHistory_iface;
765  return S_OK;
766 }
767 
769 {
770  IConnectionPointContainer *cp_container;
771  VARIANT_BOOL cancel = VARIANT_FALSE;
772  IEnumConnections *enum_conn;
773  VARIANT args[2];
774  DISPPARAMS dp = {args, NULL, 2, 0};
775  CONNECTDATA conn_data;
777  IDispatch *disp;
778  ULONG fetched;
779  HRESULT hres;
780 
781  if(!doc->webbrowser)
782  return TRUE;
783 
784  hres = IUnknown_QueryInterface(doc->webbrowser, &IID_IConnectionPointContainer, (void**)&cp_container);
785  if(FAILED(hres))
786  return TRUE;
787 
788  hres = IConnectionPointContainer_FindConnectionPoint(cp_container, &DIID_DWebBrowserEvents2, &cp);
789  IConnectionPointContainer_Release(cp_container);
790  if(FAILED(hres))
791  return TRUE;
792 
793  hres = IConnectionPoint_EnumConnections(cp, &enum_conn);
794  IConnectionPoint_Release(cp);
795  if(FAILED(hres))
796  return TRUE;
797 
798  while(!cancel) {
799  conn_data.pUnk = NULL;
800  conn_data.dwCookie = 0;
801  fetched = 0;
802  hres = IEnumConnections_Next(enum_conn, 1, &conn_data, &fetched);
803  if(hres != S_OK)
804  break;
805 
806  hres = IUnknown_QueryInterface(conn_data.pUnk, &IID_IDispatch, (void**)&disp);
807  IUnknown_Release(conn_data.pUnk);
808  if(FAILED(hres))
809  continue;
810 
811  V_VT(args) = VT_BYREF|VT_BOOL;
812  V_BOOLREF(args) = &cancel;
813  V_VT(args+1) = VT_BOOL;
814  V_BOOL(args+1) = window->parent ? VARIANT_TRUE : VARIANT_FALSE;
815  hres = IDispatch_Invoke(disp, DISPID_WINDOWCLOSING, &IID_NULL, 0, DISPATCH_METHOD, &dp, NULL, NULL, NULL);
816  IDispatch_Release(disp);
817  if(FAILED(hres))
818  cancel = VARIANT_FALSE;
819  }
820 
821  IEnumConnections_Release(enum_conn);
822  return !cancel;
823 }
824 
826 {
827  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
829 
830  TRACE("(%p)\n", This);
831 
832  if(!window->doc_obj) {
833  FIXME("No document object\n");
834  return E_FAIL;
835  }
836 
837  if(!notify_webbrowser_close(window, window->doc_obj))
838  return S_OK;
839 
840  FIXME("default action not implemented\n");
841  return E_NOTIMPL;
842 }
843 
845 {
846  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
847  FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
848  return E_NOTIMPL;
849 }
850 
852 {
853  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
854 
855  FIXME("(%p)->(%p) returning empty\n", This, p);
856 
857  V_VT(p) = VT_EMPTY;
858  return S_OK;
859 }
860 
861 static HRESULT WINAPI HTMLWindow2_get_navigator(IHTMLWindow2 *iface, IOmNavigator **p)
862 {
863  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
864 
865  TRACE("(%p)->(%p)\n", This, p);
866 
867  *p = OmNavigator_Create();
868  return *p ? S_OK : E_OUTOFMEMORY;
869 }
870 
872 {
873  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
874  nsAString name_str;
875  nsresult nsres;
876 
877  TRACE("(%p)->(%s)\n", This, debugstr_w(v));
878 
879  nsAString_InitDepend(&name_str, v);
880  nsres = nsIDOMWindow_SetName(This->outer_window->nswindow, &name_str);
881  nsAString_Finish(&name_str);
882  if(NS_FAILED(nsres))
883  ERR("SetName failed: %08x\n", nsres);
884 
885  return S_OK;
886 }
887 
889 {
890  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
891  nsAString name_str;
892  nsresult nsres;
893 
894  TRACE("(%p)->(%p)\n", This, p);
895 
896  nsAString_Init(&name_str, NULL);
897  nsres = nsIDOMWindow_GetName(This->outer_window->nswindow, &name_str);
898  return return_nsstr(nsres, &name_str, p);
899 }
900 
902 {
903  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
905 
906  TRACE("(%p)->(%p)\n", This, p);
907 
908  if(!window->parent)
909  return IHTMLWindow2_get_self(&This->IHTMLWindow2_iface, p);
910 
911  *p = &window->parent->base.IHTMLWindow2_iface;
912  IHTMLWindow2_AddRef(*p);
913  return S_OK;
914 }
915 
917  BSTR features, VARIANT_BOOL replace, IHTMLWindow2 **pomWindowResult)
918 {
919  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
921  INewWindowManager *new_window_mgr;
922  BSTR uri_str;
923  IUri *uri;
924  HRESULT hres;
925 
926  static const WCHAR _selfW[] = {'_','s','e','l','f',0};
927 
928  TRACE("(%p)->(%s %s %s %x %p)\n", This, debugstr_w(url), debugstr_w(name),
929  debugstr_w(features), replace, pomWindowResult);
930 
931  if(!window->doc_obj || !window->uri_nofrag)
932  return E_UNEXPECTED;
933 
934  if(name && *name == '_') {
935  if(!strcmpW(name, _selfW)) {
936  if((features && *features) || replace)
937  FIXME("Unsupported arguments for _self target\n");
938 
939  hres = IHTMLWindow2_navigate(&This->IHTMLWindow2_iface, url);
940  if(FAILED(hres))
941  return hres;
942 
943  if(pomWindowResult) {
944  FIXME("Returning this window for _self target\n");
945  *pomWindowResult = &This->IHTMLWindow2_iface;
946  IHTMLWindow2_AddRef(*pomWindowResult);
947  }
948 
949  return S_OK;
950  }
951 
952  FIXME("Unsupported name %s\n", debugstr_w(name));
953  return E_NOTIMPL;
954  }
955 
956  hres = do_query_service((IUnknown*)window->doc_obj->client, &SID_SNewWindowManager, &IID_INewWindowManager,
957  (void**)&new_window_mgr);
958  if(FAILED(hres)) {
959  FIXME("No INewWindowManager\n");
960  return E_NOTIMPL;
961  }
962 
963  hres = IUri_GetDisplayUri(window->uri_nofrag, &uri_str);
964  if(SUCCEEDED(hres)) {
965  hres = INewWindowManager_EvaluateNewWindow(new_window_mgr, url, name, uri_str,
966  features, !!replace, window->doc_obj->has_popup ? 0 : NWMF_FIRST, 0);
967  window->doc_obj->has_popup = TRUE;
968  SysFreeString(uri_str);
969  }
970  INewWindowManager_Release(new_window_mgr);
971  if(FAILED(hres)) {
972  *pomWindowResult = NULL;
973  return S_OK;
974  }
975 
976  hres = create_relative_uri(window, url, &uri);
977  if(FAILED(hres))
978  return hres;
979 
980  hres = navigate_new_window(window, uri, name, NULL, pomWindowResult);
981  IUri_Release(uri);
982  return hres;
983 }
984 
986 {
987  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
988 
989  TRACE("(%p)->(%p)\n", This, p);
990 
991  /* FIXME: We should return kind of proxy window here. */
992  IHTMLWindow2_AddRef(&This->IHTMLWindow2_iface);
993  *p = &This->IHTMLWindow2_iface;
994  return S_OK;
995 }
996 
998 {
999  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1001 
1002  TRACE("(%p)->(%p)\n", This, p);
1003 
1004  get_top_window(This->outer_window, &top);
1005  *p = &top->base.IHTMLWindow2_iface;
1006  IHTMLWindow2_AddRef(*p);
1007 
1008  return S_OK;
1009 }
1010 
1012 {
1013  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1014 
1015  TRACE("(%p)->(%p)\n", This, p);
1016 
1017  /* FIXME: We should return kind of proxy window here. */
1018  IHTMLWindow2_AddRef(&This->IHTMLWindow2_iface);
1019  *p = &This->IHTMLWindow2_iface;
1020  return S_OK;
1021 }
1022 
1024 {
1025  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1026 
1027  TRACE("(%p)->(%s)\n", This, debugstr_w(url));
1028 
1029  return navigate_url(This->outer_window, url, This->outer_window->uri, BINDING_NAVIGATED);
1030 }
1031 
1033 {
1034  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1035 
1036  TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1037 
1038  return set_window_event(This, EVENTID_FOCUS, &v);
1039 }
1040 
1042 {
1043  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1044 
1045  TRACE("(%p)->(%p)\n", This, p);
1046 
1047  return get_window_event(This, EVENTID_FOCUS, p);
1048 }
1049 
1051 {
1052  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1053 
1054  TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1055 
1056  return set_window_event(This, EVENTID_BLUR, &v);
1057 }
1058 
1060 {
1061  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1062 
1063  TRACE("(%p)->(%p)\n", This, p);
1064 
1065  return get_window_event(This, EVENTID_BLUR, p);
1066 }
1067 
1069 {
1070  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1071 
1072  TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1073 
1074  return set_window_event(This, EVENTID_LOAD, &v);
1075 }
1076 
1078 {
1079  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1080 
1081  TRACE("(%p)->(%p)\n", This, p);
1082 
1083  return get_window_event(This, EVENTID_LOAD, p);
1084 }
1085 
1087 {
1088  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1089 
1090  TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1091 
1092  return set_window_event(This, EVENTID_BEFOREUNLOAD, &v);
1093 }
1094 
1096 {
1097  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1098 
1099  TRACE("(%p)->(%p)\n", This, p);
1100 
1101  return get_window_event(This, EVENTID_BEFOREUNLOAD, p);
1102 }
1103 
1105 {
1106  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1107  FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
1108  return E_NOTIMPL;
1109 }
1110 
1112 {
1113  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1114  FIXME("(%p)->(%p)\n", This, p);
1115  return E_NOTIMPL;
1116 }
1117 
1119 {
1120  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1121 
1122  TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1123 
1124  return set_window_event(This, EVENTID_HELP, &v);
1125 }
1126 
1128 {
1129  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1130 
1131  TRACE("(%p)->(%p)\n", This, p);
1132 
1133  return get_window_event(This, EVENTID_HELP, p);
1134 }
1135 
1137 {
1138  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1139 
1140  FIXME("(%p)->(%s) semi-stub\n", This, debugstr_variant(&v));
1141 
1142  return set_window_event(This, EVENTID_ERROR, &v);
1143 }
1144 
1146 {
1147  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1148 
1149  TRACE("(%p)->(%p)\n", This, p);
1150 
1151  return get_window_event(This, EVENTID_ERROR, p);
1152 }
1153 
1155 {
1156  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1157 
1158  TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1159 
1160  return set_window_event(This, EVENTID_RESIZE, &v);
1161 }
1162 
1164 {
1165  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1166 
1167  TRACE("(%p)->(%p)\n", This, p);
1168 
1169  return get_window_event(This, EVENTID_RESIZE, p);
1170 }
1171 
1173 {
1174  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1175 
1176  TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1177 
1178  return set_window_event(This, EVENTID_SCROLL, &v);
1179 }
1180 
1182 {
1183  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1184 
1185  TRACE("(%p)->(%p)\n", This, p);
1186 
1187  return get_window_event(This, EVENTID_SCROLL, p);
1188 }
1189 
1190 static HRESULT WINAPI HTMLWindow2_get_document(IHTMLWindow2 *iface, IHTMLDocument2 **p)
1191 {
1192  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1193 
1194  TRACE("(%p)->(%p)\n", This, p);
1195 
1196  if(This->inner_window->doc) {
1197  /* FIXME: We should return a wrapper object here */
1199  IHTMLDocument2_AddRef(*p);
1200  }else {
1201  *p = NULL;
1202  }
1203 
1204  return S_OK;
1205 }
1206 
1207 static HRESULT WINAPI HTMLWindow2_get_event(IHTMLWindow2 *iface, IHTMLEventObj **p)
1208 {
1209  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1211 
1212  TRACE("(%p)->(%p)\n", This, p);
1213 
1214  if(window->event)
1215  IHTMLEventObj_AddRef(window->event);
1216  *p = window->event;
1217  return S_OK;
1218 }
1219 
1221 {
1222  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1223  FIXME("(%p)->(%p)\n", This, p);
1224  return E_NOTIMPL;
1225 }
1226 
1228  VARIANT *varArgIn, VARIANT *varOptions, VARIANT *varArgOut)
1229 {
1230  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1231  FIXME("(%p)->(%s %p %p %p)\n", This, debugstr_w(dialog), varArgIn, varOptions, varArgOut);
1232  return E_NOTIMPL;
1233 }
1234 
1236  BSTR features)
1237 {
1238  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1239  FIXME("(%p)->(%s %s %s)\n", This, debugstr_w(helpURL), debugstr_variant(&helpArg), debugstr_w(features));
1240  return E_NOTIMPL;
1241 }
1242 
1243 static HRESULT WINAPI HTMLWindow2_get_screen(IHTMLWindow2 *iface, IHTMLScreen **p)
1244 {
1245  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1247 
1248  TRACE("(%p)->(%p)\n", This, p);
1249 
1250  if(!window->screen) {
1251  HRESULT hres;
1252 
1253  hres = HTMLScreen_Create(&window->screen);
1254  if(FAILED(hres))
1255  return hres;
1256  }
1257 
1258  *p = window->screen;
1259  IHTMLScreen_AddRef(window->screen);
1260  return S_OK;
1261 }
1262 
1263 static HRESULT WINAPI HTMLWindow2_get_Option(IHTMLWindow2 *iface, IHTMLOptionElementFactory **p)
1264 {
1265  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1267 
1268  TRACE("(%p)->(%p)\n", This, p);
1269 
1270  if(!window->option_factory) {
1271  HRESULT hres;
1272 
1273  hres = HTMLOptionElementFactory_Create(window, &window->option_factory);
1274  if(FAILED(hres))
1275  return hres;
1276  }
1277 
1279  IHTMLOptionElementFactory_AddRef(*p);
1280 
1281  return S_OK;
1282 }
1283 
1285 {
1286  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1287 
1288  TRACE("(%p)->()\n", This);
1289 
1290  if(This->outer_window->doc_obj)
1291  SetFocus(This->outer_window->doc_obj->hwnd);
1292  return S_OK;
1293 }
1294 
1296 {
1297  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1298  FIXME("(%p)->(%p)\n", This, p);
1299  return E_NOTIMPL;
1300 }
1301 
1303 {
1304  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1305  FIXME("(%p)->()\n", This);
1306  return E_NOTIMPL;
1307 }
1308 
1310 {
1311  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1312  nsresult nsres;
1313 
1314  TRACE("(%p)->(%d %d)\n", This, x, y);
1315 
1316  nsres = nsIDOMWindow_Scroll(This->outer_window->nswindow, x, y);
1317  if(NS_FAILED(nsres)) {
1318  ERR("ScrollBy failed: %08x\n", nsres);
1319  return E_FAIL;
1320  }
1321 
1322  return S_OK;
1323 }
1324 
1326 {
1327  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1328  FIXME("(%p)->(%p)\n", This, p);
1329  return E_NOTIMPL;
1330 }
1331 
1333  LONG msec, VARIANT *language, LONG *timerID)
1334 {
1335  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1336  VARIANT expr;
1337 
1338  TRACE("(%p)->(%s %d %p %p)\n", This, debugstr_w(expression), msec, language, timerID);
1339 
1340  V_VT(&expr) = VT_BSTR;
1341  V_BSTR(&expr) = expression;
1342  return IHTMLWindow3_setInterval(&This->IHTMLWindow3_iface, &expr, msec, language, timerID);
1343 }
1344 
1346 {
1347  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1348 
1349  TRACE("(%p)->(%d)\n", This, timerID);
1350 
1351  return clear_task_timer(This->inner_window, TRUE, timerID);
1352 }
1353 
1355 {
1356  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1357  FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
1358  return E_NOTIMPL;
1359 }
1360 
1362 {
1363  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1364  FIXME("(%p)->(%p)\n", This, p);
1365  return E_NOTIMPL;
1366 }
1367 
1369  VARIANT *pvarRet)
1370 {
1371  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1372 
1373  TRACE("(%p)->(%s %s %p)\n", This, debugstr_w(scode), debugstr_w(language), pvarRet);
1374 
1375  return exec_script(This->inner_window, scode, language, pvarRet);
1376 }
1377 
1379 {
1380  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1381 
1382  static const WCHAR objectW[] = {'[','o','b','j','e','c','t',']',0};
1383 
1384  TRACE("(%p)->(%p)\n", This, String);
1385 
1386  if(!String)
1387  return E_INVALIDARG;
1388 
1389  *String = SysAllocString(objectW);
1390  return *String ? S_OK : E_OUTOFMEMORY;
1391 }
1392 
1394 {
1395  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1396  nsresult nsres;
1397 
1398  TRACE("(%p)->(%d %d)\n", This, x, y);
1399 
1400  nsres = nsIDOMWindow_ScrollBy(This->outer_window->nswindow, x, y);
1401  if(NS_FAILED(nsres))
1402  ERR("ScrollBy failed: %08x\n", nsres);
1403 
1404  return S_OK;
1405 }
1406 
1408 {
1409  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1410  nsresult nsres;
1411 
1412  TRACE("(%p)->(%d %d)\n", This, x, y);
1413 
1414  nsres = nsIDOMWindow_ScrollTo(This->outer_window->nswindow, x, y);
1415  if(NS_FAILED(nsres))
1416  ERR("ScrollTo failed: %08x\n", nsres);
1417 
1418  return S_OK;
1419 }
1420 
1422 {
1423  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1424  FIXME("(%p)->(%d %d)\n", This, x, y);
1425  return E_NOTIMPL;
1426 }
1427 
1429 {
1430  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1431  FIXME("(%p)->(%d %d)\n", This, x, y);
1432  return E_NOTIMPL;
1433 }
1434 
1436 {
1437  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1438  FIXME("(%p)->(%d %d)\n", This, x, y);
1439  return E_NOTIMPL;
1440 }
1441 
1443 {
1444  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1445  FIXME("(%p)->(%d %d)\n", This, x, y);
1446  return E_NOTIMPL;
1447 }
1448 
1450 {
1451  HTMLWindow *This = impl_from_IHTMLWindow2(iface);
1452 
1453  TRACE("(%p)->(%p)\n", This, p);
1454 
1455  *p = NULL;
1456 
1457  if(!This->outer_window->doc_obj->hostui)
1458  return S_OK;
1459 
1460  return IDocHostUIHandler_GetExternal(This->outer_window->doc_obj->hostui, p);
1461 }
1462 
1463 static const IHTMLWindow2Vtbl HTMLWindow2Vtbl = {
1541 };
1542 
1543 static inline HTMLWindow *impl_from_IHTMLWindow3(IHTMLWindow3 *iface)
1544 {
1545  return CONTAINING_RECORD(iface, HTMLWindow, IHTMLWindow3_iface);
1546 }
1547 
1548 static HRESULT WINAPI HTMLWindow3_QueryInterface(IHTMLWindow3 *iface, REFIID riid, void **ppv)
1549 {
1550  HTMLWindow *This = impl_from_IHTMLWindow3(iface);
1551 
1552  return IHTMLWindow2_QueryInterface(&This->IHTMLWindow2_iface, riid, ppv);
1553 }
1554 
1555 static ULONG WINAPI HTMLWindow3_AddRef(IHTMLWindow3 *iface)
1556 {
1557  HTMLWindow *This = impl_from_IHTMLWindow3(iface);
1558 
1559  return IHTMLWindow2_AddRef(&This->IHTMLWindow2_iface);
1560 }
1561 
1562 static ULONG WINAPI HTMLWindow3_Release(IHTMLWindow3 *iface)
1563 {
1564  HTMLWindow *This = impl_from_IHTMLWindow3(iface);
1565 
1566  return IHTMLWindow2_Release(&This->IHTMLWindow2_iface);
1567 }
1568 
1569 static HRESULT WINAPI HTMLWindow3_GetTypeInfoCount(IHTMLWindow3 *iface, UINT *pctinfo)
1570 {
1571  HTMLWindow *This = impl_from_IHTMLWindow3(iface);
1572 
1573  return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
1574 }
1575 
1576 static HRESULT WINAPI HTMLWindow3_GetTypeInfo(IHTMLWindow3 *iface, UINT iTInfo,
1577  LCID lcid, ITypeInfo **ppTInfo)
1578 {
1579  HTMLWindow *This = impl_from_IHTMLWindow3(iface);
1580 
1581  return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
1582 }
1583 
1585  LPOLESTR *rgszNames, UINT cNames,
1586  LCID lcid, DISPID *rgDispId)
1587 {
1588  HTMLWindow *This = impl_from_IHTMLWindow3(iface);
1589 
1590  return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
1591  rgDispId);
1592 }
1593 
1594 static HRESULT WINAPI HTMLWindow3_Invoke(IHTMLWindow3 *iface, DISPID dispIdMember,
1595  REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
1596  VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
1597 {
1598  HTMLWindow *This = impl_from_IHTMLWindow3(iface);
1599 
1600  return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
1601  pDispParams, pVarResult, pExcepInfo, puArgErr);
1602 }
1603 
1604 static HRESULT WINAPI HTMLWindow3_get_screenLeft(IHTMLWindow3 *iface, LONG *p)
1605 {
1606  HTMLWindow *This = impl_from_IHTMLWindow3(iface);
1607  nsresult nsres;
1608 
1609  TRACE("(%p)->(%p)\n", This, p);
1610 
1611  nsres = nsIDOMWindow_GetScreenX(This->outer_window->nswindow, p);
1612  if(NS_FAILED(nsres)) {
1613  ERR("GetScreenX failed: %08x\n", nsres);
1614  return E_FAIL;
1615  }
1616 
1617  return S_OK;
1618 }
1619 
1620 static HRESULT WINAPI HTMLWindow3_get_screenTop(IHTMLWindow3 *iface, LONG *p)
1621 {
1622  HTMLWindow *This = impl_from_IHTMLWindow3(iface);
1623  nsresult nsres;
1624 
1625  TRACE("(%p)->(%p)\n", This, p);
1626 
1627  nsres = nsIDOMWindow_GetScreenY(This->outer_window->nswindow, p);
1628  if(NS_FAILED(nsres)) {
1629  ERR("GetScreenY failed: %08x\n", nsres);
1630  return E_FAIL;
1631  }
1632 
1633  return S_OK;
1634 }
1635 
1636 static HRESULT WINAPI HTMLWindow3_attachEvent(IHTMLWindow3 *iface, BSTR event, IDispatch *pDisp, VARIANT_BOOL *pfResult)
1637 {
1638  HTMLWindow *This = impl_from_IHTMLWindow3(iface);
1640 
1641  TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult);
1642 
1643  if(!window->doc) {
1644  FIXME("No document\n");
1645  return E_FAIL;
1646  }
1647 
1648  return attach_event(&window->event_target, event, pDisp, pfResult);
1649 }
1650 
1651 static HRESULT WINAPI HTMLWindow3_detachEvent(IHTMLWindow3 *iface, BSTR event, IDispatch *pDisp)
1652 {
1653  HTMLWindow *This = impl_from_IHTMLWindow3(iface);
1655 
1656  TRACE("(%p)->()\n", This);
1657 
1658  if(!window->doc) {
1659  FIXME("No document\n");
1660  return E_FAIL;
1661  }
1662 
1663  return detach_event(&window->event_target, event, pDisp);
1664 }
1665 
1667  BOOL interval, LONG *timer_id)
1668 {
1669  IDispatch *disp = NULL;
1670  HRESULT hres;
1671 
1672  switch(V_VT(expr)) {
1673  case VT_DISPATCH:
1674  disp = V_DISPATCH(expr);
1675  IDispatch_AddRef(disp);
1676  break;
1677 
1678  case VT_BSTR:
1679  disp = script_parse_event(This->base.inner_window, V_BSTR(expr));
1680  break;
1681 
1682  default:
1683  FIXME("unimplemented expr %s\n", debugstr_variant(expr));
1684  return E_NOTIMPL;
1685  }
1686 
1687  if(!disp)
1688  return E_FAIL;
1689 
1690  hres = set_task_timer(This, msec, interval, disp, timer_id);
1691  IDispatch_Release(disp);
1692 
1693  return hres;
1694 }
1695 
1696 static HRESULT WINAPI HTMLWindow3_setTimeout(IHTMLWindow3 *iface, VARIANT *expression, LONG msec,
1697  VARIANT *language, LONG *timerID)
1698 {
1699  HTMLWindow *This = impl_from_IHTMLWindow3(iface);
1700 
1701  TRACE("(%p)->(%s %d %s %p)\n", This, debugstr_variant(expression), msec, debugstr_variant(language), timerID);
1702 
1703  return window_set_timer(This->inner_window, expression, msec, language, FALSE, timerID);
1704 }
1705 
1706 static HRESULT WINAPI HTMLWindow3_setInterval(IHTMLWindow3 *iface, VARIANT *expression, LONG msec,
1707  VARIANT *language, LONG *timerID)
1708 {
1709  HTMLWindow *This = impl_from_IHTMLWindow3(iface);
1710 
1711  TRACE("(%p)->(%p %d %p %p)\n", This, expression, msec, language, timerID);
1712 
1713  return window_set_timer(This->inner_window, expression, msec, language, TRUE, timerID);
1714 }
1715 
1716 static HRESULT WINAPI HTMLWindow3_print(IHTMLWindow3 *iface)
1717 {
1718  HTMLWindow *This = impl_from_IHTMLWindow3(iface);
1719  FIXME("(%p)\n", This);
1720  return E_NOTIMPL;
1721 }
1722 
1724 {
1725  HTMLWindow *This = impl_from_IHTMLWindow3(iface);
1726  FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
1727  return E_NOTIMPL;
1728 }
1729 
1731 {
1732  HTMLWindow *This = impl_from_IHTMLWindow3(iface);
1733  FIXME("(%p)->(%p)\n", This, p);
1734  return E_NOTIMPL;
1735 }
1736 
1738 {
1739  HTMLWindow *This = impl_from_IHTMLWindow3(iface);
1740  FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
1741  return E_NOTIMPL;
1742 }
1743 
1744 static HRESULT WINAPI HTMLWindow3_get_onafterprint(IHTMLWindow3 *iface, VARIANT *p)
1745 {
1746  HTMLWindow *This = impl_from_IHTMLWindow3(iface);
1747  FIXME("(%p)->(%p)\n", This, p);
1748  return E_NOTIMPL;
1749 }
1750 
1751 static HRESULT WINAPI HTMLWindow3_get_clipboardData(IHTMLWindow3 *iface, IHTMLDataTransfer **p)
1752 {
1753  HTMLWindow *This = impl_from_IHTMLWindow3(iface);
1754  FIXME("(%p)->(%p)\n", This, p);
1755  return E_NOTIMPL;
1756 }
1757 
1759  VARIANT *varArgIn, VARIANT *options, IHTMLWindow2 **pDialog)
1760 {
1761  HTMLWindow *This = impl_from_IHTMLWindow3(iface);
1762  FIXME("(%p)->(%s %p %p %p)\n", This, debugstr_w(url), varArgIn, options, pDialog);
1763  return E_NOTIMPL;
1764 }
1765 
1766 static const IHTMLWindow3Vtbl HTMLWindow3Vtbl = {
1787 };
1788 
1789 static inline HTMLWindow *impl_from_IHTMLWindow4(IHTMLWindow4 *iface)
1790 {
1791  return CONTAINING_RECORD(iface, HTMLWindow, IHTMLWindow4_iface);
1792 }
1793 
1794 static HRESULT WINAPI HTMLWindow4_QueryInterface(IHTMLWindow4 *iface, REFIID riid, void **ppv)
1795 {
1796  HTMLWindow *This = impl_from_IHTMLWindow4(iface);
1797 
1798  return IHTMLWindow2_QueryInterface(&This->IHTMLWindow2_iface, riid, ppv);
1799 }
1800 
1801 static ULONG WINAPI HTMLWindow4_AddRef(IHTMLWindow4 *iface)
1802 {
1803  HTMLWindow *This = impl_from_IHTMLWindow4(iface);
1804 
1805  return IHTMLWindow2_AddRef(&This->IHTMLWindow2_iface);
1806 }
1807 
1808 static ULONG WINAPI HTMLWindow4_Release(IHTMLWindow4 *iface)
1809 {
1810  HTMLWindow *This = impl_from_IHTMLWindow4(iface);
1811 
1812  return IHTMLWindow2_Release(&This->IHTMLWindow2_iface);
1813 }
1814 
1815 static HRESULT WINAPI HTMLWindow4_GetTypeInfoCount(IHTMLWindow4 *iface, UINT *pctinfo)
1816 {
1817  HTMLWindow *This = impl_from_IHTMLWindow4(iface);
1818 
1819  return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
1820 }
1821 
1822 static HRESULT WINAPI HTMLWindow4_GetTypeInfo(IHTMLWindow4 *iface, UINT iTInfo,
1823  LCID lcid, ITypeInfo **ppTInfo)
1824 {
1825  HTMLWindow *This = impl_from_IHTMLWindow4(iface);
1826 
1827  return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
1828 }
1829 
1831  LPOLESTR *rgszNames, UINT cNames,
1832  LCID lcid, DISPID *rgDispId)
1833 {
1834  HTMLWindow *This = impl_from_IHTMLWindow4(iface);
1835 
1836  return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
1837  rgDispId);
1838 }
1839 
1840 static HRESULT WINAPI HTMLWindow4_Invoke(IHTMLWindow4 *iface, DISPID dispIdMember,
1841  REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
1842  VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
1843 {
1844  HTMLWindow *This = impl_from_IHTMLWindow4(iface);
1845 
1846  return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
1847  pDispParams, pVarResult, pExcepInfo, puArgErr);
1848 }
1849 
1850 static HRESULT WINAPI HTMLWindow4_createPopup(IHTMLWindow4 *iface, VARIANT *varArgIn,
1851  IDispatch **ppPopup)
1852 {
1853  HTMLWindow *This = impl_from_IHTMLWindow4(iface);
1854  FIXME("(%p)->(%p %p)\n", This, varArgIn, ppPopup);
1855  return E_NOTIMPL;
1856 }
1857 
1858 static HRESULT WINAPI HTMLWindow4_get_frameElement(IHTMLWindow4 *iface, IHTMLFrameBase **p)
1859 {
1860  HTMLWindow *This = impl_from_IHTMLWindow4(iface);
1861  TRACE("(%p)->(%p)\n", This, p);
1862 
1863  if(This->outer_window->frame_element) {
1865  IHTMLFrameBase_AddRef(*p);
1866  }else
1867  *p = NULL;
1868 
1869  return S_OK;
1870 }
1871 
1872 static const IHTMLWindow4Vtbl HTMLWindow4Vtbl = {
1882 };
1883 
1884 static inline HTMLWindow *impl_from_IHTMLWindow5(IHTMLWindow5 *iface)
1885 {
1886  return CONTAINING_RECORD(iface, HTMLWindow, IHTMLWindow5_iface);
1887 }
1888 
1889 static HRESULT WINAPI HTMLWindow5_QueryInterface(IHTMLWindow5 *iface, REFIID riid, void **ppv)
1890 {
1891  HTMLWindow *This = impl_from_IHTMLWindow5(iface);
1892 
1893  return IHTMLWindow2_QueryInterface(&This->IHTMLWindow2_iface, riid, ppv);
1894 }
1895 
1896 static ULONG WINAPI HTMLWindow5_AddRef(IHTMLWindow5 *iface)
1897 {
1898  HTMLWindow *This = impl_from_IHTMLWindow5(iface);
1899 
1900  return IHTMLWindow2_AddRef(&This->IHTMLWindow2_iface);
1901 }
1902 
1903 static ULONG WINAPI HTMLWindow5_Release(IHTMLWindow5 *iface)
1904 {
1905  HTMLWindow *This = impl_from_IHTMLWindow5(iface);
1906 
1907  return IHTMLWindow2_Release(&This->IHTMLWindow2_iface);
1908 }
1909 
1910 static HRESULT WINAPI HTMLWindow5_GetTypeInfoCount(IHTMLWindow5 *iface, UINT *pctinfo)
1911 {
1912  HTMLWindow *This = impl_from_IHTMLWindow5(iface);
1913 
1914  return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
1915 }
1916 
1917 static HRESULT WINAPI HTMLWindow5_GetTypeInfo(IHTMLWindow5 *iface, UINT iTInfo,
1918  LCID lcid, ITypeInfo **ppTInfo)
1919 {
1920  HTMLWindow *This = impl_from_IHTMLWindow5(iface);
1921 
1922  return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
1923 }
1924 
1926  LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
1927 {
1928  HTMLWindow *This = impl_from_IHTMLWindow5(iface);
1929 
1930  return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
1931  rgDispId);
1932 }
1933 
1934 static HRESULT WINAPI HTMLWindow5_Invoke(IHTMLWindow5 *iface, DISPID dispIdMember,
1935  REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
1936  VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
1937 {
1938  HTMLWindow *This = impl_from_IHTMLWindow5(iface);
1939 
1940  return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
1941  pDispParams, pVarResult, pExcepInfo, puArgErr);
1942 }
1943 
1945 {
1946  HTMLWindow *This = impl_from_IHTMLWindow5(iface);
1947  FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
1948  return E_NOTIMPL;
1949 }
1950 
1952 {
1953  HTMLWindow *This = impl_from_IHTMLWindow5(iface);
1955 
1956  TRACE("(%p)->(%p)\n", This, p);
1957 
1958  if(!window->xhr_factory) {
1959  HRESULT hres;
1960 
1961  hres = HTMLXMLHttpRequestFactory_Create(window, &window->xhr_factory);
1962  if(FAILED(hres)) {
1963  return hres;
1964  }
1965  }
1966 
1967  V_VT(p) = VT_DISPATCH;
1969  IDispatch_AddRef(V_DISPATCH(p));
1970 
1971  return S_OK;
1972 }
1973 
1974 static const IHTMLWindow5Vtbl HTMLWindow5Vtbl = {
1984 };
1985 
1986 static inline HTMLWindow *impl_from_IHTMLWindow6(IHTMLWindow6 *iface)
1987 {
1988  return CONTAINING_RECORD(iface, HTMLWindow, IHTMLWindow6_iface);
1989 }
1990 
1991 static HRESULT WINAPI HTMLWindow6_QueryInterface(IHTMLWindow6 *iface, REFIID riid, void **ppv)
1992 {
1993  HTMLWindow *This = impl_from_IHTMLWindow6(iface);
1994 
1995  return IHTMLWindow2_QueryInterface(&This->IHTMLWindow2_iface, riid, ppv);
1996 }
1997 
1998 static ULONG WINAPI HTMLWindow6_AddRef(IHTMLWindow6 *iface)
1999 {
2000  HTMLWindow *This = impl_from_IHTMLWindow6(iface);
2001 
2002  return IHTMLWindow2_AddRef(&This->IHTMLWindow2_iface);
2003 }
2004 
2005 static ULONG WINAPI HTMLWindow6_Release(IHTMLWindow6 *iface)
2006 {
2007  HTMLWindow *This = impl_from_IHTMLWindow6(iface);
2008 
2009  return IHTMLWindow2_Release(&This->IHTMLWindow2_iface);
2010 }
2011 
2012 static HRESULT WINAPI HTMLWindow6_GetTypeInfoCount(IHTMLWindow6 *iface, UINT *pctinfo)
2013 {
2014  HTMLWindow *This = impl_from_IHTMLWindow6(iface);
2015 
2016  return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
2017 }
2018 
2019 static HRESULT WINAPI HTMLWindow6_GetTypeInfo(IHTMLWindow6 *iface, UINT iTInfo,
2020  LCID lcid, ITypeInfo **ppTInfo)
2021 {
2022  HTMLWindow *This = impl_from_IHTMLWindow6(iface);
2023 
2024  return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
2025 }
2026 
2028  LPOLESTR *rgszNames, UINT cNames,
2029  LCID lcid, DISPID *rgDispId)
2030 {
2031  HTMLWindow *This = impl_from_IHTMLWindow6(iface);
2032 
2033  return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
2034  rgDispId);
2035 }
2036 
2037 static HRESULT WINAPI HTMLWindow6_Invoke(IHTMLWindow6 *iface, DISPID dispIdMember,
2038  REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
2039  VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
2040 {
2041  HTMLWindow *This = impl_from_IHTMLWindow6(iface);
2042 
2043  return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
2044  pDispParams, pVarResult, pExcepInfo, puArgErr);
2045 }
2046 
2048 {
2049  HTMLWindow *This = impl_from_IHTMLWindow6(iface);
2050  FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
2051  return E_NOTIMPL;
2052 }
2053 
2055 {
2056  HTMLWindow *This = impl_from_IHTMLWindow6(iface);
2057  FIXME("(%p)->(%p)\n", This, p);
2058  return E_NOTIMPL;
2059 }
2060 
2061 static HRESULT WINAPI HTMLWindow6_get_sessionStorage(IHTMLWindow6 *iface, IHTMLStorage **p)
2062 {
2063  HTMLWindow *This = impl_from_IHTMLWindow6(iface);
2064 
2065  FIXME("(%p)->(%p)\n", This, p);
2066 
2067  if(!This->inner_window->session_storage) {
2068  HRESULT hres;
2069 
2071  if(FAILED(hres))
2072  return hres;
2073  }
2074 
2075  IHTMLStorage_AddRef(This->inner_window->session_storage);
2076  *p = This->inner_window->session_storage;
2077  return S_OK;
2078 }
2079 
2080 static HRESULT WINAPI HTMLWindow6_get_localStorage(IHTMLWindow6 *iface, IHTMLStorage **p)
2081 {
2082  HTMLWindow *This = impl_from_IHTMLWindow6(iface);
2083  FIXME("(%p)->(%p)\n", This, p);
2084  return E_NOTIMPL;
2085 }
2086 
2088 {
2089  HTMLWindow *This = impl_from_IHTMLWindow6(iface);
2090  FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
2091  return E_NOTIMPL;
2092 }
2093 
2094 static HRESULT WINAPI HTMLWindow6_get_onhashchange(IHTMLWindow6 *iface, VARIANT *p)
2095 {
2096  HTMLWindow *This = impl_from_IHTMLWindow6(iface);
2097  FIXME("(%p)->(%p)\n", This, p);
2098  return E_NOTIMPL;
2099 }
2100 
2102 {
2103  HTMLWindow *This = impl_from_IHTMLWindow6(iface);
2104  FIXME("(%p)->(%p)\n", This, p);
2105  return E_NOTIMPL;
2106 }
2107 
2108 static HRESULT WINAPI HTMLWindow6_postMessage(IHTMLWindow6 *iface, BSTR msg, VARIANT targetOrigin)
2109 {
2110  HTMLWindow *This = impl_from_IHTMLWindow6(iface);
2111  FIXME("(%p)->(%s %s)\n", This, debugstr_w(msg), debugstr_variant(&targetOrigin));
2112  return E_NOTIMPL;
2113 }
2114 
2115 static HRESULT WINAPI HTMLWindow6_toStaticHTML(IHTMLWindow6 *iface, BSTR bstrHTML, BSTR *pbstrStaticHTML)
2116 {
2117  HTMLWindow *This = impl_from_IHTMLWindow6(iface);
2118  FIXME("(%p)->(%s %p)\n", This, debugstr_w(bstrHTML), pbstrStaticHTML);
2119  return E_NOTIMPL;
2120 }
2121 
2122 static HRESULT WINAPI HTMLWindow6_put_onmessage(IHTMLWindow6 *iface, VARIANT v)
2123 {
2124  HTMLWindow *This = impl_from_IHTMLWindow6(iface);
2125  FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
2126  return E_NOTIMPL;
2127 }
2128 
2129 static HRESULT WINAPI HTMLWindow6_get_onmessage(IHTMLWindow6 *iface, VARIANT *p)
2130 {
2131  HTMLWindow *This = impl_from_IHTMLWindow6(iface);
2132  FIXME("(%p)->(%p)\n", This, p);
2133  return E_NOTIMPL;
2134 }
2135 
2136 static HRESULT WINAPI HTMLWindow6_msWriteProfilerMark(IHTMLWindow6 *iface, BSTR bstrProfilerMark)
2137 {
2138  HTMLWindow *This = impl_from_IHTMLWindow6(iface);
2139  FIXME("(%p)->(%s)\n", This, debugstr_w(bstrProfilerMark));
2140  return E_NOTIMPL;
2141 }
2142 
2143 static const IHTMLWindow6Vtbl HTMLWindow6Vtbl = {
2163 };
2164 
2166 {
2167  return CONTAINING_RECORD(iface, HTMLWindow, IHTMLPrivateWindow_iface);
2168 }
2169 
2171 {
2173 
2174  return IHTMLWindow2_QueryInterface(&This->IHTMLWindow2_iface, riid, ppv);
2175 }
2176 
2178 {
2180 
2181  return IHTMLWindow2_AddRef(&This->IHTMLWindow2_iface);
2182 }
2183 
2185 {
2187 
2188  return IHTMLWindow2_Release(&This->IHTMLWindow2_iface);
2189 }
2190 
2192  BSTR arg4, VARIANT *post_data_var, VARIANT *headers_var, ULONG flags)
2193 {
2196  OLECHAR *translated_url = NULL;
2197  DWORD post_data_size = 0;
2198  BYTE *post_data = NULL;
2199  WCHAR *headers = NULL;
2200  IUri *uri;
2201  HRESULT hres;
2202 
2203  TRACE("(%p)->(%s %s %s %s %s %s %x)\n", This, debugstr_w(url), debugstr_w(arg2), debugstr_w(arg3), debugstr_w(arg4),
2204  debugstr_variant(post_data_var), debugstr_variant(headers_var), flags);
2205 
2206  if(window->doc_obj->hostui) {
2207  hres = IDocHostUIHandler_TranslateUrl(window->doc_obj->hostui, 0, url, &translated_url);
2208  if(hres != S_OK)
2209  translated_url = NULL;
2210  }
2211 
2212  hres = create_uri(translated_url ? translated_url : url, 0, &uri);
2213  CoTaskMemFree(translated_url);
2214  if(FAILED(hres))
2215  return hres;
2216 
2217  if(post_data_var) {
2218  if(V_VT(post_data_var) == (VT_ARRAY|VT_UI1)) {
2219  SafeArrayAccessData(V_ARRAY(post_data_var), (void**)&post_data);
2220  post_data_size = V_ARRAY(post_data_var)->rgsabound[0].cElements;
2221  }
2222  }
2223 
2224  if(headers_var && V_VT(headers_var) != VT_EMPTY && V_VT(headers_var) != VT_ERROR) {
2225  if(V_VT(headers_var) != VT_BSTR)
2226  return E_INVALIDARG;
2227 
2228  headers = V_BSTR(headers_var);
2229  }
2230 
2231  hres = super_navigate(window, uri, BINDING_NAVIGATED|BINDING_NOFRAG, headers, post_data, post_data_size);
2232  IUri_Release(uri);
2233  if(post_data)
2234  SafeArrayUnaccessData(V_ARRAY(post_data_var));
2235 
2236  return hres;
2237 }
2238 
2240 {
2242  FIXME("(%p)->(%p)\n", This, url);
2243  return E_NOTIMPL;
2244 }
2245 
2247 {
2249  FIXME("(%p)->(%p)\n", This, cmdtrg);
2250  return E_NOTIMPL;
2251 }
2252 
2254 {
2256  FIXME("(%p)->(%x)\n", This, arg);
2257  return E_NOTIMPL;
2258 }
2259 
2261 {
2263  FIXME("(%p)->(%s %p)\n", This, debugstr_w(name), ret);
2264  return E_NOTIMPL;
2265 }
2266 
2268 {
2270  TRACE("(%p)->(%p)\n", This, url);
2271 
2272  if(!url)
2273  return E_INVALIDARG;
2274 
2275  *url = SysAllocString(This->outer_window->url);
2276  return S_OK;
2277 }
2278 
2279 static const IHTMLPrivateWindowVtbl HTMLPrivateWindowVtbl = {
2289 };
2290 
2292 {
2293  return CONTAINING_RECORD(iface, HTMLWindow, ITravelLogClient_iface);
2294 }
2295 
2297 {
2298  HTMLWindow *This = impl_from_ITravelLogClient(iface);
2299 
2300  return IHTMLWindow2_QueryInterface(&This->IHTMLWindow2_iface, riid, ppv);
2301 }
2302 
2304 {
2305  HTMLWindow *This = impl_from_ITravelLogClient(iface);
2306 
2307  return IHTMLWindow2_AddRef(&This->IHTMLWindow2_iface);
2308 }
2309 
2311 {
2312  HTMLWindow *This = impl_from_ITravelLogClient(iface);
2313 
2314  return IHTMLWindow2_Release(&This->IHTMLWindow2_iface);
2315 }
2316 
2318 {
2319  HTMLWindow *This = impl_from_ITravelLogClient(iface);
2320 
2321  FIXME("(%p)->(%d %p) semi-stub\n", This, dwID, ppunk);
2322 
2323  *ppunk = NULL;
2324  return E_FAIL;
2325 }
2326 
2328 {
2329  HTMLWindow *This = impl_from_ITravelLogClient(iface);
2330  FIXME("(%p)->(%p %p)\n", This, pStream, pWinData);
2331  return E_NOTIMPL;
2332 }
2333 
2335 {
2336  HTMLWindow *This = impl_from_ITravelLogClient(iface);
2337  FIXME("(%p)->(%s %d)\n", This, debugstr_w(pszUrlLocation), dwPosition);
2338  return E_NOTIMPL;
2339 }
2340 
2341 static const ITravelLogClientVtbl TravelLogClientVtbl = {
2348 };
2349 
2351 {
2352  return CONTAINING_RECORD(iface, HTMLWindow, IObjectIdentity_iface);
2353 }
2354 
2356 {
2357  HTMLWindow *This = impl_from_IObjectIdentity(iface);
2358 
2359  return IHTMLWindow2_QueryInterface(&This->IHTMLWindow2_iface, riid, ppv);
2360 }
2361 
2363 {
2364  HTMLWindow *This = impl_from_IObjectIdentity(iface);
2365 
2366  return IHTMLWindow2_AddRef(&This->IHTMLWindow2_iface);
2367 }
2368 
2370 {
2371  HTMLWindow *This = impl_from_IObjectIdentity(iface);
2372 
2373  return IHTMLWindow2_Release(&This->IHTMLWindow2_iface);
2374 }
2375 
2377 {
2378  HTMLWindow *This = impl_from_IObjectIdentity(iface);
2380  HRESULT hres;
2381 
2382  TRACE("(%p)->(%p)\n", This, unk);
2383 
2384  hres = IUnknown_QueryInterface(unk, &IID_IServiceProvider, (void**)&sp);
2385  if(hres != S_OK)
2386  return hres;
2387 
2388  hres = &This->inner_window->base.IServiceProvider_iface==sp ||
2390  IServiceProvider_Release(sp);
2391  return hres;
2392 }
2393 
2394 static const IObjectIdentityVtbl ObjectIdentityVtbl = {
2399 };
2400 
2401 static inline HTMLWindow *impl_from_IDispatchEx(IDispatchEx *iface)
2402 {
2403  return CONTAINING_RECORD(iface, HTMLWindow, IDispatchEx_iface);
2404 }
2405 
2406 static HRESULT WINAPI WindowDispEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv)
2407 {
2408  HTMLWindow *This = impl_from_IDispatchEx(iface);
2409 
2410  return IHTMLWindow2_QueryInterface(&This->IHTMLWindow2_iface, riid, ppv);
2411 }
2412 
2413 static ULONG WINAPI WindowDispEx_AddRef(IDispatchEx *iface)
2414 {
2415  HTMLWindow *This = impl_from_IDispatchEx(iface);
2416 
2417  return IHTMLWindow2_AddRef(&This->IHTMLWindow2_iface);
2418 }
2419 
2420 static ULONG WINAPI WindowDispEx_Release(IDispatchEx *iface)
2421 {
2422  HTMLWindow *This = impl_from_IDispatchEx(iface);
2423 
2424  return IHTMLWindow2_Release(&This->IHTMLWindow2_iface);
2425 }
2426 
2427 static HRESULT WINAPI WindowDispEx_GetTypeInfoCount(IDispatchEx *iface, UINT *pctinfo)
2428 {
2429  HTMLWindow *This = impl_from_IDispatchEx(iface);
2430 
2431  TRACE("(%p)->(%p)\n", This, pctinfo);
2432 
2433  return IDispatchEx_GetTypeInfoCount(&This->inner_window->event_target.dispex.IDispatchEx_iface, pctinfo);
2434 }
2435 
2436 static HRESULT WINAPI WindowDispEx_GetTypeInfo(IDispatchEx *iface, UINT iTInfo,
2437  LCID lcid, ITypeInfo **ppTInfo)
2438 {
2439  HTMLWindow *This = impl_from_IDispatchEx(iface);
2440 
2441  TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
2442 
2443  return IDispatchEx_GetTypeInfo(&This->inner_window->event_target.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
2444 }
2445 
2447  LPOLESTR *rgszNames, UINT cNames,
2448  LCID lcid, DISPID *rgDispId)
2449 {
2450  HTMLWindow *This = impl_from_IDispatchEx(iface);
2451  UINT i;
2452  HRESULT hres;
2453 
2454  WARN("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
2455 
2456  for(i=0; i < cNames; i++) {
2457  /* We shouldn't use script's IDispatchEx here, so we shouldn't use GetDispID */
2458  hres = IDispatchEx_GetDispID(&This->IDispatchEx_iface, rgszNames[i], 0, rgDispId+i);
2459  if(FAILED(hres))
2460  return hres;
2461  }
2462 
2463  return S_OK;
2464 }
2465 
2466 static HRESULT WINAPI WindowDispEx_Invoke(IDispatchEx *iface, DISPID dispIdMember,
2467  REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
2468  VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
2469 {
2470  HTMLWindow *This = impl_from_IDispatchEx(iface);
2471 
2472  TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
2473  lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
2474 
2475  /* FIXME: Use script dispatch */
2476 
2477  return IDispatchEx_Invoke(&This->inner_window->event_target.dispex.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
2478  pDispParams, pVarResult, pExcepInfo, puArgErr);
2479 }
2480 
2482 {
2483  if(This->global_prop_cnt == This->global_prop_size) {
2484  global_prop_t *new_props;
2485  DWORD new_size;
2486 
2487  if(This->global_props) {
2488  new_size = This->global_prop_size*2;
2489  new_props = heap_realloc(This->global_props, new_size*sizeof(global_prop_t));
2490  }else {
2491  new_size = 16;
2492  new_props = heap_alloc(new_size*sizeof(global_prop_t));
2493  }
2494  if(!new_props)
2495  return NULL;
2496  This->global_props = new_props;
2497  This->global_prop_size = new_size;
2498  }
2499 
2500  This->global_props[This->global_prop_cnt].name = heap_strdupW(name);
2501  if(!This->global_props[This->global_prop_cnt].name)
2502  return NULL;
2503 
2504  This->global_props[This->global_prop_cnt].type = type;
2505  return This->global_props + This->global_prop_cnt++;
2506 }
2507 
2509 {
2510  return MSHTML_DISPID_CUSTOM_MIN + (prop-This->global_props);
2511 }
2512 
2514 {
2515  DWORD i;
2516  ScriptHost *script_host;
2517  DISPID id;
2518 
2519  for(i=0; i < This->global_prop_cnt; i++) {
2520  /* FIXME: case sensitivity */
2521  if(!strcmpW(This->global_props[i].name, bstrName)) {
2522  *pid = MSHTML_DISPID_CUSTOM_MIN+i;
2523  return S_OK;
2524  }
2525  }
2526 
2527  if(find_global_prop(This->base.inner_window, bstrName, grfdex, &script_host, &id)) {
2528  global_prop_t *prop;
2529 
2530  prop = alloc_global_prop(This, GLOBAL_SCRIPTVAR, bstrName);
2531  if(!prop)
2532  return E_OUTOFMEMORY;
2533 
2534  prop->script_host = script_host;
2535  prop->id = id;
2536 
2537  *pid = prop_to_dispid(This, prop);
2538  return S_OK;
2539  }
2540 
2541  return DISP_E_UNKNOWNNAME;
2542 }
2543 
2544 static HRESULT WINAPI WindowDispEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
2545 {
2546  HTMLWindow *This = impl_from_IDispatchEx(iface);
2548  HRESULT hres;
2549 
2550  TRACE("(%p)->(%s %x %p)\n", This, debugstr_w(bstrName), grfdex, pid);
2551 
2552  hres = search_window_props(window, bstrName, grfdex, pid);
2553  if(hres != DISP_E_UNKNOWNNAME)
2554  return hres;
2555 
2556  hres = IDispatchEx_GetDispID(&window->base.inner_window->event_target.dispex.IDispatchEx_iface, bstrName, grfdex, pid);
2557  if(hres != DISP_E_UNKNOWNNAME)
2558  return hres;
2559 
2560  if(This->outer_window) {
2561  HTMLOuterWindow *frame;
2562 
2563  hres = get_frame_by_name(This->outer_window, bstrName, FALSE, &frame);
2564  if(SUCCEEDED(hres) && frame) {
2565  global_prop_t *prop;
2566 
2567  IHTMLWindow2_Release(&frame->base.IHTMLWindow2_iface);
2568 
2569  prop = alloc_global_prop(window, GLOBAL_FRAMEVAR, bstrName);
2570  if(!prop)
2571  return E_OUTOFMEMORY;
2572 
2573  *pid = prop_to_dispid(window, prop);
2574  return S_OK;
2575  }
2576  }
2577 
2578  if(window->doc) {
2579  global_prop_t *prop;
2580  IHTMLElement *elem;
2581 
2582  hres = IHTMLDocument3_getElementById(&window->base.inner_window->doc->basedoc.IHTMLDocument3_iface,
2583  bstrName, &elem);
2584  if(SUCCEEDED(hres) && elem) {
2585  IHTMLElement_Release(elem);
2586 
2587  prop = alloc_global_prop(window, GLOBAL_ELEMENTVAR, bstrName);
2588  if(!prop)
2589  return E_OUTOFMEMORY;
2590 
2591  *pid = prop_to_dispid(window, prop);
2592  return S_OK;
2593  }
2594  }
2595 
2596  return DISP_E_UNKNOWNNAME;
2597 }
2598 
2599 static HRESULT WINAPI WindowDispEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp,
2600  VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
2601 {
2602  HTMLWindow *This = impl_from_IDispatchEx(iface);
2604 
2605  TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller);
2606 
2607  if(id == DISPID_IHTMLWINDOW2_LOCATION && (wFlags & DISPATCH_PROPERTYPUT)) {
2609  HRESULT hres;
2610 
2611  TRACE("forwarding to location.href\n");
2612 
2613  hres = get_location(window, &location);
2614  if(FAILED(hres))
2615  return hres;
2616 
2617  hres = IDispatchEx_InvokeEx(&location->dispex.IDispatchEx_iface, DISPID_VALUE, lcid,
2618  wFlags, pdp, pvarRes, pei, pspCaller);
2619  IHTMLLocation_Release(&location->IHTMLLocation_iface);
2620  return hres;
2621  }
2622 
2623  return IDispatchEx_InvokeEx(&window->event_target.dispex.IDispatchEx_iface, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller);
2624 }
2625 
2626 static HRESULT WINAPI WindowDispEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex)
2627 {
2628  HTMLWindow *This = impl_from_IDispatchEx(iface);
2629 
2630  TRACE("(%p)->(%s %x)\n", This, debugstr_w(bstrName), grfdex);
2631 
2632  return IDispatchEx_DeleteMemberByName(&This->inner_window->event_target.dispex.IDispatchEx_iface, bstrName, grfdex);
2633 }
2634 
2636 {
2637  HTMLWindow *This = impl_from_IDispatchEx(iface);
2638 
2639  TRACE("(%p)->(%x)\n", This, id);
2640 
2641  return IDispatchEx_DeleteMemberByDispID(&This->inner_window->event_target.dispex.IDispatchEx_iface, id);
2642 }
2643 
2644 static HRESULT WINAPI WindowDispEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex)
2645 {
2646  HTMLWindow *This = impl_from_IDispatchEx(iface);
2647 
2648  TRACE("(%p)->(%x %x %p)\n", This, id, grfdexFetch, pgrfdex);
2649 
2650  return IDispatchEx_GetMemberProperties(&This->inner_window->event_target.dispex.IDispatchEx_iface, id, grfdexFetch,
2651  pgrfdex);
2652 }
2653 
2654 static HRESULT WINAPI WindowDispEx_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *pbstrName)
2655 {
2656  HTMLWindow *This = impl_from_IDispatchEx(iface);
2657 
2658  TRACE("(%p)->(%x %p)\n", This, id, pbstrName);
2659 
2660  return IDispatchEx_GetMemberName(&This->inner_window->event_target.dispex.IDispatchEx_iface, id, pbstrName);
2661 }
2662 
2663 static HRESULT WINAPI WindowDispEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid)
2664 {
2665  HTMLWindow *This = impl_from_IDispatchEx(iface);
2666 
2667  TRACE("(%p)->(%x %x %p)\n", This, grfdex, id, pid);
2668 
2669  return IDispatchEx_GetNextDispID(&This->inner_window->event_target.dispex.IDispatchEx_iface, grfdex, id, pid);
2670 }
2671 
2672 static HRESULT WINAPI WindowDispEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk)
2673 {
2674  HTMLWindow *This = impl_from_IDispatchEx(iface);
2675 
2676  TRACE("(%p)->(%p)\n", This, ppunk);
2677 
2678  *ppunk = NULL;
2679  return S_OK;
2680 }
2681 
2682 static const IDispatchExVtbl WindowDispExVtbl = {
2698 };
2699 
2701 {
2702  return CONTAINING_RECORD(iface, HTMLWindow, IServiceProvider_iface);
2703 }
2704 
2706 {
2707  HTMLWindow *This = impl_from_IServiceProvider(iface);
2708  return IHTMLWindow2_QueryInterface(&This->IHTMLWindow2_iface, riid, ppv);
2709 }
2710 
2712 {
2713  HTMLWindow *This = impl_from_IServiceProvider(iface);
2714  return IHTMLWindow2_AddRef(&This->IHTMLWindow2_iface);
2715 }
2716 
2718 {
2719  HTMLWindow *This = impl_from_IServiceProvider(iface);
2720  return IHTMLWindow2_Release(&This->IHTMLWindow2_iface);
2721 }
2722 
2724 {
2725  HTMLWindow *This = impl_from_IServiceProvider(iface);
2726 
2727  if(IsEqualGUID(guidService, &IID_IHTMLWindow2)) {
2728  TRACE("IID_IHTMLWindow2\n");
2729  return IHTMLWindow2_QueryInterface(&This->IHTMLWindow2_iface, riid, ppv);
2730  }
2731 
2732  TRACE("(%p)->(%s %s %p)\n", This, debugstr_mshtml_guid(guidService), debugstr_mshtml_guid(riid), ppv);
2733 
2734  if(!This->outer_window->doc_obj)
2735  return E_NOINTERFACE;
2736 
2737  return IServiceProvider_QueryService(&This->outer_window->doc_obj->basedoc.IServiceProvider_iface,
2738  guidService, riid, ppv);
2739 }
2740 
2741 static const IServiceProviderVtbl ServiceProviderVtbl = {
2746 };
2747 
2749 {
2750  return CONTAINING_RECORD(iface, HTMLInnerWindow, event_target.dispex);
2751 }
2752 
2754  VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller)
2755 {
2756  HTMLInnerWindow *This = impl_from_DispatchEx(dispex);
2757  global_prop_t *prop;
2758  DWORD idx;
2759  HRESULT hres;
2760 
2761  idx = id - MSHTML_DISPID_CUSTOM_MIN;
2762  if(idx >= This->global_prop_cnt)
2763  return DISP_E_MEMBERNOTFOUND;
2764 
2765  prop = This->global_props+idx;
2766 
2767  switch(prop->type) {
2768  case GLOBAL_SCRIPTVAR: {
2769  IDispatchEx *iface;
2770  IDispatch *disp;
2771 
2772  disp = get_script_disp(prop->script_host);
2773  if(!disp)
2774  return E_UNEXPECTED;
2775 
2776  hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&iface);
2777  if(SUCCEEDED(hres)) {
2778  TRACE("%s >>>\n", debugstr_w(prop->name));
2779  hres = IDispatchEx_InvokeEx(iface, prop->id, lcid, flags, params, res, ei, caller);
2780  if(hres == S_OK)
2781  TRACE("%s <<<\n", debugstr_w(prop->name));
2782  else
2783  WARN("%s <<< %08x\n", debugstr_w(prop->name), hres);
2784  IDispatchEx_Release(iface);
2785  }else {
2786  FIXME("No IDispatchEx\n");
2787  }
2788  IDispatch_Release(disp);
2789  break;
2790  }
2791  case GLOBAL_ELEMENTVAR:
2792  switch(flags) {
2794  case DISPATCH_PROPERTYGET: {
2795  IHTMLElement *elem;
2796 
2797  hres = IHTMLDocument3_getElementById(&This->base.inner_window->doc->basedoc.IHTMLDocument3_iface,
2798  prop->name, &elem);
2799  if(FAILED(hres))
2800  return hres;
2801 
2802  if(!elem)
2803  return DISP_E_MEMBERNOTFOUND;
2804 
2805  V_VT(res) = VT_DISPATCH;
2806  V_DISPATCH(res) = (IDispatch*)elem;
2807  return S_OK;
2808  }
2809  case DISPATCH_PROPERTYPUT: {
2810  DISPID dispex_id;
2811 
2812  hres = dispex_get_dynid(&This->event_target.dispex, prop->name, &dispex_id);
2813  if(FAILED(hres))
2814  return hres;
2815 
2816  prop->type = GLOBAL_DISPEXVAR;
2817  prop->id = dispex_id;
2818  return IDispatchEx_InvokeEx(&This->event_target.dispex.IDispatchEx_iface, dispex_id, 0, flags, params, res, ei, caller);
2819  }
2820  default:
2821  FIXME("Not supported flags: %x\n", flags);
2822  return E_NOTIMPL;
2823  }
2824  case GLOBAL_FRAMEVAR:
2825  if(!This->base.outer_window)
2826  return E_UNEXPECTED;
2827 
2828  switch(flags) {
2829  case DISPATCH_PROPERTYGET: {
2830  HTMLOuterWindow *frame;
2831 
2832  hres = get_frame_by_name(This->base.outer_window, prop->name, FALSE, &frame);
2833  if(FAILED(hres))
2834  return hres;
2835 
2836  if(!frame)
2837  return DISP_E_MEMBERNOTFOUND;
2838 
2839  V_VT(res) = VT_DISPATCH;
2841  IDispatch_AddRef(V_DISPATCH(res));
2842  return S_OK;
2843  }
2844  default:
2845  FIXME("Not supported flags: %x\n", flags);
2846  return E_NOTIMPL;
2847  }
2848  case GLOBAL_DISPEXVAR:
2849  return IDispatchEx_InvokeEx(&This->event_target.dispex.IDispatchEx_iface, prop->id, 0, flags, params, res, ei, caller);
2850  default:
2851  ERR("invalid type %d\n", prop->type);
2852  hres = DISP_E_MEMBERNOTFOUND;
2853  }
2854 
2855  return hres;
2856 }
2857 
2859 {
2860  HTMLInnerWindow *This = impl_from_DispatchEx(dispex);
2861  return &This->doc->body_event_target;
2862 }
2863 
2864 static void HTMLWindow_bind_event(DispatchEx *dispex, int eid)
2865 {
2866  HTMLInnerWindow *This = impl_from_DispatchEx(dispex);
2868 }
2869 
2871  NULL,
2872  NULL,
2874  NULL,
2877 };
2878 
2879 static const tid_t HTMLWindow_iface_tids[] = {
2880  IHTMLWindow2_tid,
2881  IHTMLWindow3_tid,
2882  IHTMLWindow4_tid,
2883  IHTMLWindow6_tid,
2884  0
2885 };
2886 
2889  DispHTMLWindow2_tid,
2890  NULL,
2892 };
2893 
2894 static void *alloc_window(size_t size)
2895 {
2896  HTMLWindow *window;
2897 
2898  window = heap_alloc_zero(size);
2899  if(!window)
2900  return NULL;
2901 
2902  window->IHTMLWindow2_iface.lpVtbl = &HTMLWindow2Vtbl;
2903  window->IHTMLWindow3_iface.lpVtbl = &HTMLWindow3Vtbl;
2904  window->IHTMLWindow4_iface.lpVtbl = &HTMLWindow4Vtbl;
2905  window->IHTMLWindow5_iface.lpVtbl = &HTMLWindow5Vtbl;
2906  window->IHTMLWindow6_iface.lpVtbl = &HTMLWindow6Vtbl;
2908  window->IDispatchEx_iface.lpVtbl = &WindowDispExVtbl;
2909  window->IServiceProvider_iface.lpVtbl = &ServiceProviderVtbl;
2910  window->ITravelLogClient_iface.lpVtbl = &TravelLogClientVtbl;
2911  window->IObjectIdentity_iface.lpVtbl = &ObjectIdentityVtbl;
2912  window->ref = 1;
2913 
2914  return window;
2915 }
2916 
2918 {
2920 
2921  window = alloc_window(sizeof(HTMLInnerWindow));
2922  if(!window)
2923  return E_OUTOFMEMORY;
2924 
2925  list_init(&window->script_hosts);
2926  list_init(&window->bindings);
2927  list_init(&window->script_queue);
2928 
2929  window->base.outer_window = outer_window;
2930  window->base.inner_window = window;
2931 
2932  init_dispex(&window->event_target.dispex, (IUnknown*)&window->base.IHTMLWindow2_iface, &HTMLWindow_dispex);
2933 
2934  window->task_magic = get_task_target_magic();
2935 
2936  if(mon) {
2937  IMoniker_AddRef(mon);
2938  window->mon = mon;
2939  }
2940 
2941  *ret = window;
2942  return S_OK;
2943 }
2944 
2947 {
2949  HRESULT hres;
2950 
2951  window = alloc_window(sizeof(HTMLOuterWindow));
2952  if(!window)
2953  return E_OUTOFMEMORY;
2954 
2955  window->base.outer_window = window;
2956  window->base.inner_window = NULL;
2957 
2958  window->window_ref = heap_alloc(sizeof(windowref_t));
2959  if(!window->window_ref) {
2960  heap_free(window);
2961  return E_OUTOFMEMORY;
2962  }
2963 
2964  window->doc_obj = doc_obj;
2965 
2966  window->window_ref->window = window;
2967  window->window_ref->ref = 1;
2968 
2969  if(nswindow) {
2970  nsIDOMWindow_AddRef(nswindow);
2971  window->nswindow = nswindow;
2972  }
2973 
2974  window->scriptmode = parent ? parent->scriptmode : SCRIPTMODE_GECKO;
2975  window->readystate = READYSTATE_UNINITIALIZED;
2976 
2977  hres = create_pending_window(window, NULL);
2978  if(SUCCEEDED(hres))
2979  hres = update_window_doc(window->pending_window);
2980  if(FAILED(hres)) {
2981  IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface);
2982  return hres;
2983  }
2984 
2985  hres = CoInternetCreateSecurityManager(NULL, &window->secmgr, 0);
2986  if(FAILED(hres)) {
2987  IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface);
2988  return hres;
2989  }
2990 
2991  window->task_magic = get_task_target_magic();
2992 
2993  list_init(&window->children);
2994  list_add_head(&window_list, &window->entry);
2995 
2996  if(parent) {
2997  IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface);
2998 
2999  window->parent = parent;
3000  list_add_tail(&parent->children, &window->sibling_entry);
3001  }
3002 
3003  TRACE("%p inner_window %p\n", window, window->base.inner_window);
3004 
3005  *ret = window;
3006  return S_OK;
3007 }
3008 
3010 {
3011  HTMLInnerWindow *pending_window;
3012  HRESULT hres;
3013 
3014  hres = create_inner_window(outer_window, outer_window->mon /* FIXME */, &pending_window);
3015  if(FAILED(hres))
3016  return hres;
3017 
3018  if(channelbsc) {
3019  IBindStatusCallback_AddRef(&channelbsc->bsc.IBindStatusCallback_iface);
3020  pending_window->bscallback = channelbsc;
3021  }
3022 
3023  if(outer_window->pending_window) {
3024  abort_window_bindings(outer_window->pending_window);
3025  outer_window->pending_window->base.outer_window = NULL;
3026  IHTMLWindow2_Release(&outer_window->pending_window->base.IHTMLWindow2_iface);
3027  }
3028 
3029  outer_window->pending_window = pending_window;
3030  return S_OK;
3031 }
3032 
3034 {
3035  HTMLOuterWindow *outer_window = window->base.outer_window;
3036  nsIDOMHTMLDocument *nshtmldoc;
3037  nsIDOMDocument *nsdoc;
3038  nsresult nsres;
3039  HRESULT hres;
3040 
3041  assert(!window->doc);
3042 
3043  if(!outer_window) {
3044  ERR("NULL outer window\n");
3045  return E_UNEXPECTED;
3046  }
3047 
3048  nsres = nsIDOMWindow_GetDocument(outer_window->nswindow, &nsdoc);
3049  if(NS_FAILED(nsres) || !nsdoc) {
3050  ERR("GetDocument failed: %08x\n", nsres);
3051  return E_FAIL;
3052  }
3053 
3054  nsres = nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMHTMLDocument, (void**)&nshtmldoc);
3055  nsIDOMDocument_Release(nsdoc);
3056  if(NS_FAILED(nsres)) {
3057  ERR("Could not get nsIDOMHTMLDocument iface: %08x\n", nsres);
3058  return E_FAIL;
3059  }
3060 
3061  hres = create_doc_from_nsdoc(nshtmldoc, outer_window->doc_obj, window, &window->doc);
3062  nsIDOMHTMLDocument_Release(nshtmldoc);
3063  if(FAILED(hres))
3064  return hres;
3065 
3066  if(outer_window->doc_obj->usermode == EDITMODE) {
3067  nsAString mode_str;
3068  nsresult nsres;
3069 
3070  static const PRUnichar onW[] = {'o','n',0};
3071 
3072  nsAString_InitDepend(&mode_str, onW);
3073  nsres = nsIDOMHTMLDocument_SetDesignMode(window->doc->nsdoc, &mode_str);
3074  nsAString_Finish(&mode_str);
3075  if(NS_FAILED(nsres))
3076  ERR("SetDesignMode failed: %08x\n", nsres);
3077  }
3078 
3079  if(window != outer_window->pending_window) {
3080  ERR("not current pending window\n");
3081  return S_OK;
3082  }
3083 
3084  if(outer_window->base.inner_window)
3085  detach_inner_window(outer_window->base.inner_window);
3086  outer_window->base.inner_window = window;
3087  outer_window->pending_window = NULL;
3088 
3089  if(outer_window->doc_obj->basedoc.window == outer_window || !outer_window->doc_obj->basedoc.window) {
3090  if(outer_window->doc_obj->basedoc.doc_node)
3091  htmldoc_release(&outer_window->doc_obj->basedoc.doc_node->basedoc);
3092  outer_window->doc_obj->basedoc.doc_node = window->doc;
3093  htmldoc_addref(&window->doc->basedoc);
3094  }
3095 
3096  return hres;
3097 }
3098 
3100 {
3101  HTMLOuterWindow *iter;
3102 
3103  LIST_FOR_EACH_ENTRY(iter, &window_list, HTMLOuterWindow, entry) {
3104  if(iter->nswindow == nswindow)
3105  return iter;
3106  }
3107 
3108  return NULL;
3109 }
static HRESULT WINAPI WindowDispEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex)
Definition: htmlwindow.c:2626
static HRESULT WINAPI HTMLWindow2_item(IHTMLWindow2 *iface, VARIANT *pvarIndex, VARIANT *pvarResult)
Definition: htmlwindow.c:423
static HRESULT WINAPI HTMLWindow2_get_onerror(IHTMLWindow2 *iface, VARIANT *p)
Definition: htmlwindow.c:1145
static HRESULT WINAPI HTMLWindow2_prompt(IHTMLWindow2 *iface, BSTR message, BSTR dststr, VARIANT *textdata)
Definition: htmlwindow.c:692
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
WCHAR OLECHAR
Definition: compat.h:1926
HTMLImageElementFactory * image_factory
HINSTANCE get_shdoclc(void)
Definition: main.c:155
static HRESULT create_inner_window(HTMLOuterWindow *outer_window, IMoniker *mon, HTMLInnerWindow **ret)
Definition: htmlwindow.c:2917
disp
Definition: i386-dis.c:3181
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static HRESULT WINAPI WindowDispEx_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *pbstrName)
Definition: htmlwindow.c:2654
static HRESULT WINAPI HTMLWindow3_GetTypeInfo(IHTMLWindow3 *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: htmlwindow.c:1576
HRESULT set_task_timer(HTMLInnerWindow *, DWORD, BOOL, IDispatch *, LONG *) DECLSPEC_HIDDEN
Definition: task.c:169
static HRESULT WINAPI HTMLWindow2_get_parent(IHTMLWindow2 *iface, IHTMLWindow2 **p)
Definition: htmlwindow.c:901
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3835
static HRESULT WINAPI HTMLWindow2_get_onscroll(IHTMLWindow2 *iface, VARIANT *p)
Definition: htmlwindow.c:1181
struct list plugin_hosts
Definition: tftpd.h:59
unsigned short WORD
Definition: ntddk_ex.h:93
#define REFIID
Definition: guiddef.h:113
#define TRUE
Definition: types.h:120
static HRESULT WINAPI HTMLPrivateWindow_SuperNavigate(IHTMLPrivateWindow *iface, BSTR url, BSTR arg2, BSTR arg3, BSTR arg4, VARIANT *post_data_var, VARIANT *headers_var, ULONG flags)
Definition: htmlwindow.c:2191
static HRESULT WINAPI HTMLWindow3_detachEvent(IHTMLWindow3 *iface, BSTR event, IDispatch *pDisp)
Definition: htmlwindow.c:1651
static HRESULT WINAPI HTMLWindow4_QueryInterface(IHTMLWindow4 *iface, REFIID riid, void **ppv)
Definition: htmlwindow.c:1794
#define MAKEWPARAM(l, h)
Definition: winuser.h:3916
static HRESULT window_set_timer(HTMLInnerWindow *This, VARIANT *expr, LONG msec, VARIANT *language, BOOL interval, LONG *timer_id)
Definition: htmlwindow.c:1666
static HTMLWindow * impl_from_IHTMLWindow5(IHTMLWindow5 *iface)
Definition: htmlwindow.c:1884
static const IHTMLWindow2Vtbl HTMLWindow2Vtbl
Definition: htmlwindow.c:1463
#define IDOK
Definition: winuser.h:824
DispatchEx dispex
static void windowref_release(windowref_t *ref)
#define E_NOINTERFACE
Definition: winerror.h:2364
static HRESULT WINAPI WindowDispEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex)
Definition: htmlwindow.c:2644
Definition: compat.h:1932
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
static HRESULT WINAPI HTMLPrivateWindow_FindWindowByName(IHTMLPrivateWindow *iface, LPCWSTR name, IHTMLWindow2 **ret)
Definition: htmlwindow.c:2260
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
static HRESULT WINAPI TravelLogClient_QueryInterface(ITravelLogClient *iface, REFIID riid, void **ppv)
Definition: htmlwindow.c:2296
LOCAL int expr(arg_t *ap, int *altp)
Definition: match.c:512
const GUID IID_IUnknown
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
nsIDOMHTMLDocument * nsdoc
static HRESULT WINAPI HTMLWindow6_get_sessionStorage(IHTMLWindow6 *iface, IHTMLStorage **p)
Definition: htmlwindow.c:2061
static struct list window_list
Definition: htmlwindow.c:23
static HRESULT WINAPI HTMLWindow2_get_Option(IHTMLWindow2 *iface, IHTMLOptionElementFactory **p)
Definition: htmlwindow.c:1263
void get_top_window(HTMLOuterWindow *window, HTMLOuterWindow **ret)
Definition: htmlwindow.c:59
static HTMLWindow * impl_from_IDispatchEx(IDispatchEx *iface)
Definition: htmlwindow.c:2401
Definition: scsiwmi.h:51
HTMLDocumentNode * doc
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:343
struct list script_queue
static HRESULT WINAPI HTMLWindow3_QueryInterface(IHTMLWindow3 *iface, REFIID riid, void **ppv)
Definition: htmlwindow.c:1548
static event_target_t ** HTMLWindow_get_event_target_ptr(DispatchEx *dispex)
Definition: htmlwindow.c:2858
static HRESULT WINAPI HTMLWindow2_get_offscreenBuffering(IHTMLWindow2 *iface, VARIANT *p)
Definition: htmlwindow.c:1361
BOOL find_global_prop(HTMLInnerWindow *, BSTR, DWORD, ScriptHost **, DISPID *) DECLSPEC_HIDDEN
Definition: script.c:1500
struct list bindings
HRESULT update_window_doc(HTMLInnerWindow *window)
Definition: htmlwindow.c:3033
HRESULT dispex_get_dynid(DispatchEx *This, const WCHAR *name, DISPID *id)
Definition: dispex.c:568
static HRESULT navigate_url(HHInfo *info, LPCWSTR surl)
Definition: help.c:189
IOleClientSite * client
struct list script_hosts
__wchar_t WCHAR
Definition: xmlstorage.h:180
REFIID riid
Definition: precomp.h:44
#define MSHTML_DISPID_CUSTOM_MIN
static HRESULT WINAPI HTMLWindow4_GetTypeInfo(IHTMLWindow4 *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: htmlwindow.c:1822
static dispex_static_data_t HTMLWindow_dispex
Definition: htmlwindow.c:2887
static HRESULT WINAPI HTMLWindow6_GetTypeInfo(IHTMLWindow6 *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: htmlwindow.c:2019
HTMLInnerWindow * window
static ULONG WINAPI TravelLogClient_AddRef(ITravelLogClient *iface)
Definition: htmlwindow.c:2303
static HRESULT WINAPI HTMLWindow3_put_onbeforeprint(IHTMLWindow3 *iface, VARIANT v)
Definition: htmlwindow.c:1723
tid_t
Definition: ieframe.h:311
DWORD timer_id
Definition: imm32.c:361
const dispex_static_data_vtbl_t * vtbl
#define V_ARRAY(A)
Definition: oleauto.h:222
static HRESULT WINAPI HTMLWindow2_put_offscreenBuffering(IHTMLWindow2 *iface, VARIANT v)
Definition: htmlwindow.c:1354
static HRESULT WINAPI HTMLWindow2_alert(IHTMLWindow2 *iface, BSTR message)
Definition: htmlwindow.c:568
BSCallback bsc
Definition: binding.h:98
uint8_t entry
Definition: isohybrid.c:63
static HRESULT WINAPI HTMLWindow4_Invoke(IHTMLWindow4 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: htmlwindow.c:1840
#define WARN(fmt,...)
Definition: debug.h:111
HTMLOuterWindow * window
static HRESULT WINAPI HTMLPrivateWindow_SetPICSTarget(IHTMLPrivateWindow *iface, IOleCommandTarget *cmdtrg)
Definition: htmlwindow.c:2246
static HRESULT WINAPI HTMLWindow2_moveBy(IHTMLWindow2 *iface, LONG x, LONG y)
Definition: htmlwindow.c:1428
IHTMLXMLHttpRequestFactory IHTMLXMLHttpRequestFactory_iface
static const IHTMLWindow3Vtbl HTMLWindow3Vtbl
Definition: htmlwindow.c:1766
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: glext.h:5579
#define CALLBACK
Definition: compat.h:27
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
__WINE_SERVER_LIST_INLINE void list_add_head(struct list *list, struct list *elem)
Definition: list.h:96
static ULONG WINAPI HTMLWindow2_Release(IHTMLWindow2 *iface)
Definition: htmlwindow.c:257
static HRESULT WINAPI WindowDispEx_Invoke(IDispatchEx *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: htmlwindow.c:2466
REFIID LPVOID * ppv
Definition: atlbase.h:39
const GUID IID_IConnectionPointContainer
static ULONG WINAPI TravelLogClient_Release(ITravelLogClient *iface)
Definition: htmlwindow.c:2310
void WINAPI SysFreeString(BSTR str)
Definition: oleaut.c:275
SCRIPTMODE scriptmode
static HRESULT WINAPI HTMLWindow3_showModelessDialog(IHTMLWindow3 *iface, BSTR url, VARIANT *varArgIn, VARIANT *options, IHTMLWindow2 **pDialog)
Definition: htmlwindow.c:1758
HANDLE HWND
Definition: compat.h:13
HTMLOuterWindow * content_window
static HRESULT WINAPI WindowDispEx_GetIDsOfNames(IDispatchEx *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: htmlwindow.c:2446
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
HTMLInnerWindow * window
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define assert(x)
Definition: debug.h:53
struct list entry
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static ULONG WINAPI HTMLWindow6_AddRef(IHTMLWindow6 *iface)
Definition: htmlwindow.c:1998
IObjectIdentity IObjectIdentity_iface
static HRESULT WINAPI HTMLWindowSP_QueryService(IServiceProvider *iface, REFGUID guidService, REFIID riid, void **ppv)
Definition: htmlwindow.c:2723
static HRESULT WINAPI HTMLWindow2_execScript(IHTMLWindow2 *iface, BSTR scode, BSTR language, VARIANT *pvarRet)
Definition: htmlwindow.c:1368
HWND WINAPI SetFocus(_In_opt_ HWND)
static HTMLWindow * impl_from_IServiceProvider(IServiceProvider *iface)
Definition: htmlwindow.c:2700
vector< Header * > headers
Definition: sdkparse.cpp:39
void * arg
Definition: msvc.h:12
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
static HRESULT get_window_event(HTMLWindow *window, eventid_t eid, VARIANT *var)
Definition: htmlwindow.c:77
DWORD LCID
Definition: nls.h:13
OLECHAR * BSTR
Definition: compat.h:1927
static HRESULT WINAPI WindowDispEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id)
Definition: htmlwindow.c:2635
HRESULT HTMLXMLHttpRequestFactory_Create(HTMLInnerWindow *, HTMLXMLHttpRequestFactory **) DECLSPEC_HIDDEN
static HRESULT WINAPI HTMLWindow2_get_onfocus(IHTMLWindow2 *iface, VARIANT *p)
Definition: htmlwindow.c:1041
#define GetWindowLongPtrW
Definition: winuser.h:4698
EventTarget event_target
__IHTMLWindow2_FWD_DEFINED__ typedef interface IHTMLWindow2 IHTMLWindow2
Definition: mshtmhst.idl:64
__WINE_SERVER_LIST_INLINE struct list * list_tail(const struct list *list)
Definition: list.h:137
int32_t INT_PTR
Definition: typedefs.h:62
static ULONG WINAPI HTMLPrivateWindow_Release(IHTMLPrivateWindow *iface)
Definition: htmlwindow.c:2184
static HRESULT WINAPI HTMLWindow6_QueryInterface(IHTMLWindow6 *iface, REFIID riid, void **ppv)
Definition: htmlwindow.c:1991
static HRESULT WINAPI HTMLWindow6_postMessage(IHTMLWindow6 *iface, BSTR msg, VARIANT targetOrigin)
Definition: htmlwindow.c:2108
static ULONG WINAPI ObjectIdentity_AddRef(IObjectIdentity *iface)
Definition: htmlwindow.c:2362
static const IServiceProviderVtbl ServiceProviderVtbl
Definition: htmlwindow.c:2741
static LPOLESTR
Definition: stg_prop.c:33
HTMLDocument basedoc
#define E_FAIL
Definition: ddrawi.h:102
Definition: match.c:390
static HRESULT WINAPI HTMLWindow2_get_defaultStatus(IHTMLWindow2 *iface, BSTR *p)
Definition: htmlwindow.c:512
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int32_t INT
Definition: typedefs.h:56
HRESULT HTMLLocation_Create(HTMLInnerWindow *window, HTMLLocation **ret)
Definition: htmllocation.c:622
short VARIANT_BOOL
Definition: compat.h:1924
Definition: query.h:86
HTMLFrameBase * frame_element
Definition: send.c:47
static HWND child
Definition: cursoricon.c:298
static global_prop_t * alloc_global_prop(HTMLInnerWindow *This, global_prop_type_t type, BSTR name)
Definition: htmlwindow.c:2481
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:70
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
static HRESULT WINAPI HTMLWindow2_QueryInterface(IHTMLWindow2 *iface, REFIID riid, void **ppv)
Definition: htmlwindow.c:116
DWORD DWORD
Definition: winlogon.h:84
IHTMLLocation IHTMLLocation_iface
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
HTMLDocumentNode * doc_node
HTMLOuterWindow * window
#define MB_ICONWARNING
Definition: winuser.h:780
static HRESULT WINAPI HTMLWindow3_print(IHTMLWindow3 *iface)
Definition: htmlwindow.c:1716
#define V_I4(A)
Definition: oleauto.h:247
#define DISPATCH_METHOD
Definition: oleauto.h:1006
static HRESULT WINAPI HTMLWindow3_get_onafterprint(IHTMLWindow3 *iface, VARIANT *p)
Definition: htmlwindow.c:1744
static HRESULT WINAPI HTMLWindow2_put_onscroll(IHTMLWindow2 *iface, VARIANT v)
Definition: htmlwindow.c:1172
static ULONG WINAPI HTMLWindowSP_Release(IServiceProvider *iface)
Definition: htmlwindow.c:2717
static HRESULT WINAPI HTMLWindow5_get_XMLHttpRequest(IHTMLWindow5 *iface, VARIANT *p)
Definition: htmlwindow.c:1951
UINT_PTR WPARAM
Definition: windef.h:207
static HRESULT WINAPI HTMLWindow4_GetTypeInfoCount(IHTMLWindow4 *iface, UINT *pctinfo)
Definition: htmlwindow.c:1815
__WINE_SERVER_LIST_INLINE struct list * list_head(const struct list *list)
Definition: list.h:131
#define V_DISPATCH(A)
Definition: oleauto.h:239
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
Definition: glext.h:9514
static HRESULT WINAPI HTMLWindow2_setInterval(IHTMLWindow2 *iface, BSTR expression, LONG msec, VARIANT *language, LONG *timerID)
Definition: htmlwindow.c:1332
static HRESULT WINAPI WindowDispEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid)
Definition: htmlwindow.c:2663
const char * debugstr_mshtml_guid(const GUID *iid)
Definition: main.c:535
#define NS_OK
static HRESULT WINAPI HTMLWindowSP_QueryInterface(IServiceProvider *iface, REFIID riid, void **ppv)
Definition: htmlwindow.c:2705
static HRESULT WINAPI HTMLWindow2_resizeBy(IHTMLWindow2 *iface, LONG x, LONG y)
Definition: htmlwindow.c:1442
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
IOmHistory IOmHistory_iface
IHTMLWindow5 IHTMLWindow5_iface
#define DISPID_IHTMLWINDOW2_LOCATION
Definition: mshtmdid.h:1845
static HRESULT WINAPI HTMLWindow2_put_onbeforeunload(IHTMLWindow2 *iface, VARIANT v)
Definition: htmlwindow.c:1086
HRESULT HTMLScreen_Create(IHTMLScreen **ret)
Definition: htmlscreen.c:234
global_prop_type_t type
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
IServiceProvider IServiceProvider_iface
static HRESULT WINAPI HTMLWindow2_get_document(IHTMLWindow2 *iface, IHTMLDocument2 **p)
Definition: htmlwindow.c:1190
CHAR16 * String
Definition: acefiex.h:201
GLenum GLclampf GLint i
Definition: glfuncs.h:14
HRESULT HTMLOptionElementFactory_Create(HTMLInnerWindow *window, HTMLOptionElementFactory **ret_ptr)
Definition: htmloption.c:618
static ULONG WINAPI WindowDispEx_AddRef(IDispatchEx *iface)
Definition: htmlwindow.c:2413
HTMLOuterWindow * parent
IHTMLStorage * session_storage
static HRESULT WINAPI HTMLWindow6_Invoke(IHTMLWindow6 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: htmlwindow.c:2037
static HRESULT WINAPI HTMLWindow5_QueryInterface(IHTMLWindow5 *iface, REFIID riid, void **ppv)
Definition: htmlwindow.c:1889
static HRESULT WINAPI HTMLWindow2_get_onblur(IHTMLWindow2 *iface, VARIANT *p)
Definition: htmlwindow.c:1059
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const IHTMLPrivateWindowVtbl HTMLPrivateWindowVtbl
Definition: htmlwindow.c:2279
#define FALSE
Definition: types.h:117
HTMLOptionElementFactory * option_factory
GLenum const GLfloat * params
Definition: glext.h:5645
unsigned int UINT32
HRESULT WINAPI SafeArrayAccessData(SAFEARRAY *psa, void **ppvData)
Definition: safearray.c:1139
static HRESULT WINAPI HTMLWindow5_Invoke(IHTMLWindow5 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: htmlwindow.c:1934
#define ID_PROMPT_EDIT
Definition: resource.h:30
long LONG
Definition: pedump.c:60
global_prop_t * global_props
static HRESULT WINAPI HTMLWindow2_put_onresize(IHTMLWindow2 *iface, VARIANT v)
Definition: htmlwindow.c:1154
HTMLInnerWindow * pending_window
LONG_PTR LPARAM
Definition: windef.h:208
HRESULT super_navigate(HTMLOuterWindow *, IUri *, DWORD, const WCHAR *, BYTE *, DWORD) DECLSPEC_HIDDEN
Definition: navigate.c:2016
#define ID_PROMPT_DIALOG
Definition: resource.h:28
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
static HTMLWindow * impl_from_ITravelLogClient(ITravelLogClient *iface)
Definition: htmlwindow.c:2291
static HRESULT WINAPI HTMLWindow2_put_onhelp(IHTMLWindow2 *iface, VARIANT v)
Definition: htmlwindow.c:1118
#define debugstr_w
Definition: kernel32.h:32
static size_t elem
Definition: string.c:68
GLenum GLint ref
Definition: glext.h:6028
#define FIXME(fmt,...)
Definition: debug.h:110
HRESULT do_query_service(IUnknown *unk, REFGUID guid_service, REFIID riid, void **ppv)
Definition: main.c:141
static HRESULT WINAPI HTMLWindow2_get_frames(IHTMLWindow2 *iface, IHTMLFramesCollection2 **p)
Definition: htmlwindow.c:494
static ULONG WINAPI HTMLWindow5_Release(IHTMLWindow5 *iface)
Definition: htmlwindow.c:1903
static HRESULT WINAPI HTMLWindow2_open(IHTMLWindow2 *iface, BSTR url, BSTR name, BSTR features, VARIANT_BOOL replace, IHTMLWindow2 **pomWindowResult)
Definition: htmlwindow.c:916
static HTMLWindow * impl_from_IHTMLWindow2(IHTMLWindow2 *iface)
Definition: htmlwindow.c:111
static HRESULT WINAPI HTMLWindow2_get_clientInformation(IHTMLWindow2 *iface, IOmNavigator **p)
Definition: htmlwindow.c:1325
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: CString.cpp:62
static void release_outer_window(HTMLOuterWindow *This)
Definition: htmlwindow.c:171
struct list sibling_entry
ITravelLogClient ITravelLogClient_iface
unsigned int idx
Definition: utils.c:41
static HRESULT WINAPI HTMLWindow2_navigate(IHTMLWindow2 *iface, BSTR url)
Definition: htmlwindow.c:1023
static HRESULT WINAPI HTMLWindow2_get_external(IHTMLWindow2 *iface, IDispatch **p)
Definition: htmlwindow.c:1449
static HRESULT WINAPI HTMLWindow2_put_onerror(IHTMLWindow2 *iface, VARIANT v)
Definition: htmlwindow.c:1136
#define S_FALSE
Definition: winerror.h:2357
static HRESULT WINAPI HTMLWindow2_get_self(IHTMLWindow2 *iface, IHTMLWindow2 **p)
Definition: htmlwindow.c:985
static HRESULT WINAPI HTMLWindow2_get_length(IHTMLWindow2 *iface, LONG *p)
Definition: htmlwindow.c:468
static const ITravelLogClientVtbl TravelLogClientVtbl
Definition: htmlwindow.c:2341
#define E_INVALIDARG
Definition: ddrawi.h:101
static ULONG WINAPI HTMLWindow6_Release(IHTMLWindow6 *iface)
Definition: htmlwindow.c:2005
const WCHAR * str
static HRESULT WINAPI HTMLWindow3_get_screenLeft(IHTMLWindow3 *iface, LONG *p)
Definition: htmlwindow.c:1604
#define V_BOOLREF(A)
Definition: oleauto.h:225
VARIANT * textdata
Definition: htmlwindow.c:626
static HRESULT WINAPI HTMLWindow3_setInterval(IHTMLWindow3 *iface, VARIANT *expression, LONG msec, VARIANT *language, LONG *timerID)
Definition: htmlwindow.c:1706
static HRESULT WINAPI HTMLWindow2_GetIDsOfNames(IHTMLWindow2 *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: htmlwindow.c:289
static HRESULT WINAPI HTMLWindow5_put_XMLHttpRequest(IHTMLWindow5 *iface, VARIANT v)
Definition: htmlwindow.c:1944
static HRESULT WINAPI HTMLWindow6_get_onmessage(IHTMLWindow6 *iface, VARIANT *p)
Definition: htmlwindow.c:2129
smooth NULL
Definition: ftsmooth.c:416
static HTMLInnerWindow * impl_from_DispatchEx(DispatchEx *iface)
Definition: htmlwindow.c:2748
HRESULT create_pending_window(HTMLOuterWindow *outer_window, nsChannelBSC *channelbsc)
Definition: htmlwindow.c:3009
#define MB_ICONQUESTION
Definition: winuser.h:783
void release_script_hosts(HTMLInnerWindow *) DECLSPEC_HIDDEN
Definition: script.c:1583
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:242
HTMLOuterWindow * nswindow_to_window(const nsIDOMWindow *nswindow)
Definition: htmlwindow.c:3099
static HRESULT WINAPI HTMLWindow6_get_localStorage(IHTMLWindow6 *iface, IHTMLStorage **p)
Definition: htmlwindow.c:2080
static ULONG WINAPI HTMLWindow4_AddRef(IHTMLWindow4 *iface)
Definition: htmlwindow.c:1801
#define MB_OKCANCEL
Definition: winuser.h:798
static HRESULT WINAPI HTMLPrivateWindow_GetAddressBarUrl(IHTMLPrivateWindow *iface, BSTR *url)
Definition: htmlwindow.c:2267
static BOOL notify_webbrowser_close(HTMLOuterWindow *window, HTMLDocumentObj *doc)
Definition: htmlwindow.c:768
static HRESULT WINAPI HTMLWindow2_get_onload(IHTMLWindow2 *iface, VARIANT *p)
Definition: htmlwindow.c:1077
#define IDS_MESSAGE_BOX_TITLE
Definition: resource.h:32
void(* bind_event)(DispatchEx *, int)
GLuint index
Definition: glext.h:6031
static HTMLWindow * impl_from_IObjectIdentity(IObjectIdentity *iface)
Definition: htmlwindow.c:2350
IDispatchEx IDispatchEx_iface
void remove_target_tasks(LONG) DECLSPEC_HIDDEN
Definition: task.c:107
#define debugstr_guid
Definition: kernel32.h:35
#define DISPATCH_PROPERTYPUT
Definition: oleauto.h:1008
HRESULT navigate_new_window(HTMLOuterWindow *, IUri *, const WCHAR *, request_data_t *, IHTMLWindow2 **) DECLSPEC_HIDDEN
Definition: navigate.c:2132
static HRESULT WINAPI HTMLWindow6_toStaticHTML(IHTMLWindow6 *iface, BSTR bstrHTML, BSTR *pbstrStaticHTML)
Definition: htmlwindow.c:2115
static HRESULT WINAPI HTMLWindow5_GetIDsOfNames(IHTMLWindow5 *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: htmlwindow.c:1925
static HRESULT WINAPI HTMLWindow2_GetTypeInfo(IHTMLWindow2 *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: htmlwindow.c:281
static const dispex_static_data_vtbl_t HTMLWindow_dispex_vtbl
Definition: htmlwindow.c:2870
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
HTMLInnerWindow * inner_window
#define NS_FAILED(res)
static INT_PTR CALLBACK prompt_dlgproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: htmlwindow.c:629
#define DISPID_WINDOWCLOSING
Definition: webchild.h:65
IDispatchEx IDispatchEx_iface
static HRESULT WINAPI HTMLWindow6_GetTypeInfoCount(IHTMLWindow6 *iface, UINT *pctinfo)
Definition: htmlwindow.c:2012
HRESULT return_nsstr(nsresult, nsAString *, BSTR *) DECLSPEC_HIDDEN
Definition: nsembed.c:841
IUnknown * webbrowser
static ULONG WINAPI WindowDispEx_Release(IDispatchEx *iface)
Definition: htmlwindow.c:2420
INT replace(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], DWORD dwFlags, BOOL *doMore)
Definition: replace.c:47
GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg3
Definition: glext.h:9515
static HRESULT WINAPI HTMLWindow6_get_onhashchange(IHTMLWindow6 *iface, VARIANT *p)
Definition: htmlwindow.c:2094
static HRESULT HTMLWindow_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller)
Definition: htmlwindow.c:2753
HRESULT set_event_handler(EventTarget *event_target, eventid_t eid, VARIANT *var)
Definition: htmlevent.c:1404
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
static HRESULT WINAPI HTMLWindow2_put_onload(IHTMLWindow2 *iface, VARIANT v)
Definition: htmlwindow.c:1068
static HRESULT WINAPI HTMLWindow2_put_name(IHTMLWindow2 *iface, BSTR v)
Definition: htmlwindow.c:871
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT WINAPI HTMLWindow3_GetIDsOfNames(IHTMLWindow3 *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: htmlwindow.c:1584
unsigned int BOOL
Definition: ntddk_ex.h:94
GLsizeiptr size
Definition: glext.h:5919
static HRESULT WINAPI HTMLWindow2_put_opener(IHTMLWindow2 *iface, VARIANT v)
Definition: htmlwindow.c:844
static HRESULT WINAPI HTMLWindow2_get_event(IHTMLWindow2 *iface, IHTMLEventObj **p)
Definition: htmlwindow.c:1207
HRESULT hres
Definition: protocol.c:465
static HRESULT WINAPI TravelLogClient_GetWindowData(ITravelLogClient *iface, IStream *pStream, LPWINDOWDATA pWinData)
Definition: htmlwindow.c:2327
HTMLInnerWindow * window
r parent
Definition: btrfs.c:2644
HTMLXMLHttpRequestFactory * xhr_factory
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
static ULONG WINAPI HTMLWindow5_AddRef(IHTMLWindow5 *iface)
Definition: htmlwindow.c:1896
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define LIST_INIT(head)
Definition: queue.h:197
dispex_static_data_t * data
static HRESULT WINAPI HTMLWindow2_clearTimeout(IHTMLWindow2 *iface, LONG timerID)
Definition: htmlwindow.c:557
static HRESULT WINAPI HTMLWindow2_get_location(IHTMLWindow2 *iface, IHTMLLocation **p)
Definition: htmlwindow.c:732
static HRESULT WINAPI HTMLWindow2_Invoke(IHTMLWindow2 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: htmlwindow.c:299
LONG HRESULT
Definition: typedefs.h:77
static HRESULT WINAPI HTMLWindow3_GetTypeInfoCount(IHTMLWindow3 *iface, UINT *pctinfo)
Definition: htmlwindow.c:1569
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
static ULONG WINAPI HTMLPrivateWindow_AddRef(IHTMLPrivateWindow *iface)
Definition: htmlwindow.c:2177
static const WCHAR url[]
Definition: encode.c:1432
HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument *nsdoc, HTMLDocumentObj *doc_obj, HTMLInnerWindow *window, HTMLDocumentNode **ret)
Definition: htmldoc.c:4616
static HTMLWindow * impl_from_IHTMLWindow3(IHTMLWindow3 *iface)
Definition: htmlwindow.c:1543
HRESULT get_event_handler(EventTarget *event_target, eventid_t eid, VARIANT *var)
Definition: htmlevent.c:1447
HTMLDocument basedoc
static HTMLWindow * impl_from_IHTMLPrivateWindow(IHTMLPrivateWindow *iface)
Definition: htmlwindow.c:2165
#define WM_CLOSE
Definition: winuser.h:1603
static BOOL is_outer_window(HTMLWindow *window)
Definition: htmlwindow.c:25
int WINAPI GetWindowTextLengthW(_In_ HWND)
IServiceProvider IServiceProvider_iface
static HTMLWindow * impl_from_IHTMLWindow4(IHTMLWindow4 *iface)
Definition: htmlwindow.c:1789
#define V_BOOL(A)
Definition: oleauto.h:224
static HTMLWindow * impl_from_IHTMLWindow6(IHTMLWindow6 *iface)
Definition: htmlwindow.c:1986
#define BN_CLICKED
Definition: winuser.h:1886
static HRESULT WINAPI HTMLWindow4_GetIDsOfNames(IHTMLWindow4 *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: htmlwindow.c:1830
static HRESULT WINAPI HTMLWindow6_GetIDsOfNames(IHTMLWindow6 *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: htmlwindow.c:2027
BSTR dststr
Definition: htmlwindow.c:625
HRESULT create_relative_uri(HTMLOuterWindow *, const WCHAR *, IUri **) DECLSPEC_HIDDEN
Definition: persist.c:163
ConnectionPointContainer cp_container
GLbitfield flags
Definition: glext.h:7161
READYSTATE readystate
static HRESULT WINAPI HTMLWindow2_get_name(IHTMLWindow2 *iface, BSTR *p)
Definition: htmlwindow.c:888
static HRESULT WINAPI HTMLWindow6_msWriteProfilerMark(IHTMLWindow6 *iface, BSTR bstrProfilerMark)
Definition: htmlwindow.c:2136
static HRESULT get_location(HTMLInnerWindow *This, HTMLLocation **ret)
Definition: htmlwindow.c:43
static HRESULT WINAPI ObjectIdentity_IsEqualObject(IObjectIdentity *iface, IUnknown *unk)
Definition: htmlwindow.c:2376
IHTMLFrameBase IHTMLFrameBase_iface
static HRESULT WINAPI HTMLWindow2_confirm(IHTMLWindow2 *iface, BSTR message, VARIANT_BOOL *confirmed)
Definition: htmlwindow.c:597
static HRESULT WINAPI HTMLWindow2_put_defaultStatus(IHTMLWindow2 *iface, BSTR v)
Definition: htmlwindow.c:505
const GUID IID_IDispatch
IHTMLWindow3 IHTMLWindow3_iface
static HRESULT WINAPI HTMLWindow2_setTimeout(IHTMLWindow2 *iface, BSTR expression, LONG msec, VARIANT *language, LONG *timerID)
Definition: htmlwindow.c:543
static HRESULT WINAPI HTMLWindow2_get_onbeforeunload(IHTMLWindow2 *iface, VARIANT *p)
Definition: htmlwindow.c:1095
static void detach_inner_window(HTMLInnerWindow *window)
Definition: htmlwindow.c:87
static HRESULT WINAPI HTMLWindow2_resizeTo(IHTMLWindow2 *iface, LONG x, LONG y)
Definition: htmlwindow.c:1435
int ret
HRESULT detach_event(EventTarget *event_target, BSTR name, IDispatch *disp)
Definition: htmlevent.c:1504
static ULONG WINAPI HTMLWindow3_AddRef(IHTMLWindow3 *iface)
Definition: htmlwindow.c:1555
IHTMLScreen * screen
static HRESULT WINAPI HTMLWindow6_put_XDomainRequest(IHTMLWindow6 *iface, VARIANT v)
Definition: htmlwindow.c:2047
#define IID_NULL
Definition: guiddef.h:93
static const CHAR post_data[]
Definition: protocol.c:215
#define InterlockedDecrement
Definition: armddk.h:52
static const tid_t HTMLWindow_iface_tids[]
Definition: htmlwindow.c:2879
static HRESULT WINAPI HTMLWindow2_scroll(IHTMLWindow2 *iface, LONG x, LONG y)
Definition: htmlwindow.c:1309
static HRESULT WINAPI HTMLWindow2_close(IHTMLWindow2 *iface)
Definition: htmlwindow.c:825
nsIDOMWindow * nswindow
#define DWLP_USER
Definition: winuser.h:866
#define V_VT(A)
Definition: oleauto.h:211
HTMLDOMNode node
static HRESULT WINAPI HTMLWindow3_Invoke(IHTMLWindow3 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: htmlwindow.c:1594
static HRESULT WINAPI HTMLWindow4_createPopup(IHTMLWindow4 *iface, VARIANT *varArgIn, IDispatch **ppPopup)
Definition: htmlwindow.c:1850
void abort_window_bindings(HTMLInnerWindow *) DECLSPEC_HIDDEN
Definition: navigate.c:1775
static HRESULT WINAPI HTMLWindow2_get_top(IHTMLWindow2 *iface, IHTMLWindow2 **p)
Definition: htmlwindow.c:997
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static HRESULT set_window_event(HTMLWindow *window, eventid_t eid, VARIANT *var)
Definition: htmlwindow.c:67
static HRESULT WINAPI HTMLWindow2_get_onunload(IHTMLWindow2 *iface, VARIANT *p)
Definition: htmlwindow.c:1111
BSTR message
Definition: htmlwindow.c:624
Definition: _list.h:228
GLenum GLsizei len
Definition: glext.h:6722
UINT WINAPI SysStringLen(BSTR str)
Definition: oleaut.c:200
static HRESULT WINAPI HTMLWindow2_get_history(IHTMLWindow2 *iface, IOmHistory **p)
Definition: htmlwindow.c:748
static HRESULT WINAPI HTMLPrivateWindow_PICSComplete(IHTMLPrivateWindow *iface, int arg)
Definition: htmlwindow.c:2253
HTMLElement element
#define WM_COMMAND
Definition: winuser.h:1716
IInternetSecurityManager * secmgr
static IHTMLWindow2 * window
Definition: events.c:77
struct _cl_event * event
Definition: glext.h:7739
static HRESULT WINAPI HTMLWindow6_get_maxConnectionsPerServer(IHTMLWindow6 *iface, LONG *p)
Definition: htmlwindow.c:2101
UINT WPARAM LPARAM lparam
Definition: msvc.h:92
static HRESULT WINAPI HTMLWindow2_scrollBy(IHTMLWindow2 *iface, LONG x, LONG y)
Definition: htmlwindow.c:1393
#define WINAPI
Definition: msvc.h:20
static ULONG htmldoc_release(HTMLDocument *This)
static ULONG WINAPI ObjectIdentity_Release(IObjectIdentity *iface)
Definition: htmlwindow.c:2369
LONG get_task_target_magic(void) DECLSPEC_HIDDEN
Definition: task.c:139
#define V_BSTR(A)
Definition: oleauto.h:226
EventTarget event_target
HTMLLocation * location
unsigned char BYTE
Definition: ntddk_ex.h:96
HRESULT create_storage(IHTMLStorage **p)
Definition: htmlstorage.c:188
#define location(file, line)
Definition: kmtest.h:18
IDispatch * script_parse_event(HTMLInnerWindow *, LPCWSTR) DECLSPEC_HIDDEN
Definition: script.c:1184
#define strcmpiW(s1, s2)
Definition: unicode.h:39
IHTMLEventObj * event
IOmNavigator * OmNavigator_Create(void) DECLSPEC_HIDDEN
Definition: omnavigator.c:1079
HRESULT WINAPI CoInternetCreateSecurityManager(IServiceProvider *pSP, IInternetSecurityManager **ppSM, DWORD dwReserved)
Definition: sec_mgr.c:1845
struct ConnectionPointContainer * forward_container
static HRESULT WINAPI HTMLWindow3_get_onbeforeprint(IHTMLWindow3 *iface, VARIANT *p)
Definition: htmlwindow.c:1730
static HRESULT WINAPI HTMLWindow2_put_status(IHTMLWindow2 *iface, BSTR v)
Definition: htmlwindow.c:519
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define ERR(fmt,...)
Definition: debug.h:109
static void release_children(HTMLOuterWindow *This)
Definition: htmlwindow.c:30
static const IHTMLWindow6Vtbl HTMLWindow6Vtbl
Definition: htmlwindow.c:2143
static HRESULT WINAPI HTMLWindow3_attachEvent(IHTMLWindow3 *iface, BSTR event, IDispatch *pDisp, VARIANT_BOOL *pfResult)
Definition: htmlwindow.c:1636
HRESULT search_window_props(HTMLInnerWindow *This, BSTR bstrName, DWORD grfdex, DISPID *pid)
Definition: htmlwindow.c:2513
IHTMLElement IHTMLElement_iface
global_prop_type_t
struct stdole::EXCEPINFO EXCEPINFO
static HRESULT WINAPI HTMLWindow2_put_onblur(IHTMLWindow2 *iface, VARIANT v)
Definition: htmlwindow.c:1050
__WINE_SERVER_LIST_INLINE int list_empty(const struct list *list)
Definition: list.h:143
static const char * debugstr_variant(const VARIANT *var)
Definition: container.c:46
static HRESULT WINAPI HTMLWindow2_get__newEnum(IHTMLWindow2 *iface, IUnknown **p)
Definition: htmlwindow.c:1220
static VARIANTARG static DISPID
Definition: ordinal.c:49
#define S_OK
Definition: intsafe.h:59
HINSTANCE hInst
Definition: dxdiag.c:13
void detach_events(HTMLDocumentNode *doc)
Definition: htmlevent.c:1341
HRESULT exec_script(HTMLInnerWindow *, const WCHAR *, const WCHAR *, VARIANT *) DECLSPEC_HIDDEN
Definition: script.c:1245
static HRESULT WINAPI HTMLWindow2_get_screen(IHTMLWindow2 *iface, IHTMLScreen **p)
Definition: htmlwindow.c:1243
static HRESULT WINAPI HTMLWindow3_get_clipboardData(IHTMLWindow3 *iface, IHTMLDataTransfer **p)
Definition: htmlwindow.c:1751
#define InterlockedIncrement
Definition: armddk.h:53
const GLdouble * v
Definition: gl.h:2040
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1378
BOOL dispex_query_interface(DispatchEx *This, REFIID riid, void **ppv)
Definition: dispex.c:1656
HRESULT create_history(HTMLInnerWindow *, OmHistory **) DECLSPEC_HIDDEN
Definition: omnavigator.c:334
static const IHTMLWindow4Vtbl HTMLWindow4Vtbl
Definition: htmlwindow.c:1872
static const WCHAR objectW[]
Definition: engine.c:35
HTMLDocumentObj * doc_obj
static HRESULT WINAPI HTMLWindow2_get_onresize(IHTMLWindow2 *iface, VARIANT *p)
Definition: htmlwindow.c:1163
nsChannelBSC * bscallback
void set_current_mon(HTMLOuterWindow *, IMoniker *, DWORD) DECLSPEC_HIDDEN
Definition: persist.c:99
OmHistory * history
IHTMLWindow6 IHTMLWindow6_iface
eventid_t
Definition: htmlevent.h:21
#define E_NOTIMPL
Definition: ddrawi.h:99
HTMLOuterWindow * outer_window
static HRESULT get_frame_by_index(HTMLOuterWindow *This, UINT32 index, HTMLOuterWindow **ret)
Definition: htmlwindow.c:309
#define BINDING_NAVIGATED
Definition: binding.h:127
static ULONG WINAPI HTMLWindowSP_AddRef(IServiceProvider *iface)
Definition: htmlwindow.c:2711
windowref_t * window_ref
static ULONG htmldoc_addref(HTMLDocument *This)
static void HTMLWindow_bind_event(DispatchEx *dispex, int eid)
Definition: htmlwindow.c:2864
IHTMLOptionElementFactory IHTMLOptionElementFactory_iface
void nsAString_InitDepend(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
Definition: nsembed.c:826
IBindStatusCallback IBindStatusCallback_iface
Definition: binding.h:72
event_target_t * body_event_target
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4024
static const IHTMLWindow5Vtbl HTMLWindow5Vtbl
Definition: htmlwindow.c:1974
static HRESULT WINAPI HTMLWindow6_put_onmessage(IHTMLWindow6 *iface, VARIANT v)
Definition: htmlwindow.c:2122
IHTMLDocument2 IHTMLDocument2_iface
IHTMLWindow4 IHTMLWindow4_iface
HTMLInnerWindow * window
static ULONG WINAPI HTMLWindow4_Release(IHTMLWindow4 *iface)
Definition: htmlwindow.c:1808
HRESULT init_dispex(jsdisp_t *dispex, script_ctx_t *ctx, const builtin_info_t *builtin_info, jsdisp_t *prototype)
Definition: dispex.c:940
static HRESULT WINAPI HTMLWindow2_get_window(IHTMLWindow2 *iface, IHTMLWindow2 **p)
Definition: htmlwindow.c:1011
IDocHostUIHandler * hostui
static HRESULT WINAPI HTMLWindow6_get_XDomainRequest(IHTMLWindow6 *iface, VARIANT *p)
Definition: htmlwindow.c:2054
static HRESULT WINAPI HTMLWindow5_GetTypeInfoCount(IHTMLWindow5 *iface, UINT *pctinfo)
Definition: htmlwindow.c:1910
ScriptHost * script_host
static HRESULT WINAPI WindowDispEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
Definition: htmlwindow.c:2599
static HWND dialog
Definition: gui.c:33
static void * alloc_window(size_t size)
Definition: htmlwindow.c:2894
BOOL nsAString_Init(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
Definition: nsembed.c:817
#define E_UNEXPECTED
Definition: winerror.h:2456
static HRESULT WINAPI HTMLPrivateWindow_QueryInterface(IHTMLPrivateWindow *iface, REFIID riid, void **ppv)
Definition: htmlwindow.c:2170
static HRESULT WINAPI HTMLWindow2_showModalDialog(IHTMLWindow2 *iface, BSTR dialog, VARIANT *varArgIn, VARIANT *varOptions, VARIANT *varArgOut)
Definition: htmlwindow.c:1227
static HRESULT WINAPI WindowDispEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv)
Definition: htmlwindow.c:2406
void nsAString_Finish(nsAString *) DECLSPEC_HIDDEN
Definition: nsembed.c:836
#define BINDING_NOFRAG
Definition: binding.h:132
static HRESULT WINAPI HTMLWindow2_get_Image(IHTMLWindow2 *iface, IHTMLImageElementFactory **p)
Definition: htmlwindow.c:711
static HRESULT WINAPI HTMLWindow2_moveTo(IHTMLWindow2 *iface, LONG x, LONG y)
Definition: htmlwindow.c:1421
static ULONG WINAPI HTMLWindow3_Release(IHTMLWindow3 *iface)
Definition: htmlwindow.c:1562
static HRESULT WINAPI ObjectIdentity_QueryInterface(IObjectIdentity *iface, REFIID riid, void **ppv)
Definition: htmlwindow.c:2355
POINT cp
Definition: magnifier.c:60
Definition: name.c:36
static HRESULT WINAPI HTMLWindow2_toString(IHTMLWindow2 *iface, BSTR *String)
Definition: htmlwindow.c:1378
static HRESULT WINAPI HTMLWindow3_put_onafterprint(IHTMLWindow3 *iface, VARIANT v)
Definition: htmlwindow.c:1737
WINE_UNICODE_INLINE int strcmpW(const WCHAR *str1, const WCHAR *str2)
Definition: unicode.h:229
static HRESULT WINAPI HTMLWindow2_put_onfocus(IHTMLWindow2 *iface, VARIANT v)
Definition: htmlwindow.c:1032
GLuint res
Definition: glext.h:9613
struct stdole::DISPPARAMS DISPPARAMS
static ULONG WINAPI HTMLWindow2_AddRef(IHTMLWindow2 *iface)
Definition: htmlwindow.c:161
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
IHTMLWindow2 IHTMLWindow2_iface
static HRESULT WINAPI HTMLWindow2_blur(IHTMLWindow2 *iface)
Definition: htmlwindow.c:1302
UINT msg
Definition: msvc.h:92
static HRESULT WINAPI HTMLPrivateWindow_GetPendingUrl(IHTMLPrivateWindow *iface, BSTR *url)
Definition: htmlwindow.c:2239
HRESULT nsresult
Definition: nsiface.idl:39
WCHAR PRUnichar
Definition: nsiface.idl:48
unsigned int ULONG
Definition: retypes.h:1
GLenum GLuint id
Definition: glext.h:5579
HRESULT HTMLImageElementFactory_Create(HTMLInnerWindow *window, HTMLImageElementFactory **ret_val)
Definition: htmlimg.c:972
static HRESULT WINAPI HTMLWindow2_put_onunload(IHTMLWindow2 *iface, VARIANT v)
Definition: htmlwindow.c:1104
static const WCHAR sp[]
Definition: suminfo.c:288
static HRESULT WINAPI HTMLWindow2_get_status(IHTMLWindow2 *iface, BSTR *p)
Definition: htmlwindow.c:532
HTMLInnerWindow * window
static HRESULT WINAPI HTMLWindow2_get_navigator(IHTMLWindow2 *iface, IOmNavigator **p)
Definition: htmlwindow.c:861
static HRESULT WINAPI WindowDispEx_GetTypeInfo(IDispatchEx *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: htmlwindow.c:2436
HRESULT attach_event(EventTarget *event_target, BSTR name, IDispatch *disp, VARIANT_BOOL *res)
Definition: htmlevent.c:1469
static HRESULT WINAPI HTMLWindow3_get_screenTop(IHTMLWindow3 *iface, LONG *p)
Definition: htmlwindow.c:1620
static HRESULT WINAPI TravelLogClient_FindWindowByIndex(ITravelLogClient *iface, DWORD dwID, IUnknown **ppunk)
Definition: htmlwindow.c:2317
#define SetWindowLongPtrW
Definition: winuser.h:5215
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
static HRESULT WINAPI WindowDispEx_GetTypeInfoCount(IDispatchEx *iface, UINT *pctinfo)
Definition: htmlwindow.c:2427
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
HRESULT get_frame_by_name(HTMLOuterWindow *This, const WCHAR *name, BOOL deep, HTMLOuterWindow **ret)
Definition: htmlwindow.c:343
static HRESULT WINAPI WindowDispEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
Definition: htmlwindow.c:2544
void detach_plugin_host(PluginHost *host)
Definition: pluginhost.c:1988
static DWORD prop_to_dispid(HTMLInnerWindow *This, global_prop_t *prop)
Definition: htmlwindow.c:2508
#define V_UINT(A)
Definition: oleauto.h:264
GLfloat GLfloat p
Definition: glext.h:8902
#define IDCANCEL
Definition: winuser.h:825
const XML_Char const XML_Char * uri
Definition: expat.h:380
static HRESULT WINAPI HTMLWindow2_get_opener(IHTMLWindow2 *iface, VARIANT *p)
Definition: htmlwindow.c:851
#define LIST_ENTRY(type)
Definition: queue.h:175
IDispatch * get_script_disp(ScriptHost *) DECLSPEC_HIDDEN
Definition: script.c:1281
static HRESULT WINAPI WindowDispEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk)
Definition: htmlwindow.c:2672
IHTMLDocument3 IHTMLDocument3_iface
static HRESULT WINAPI HTMLWindow4_get_frameElement(IHTMLWindow4 *iface, IHTMLFrameBase **p)
Definition: htmlwindow.c:1858
static void release_inner_window(HTMLInnerWindow *This)
Definition: htmlwindow.c:201
DispatchEx dispex
static const WCHAR onW[]
Definition: lex.c:70
static HRESULT WINAPI HTMLWindow2_focus(IHTMLWindow2 *iface)
Definition: htmlwindow.c:1284
static HRESULT WINAPI HTMLWindow2_showHelp(IHTMLWindow2 *iface, BSTR helpURL, VARIANT helpArg, BSTR features)
Definition: htmlwindow.c:1235
#define ID_PROMPT_PROMPT
Definition: resource.h:29
INT INT y
Definition: msvc.h:62
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define args
Definition: format.c:66
static const IDispatchExVtbl WindowDispExVtbl
Definition: htmlwindow.c:2682
static HRESULT WINAPI HTMLWindow5_GetTypeInfo(IHTMLWindow5 *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: htmlwindow.c:1917
#define WM_INITDIALOG
Definition: winuser.h:1715
IHTMLPrivateWindow IHTMLPrivateWindow_iface
HRESULT clear_task_timer(HTMLInnerWindow *, BOOL, DWORD) DECLSPEC_HIDDEN
Definition: task.c:201
static char title[]
Definition: ps.c:92
static HRESULT WINAPI HTMLWindow6_put_onhashchange(IHTMLWindow6 *iface, VARIANT v)
Definition: htmlwindow.c:2087
static HRESULT WINAPI HTMLWindow2_GetTypeInfoCount(IHTMLWindow2 *iface, UINT *pctinfo)
Definition: htmlwindow.c:274
void release_dispex(DispatchEx *This)
Definition: dispex.c:1706
IHTMLImageElementFactory IHTMLImageElementFactory_iface
static HRESULT WINAPI HTMLWindow3_setTimeout(IHTMLWindow3 *iface, VARIANT *expression, LONG msec, VARIANT *language, LONG *timerID)
Definition: htmlwindow.c:1696
static HRESULT WINAPI TravelLogClient_LoadHistoryPosition(ITravelLogClient *iface, LPWSTR pszUrlLocation, DWORD dwPosition)
Definition: htmlwindow.c:2334
static HRESULT WINAPI HTMLWindow2_get_onhelp(IHTMLWindow2 *iface, VARIANT *p)
Definition: htmlwindow.c:1127
static HRESULT WINAPI HTMLWindow2_get_closed(IHTMLWindow2 *iface, VARIANT_BOOL *p)
Definition: htmlwindow.c:1295
HRESULT WINAPI SafeArrayUnaccessData(SAFEARRAY *psa)
Definition: safearray.c:1170
struct list children
static HRESULT WINAPI HTMLWindow2_scrollTo(IHTMLWindow2 *iface, LONG x, LONG y)
Definition: htmlwindow.c:1407
#define SUCCEEDED(hr)
Definition: intsafe.h:57
HTMLInnerWindow * window
static HRESULT WINAPI HTMLWindow2_clearInterval(IHTMLWindow2 *iface, LONG timerID)
Definition: htmlwindow.c:1345
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
#define MAX_MESSAGE_LEN
Definition: htmlwindow.c:566
HRESULT create_uri(const WCHAR *, DWORD, IUri **) DECLSPEC_HIDDEN
Definition: persist.c:158
static const IObjectIdentityVtbl ObjectIdentityVtbl
Definition: htmlwindow.c:2394
UINT WPARAM wparam
Definition: msvc.h:92
INT x
Definition: msvc.h:62
HRESULT HTMLOuterWindow_Create(HTMLDocumentObj *doc_obj, nsIDOMWindow *nswindow, HTMLOuterWindow *parent, HTMLOuterWindow **ret)
Definition: htmlwindow.c:2945