shell32/tests: Fixed potential overflow.
[wine/gsoc_dplay.git] / dlls / mshtml / htmlwindow.c
blob6cd106ff62b2b7baf7f4f434444a440ddff9fb1a
1 /*
2 * Copyright 2006 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include "config.h"
21 #include <stdarg.h>
22 #include <stdio.h>
24 #define COBJMACROS
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winuser.h"
29 #include "winnls.h"
30 #include "ole2.h"
32 #include "wine/debug.h"
33 #include "wine/unicode.h"
35 #include "mshtml_private.h"
36 #include "resource.h"
38 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
40 #define HTMLWINDOW2_THIS(iface) DEFINE_THIS(HTMLWindow, HTMLWindow2, iface)
42 static struct list window_list = LIST_INIT(window_list);
44 static HRESULT WINAPI HTMLWindow2_QueryInterface(IHTMLWindow2 *iface, REFIID riid, void **ppv)
46 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
48 *ppv = NULL;
50 if(IsEqualGUID(&IID_IUnknown, riid)) {
51 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
52 *ppv = HTMLWINDOW2(This);
53 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
54 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
55 *ppv = HTMLWINDOW2(This);
56 }else if(IsEqualGUID(&IID_IHTMLFramesCollection2, riid)) {
57 TRACE("(%p)->(IID_IHTMLFramesCollection2 %p)\n", This, ppv);
58 *ppv = HTMLWINDOW2(This);
59 }else if(IsEqualGUID(&IID_IHTMLWindow2, riid)) {
60 TRACE("(%p)->(IID_IHTMLWindow2 %p)\n", This, ppv);
61 *ppv = HTMLWINDOW2(This);
64 if(*ppv) {
65 IUnknown_AddRef((IUnknown*)*ppv);
66 return S_OK;
69 WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
70 return E_NOINTERFACE;
73 static ULONG WINAPI HTMLWindow2_AddRef(IHTMLWindow2 *iface)
75 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
76 LONG ref = InterlockedIncrement(&This->ref);
78 TRACE("(%p) ref=%d\n", This, ref);
80 return ref;
83 static ULONG WINAPI HTMLWindow2_Release(IHTMLWindow2 *iface)
85 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
86 LONG ref = InterlockedDecrement(&This->ref);
88 TRACE("(%p) ref=%d\n", This, ref);
90 if(!ref) {
91 list_remove(&This->entry);
92 mshtml_free(This);
95 return ref;
98 static HRESULT WINAPI HTMLWindow2_GetTypeInfoCount(IHTMLWindow2 *iface, UINT *pctinfo)
100 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
101 FIXME("(%p)->(%p)\n", This, pctinfo);
102 return E_NOTIMPL;
105 static HRESULT WINAPI HTMLWindow2_GetTypeInfo(IHTMLWindow2 *iface, UINT iTInfo,
106 LCID lcid, ITypeInfo **ppTInfo)
108 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
109 FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
110 return E_NOTIMPL;
113 static HRESULT WINAPI HTMLWindow2_GetIDsOfNames(IHTMLWindow2 *iface, REFIID riid,
114 LPOLESTR *rgszNames, UINT cNames,
115 LCID lcid, DISPID *rgDispId)
117 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
118 FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
119 lcid, rgDispId);
120 return E_NOTIMPL;
123 static HRESULT WINAPI HTMLWindow2_Invoke(IHTMLWindow2 *iface, DISPID dispIdMember,
124 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
125 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
127 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
128 FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
129 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
130 return E_NOTIMPL;
133 static HRESULT WINAPI HTMLWindow2_item(IHTMLWindow2 *iface, VARIANT *pvarIndex, VARIANT *pvarResult)
135 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
136 FIXME("(%p)->(%p %p)\n", This, pvarIndex, pvarResult);
137 return E_NOTIMPL;
140 static HRESULT WINAPI HTMLWindow2_get_length(IHTMLWindow2 *iface, long *p)
142 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
143 FIXME("(%p)->(%p)\n", This, p);
144 return E_NOTIMPL;
147 static HRESULT WINAPI HTMLWindow2_get_frames(IHTMLWindow2 *iface, IHTMLFramesCollection2 **p)
149 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
150 FIXME("(%p)->(%p)\n", This, p);
151 return E_NOTIMPL;
154 static HRESULT WINAPI HTMLWindow2_put_defaultStatus(IHTMLWindow2 *iface, BSTR v)
156 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
157 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
158 return E_NOTIMPL;
161 static HRESULT WINAPI HTMLWindow2_get_defaultStatus(IHTMLWindow2 *iface, BSTR *p)
163 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
164 FIXME("(%p)->(%p)\n", This, p);
165 return E_NOTIMPL;
168 static HRESULT WINAPI HTMLWindow2_put_status(IHTMLWindow2 *iface, BSTR v)
170 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
171 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
172 return E_NOTIMPL;
175 static HRESULT WINAPI HTMLWindow2_get_status(IHTMLWindow2 *iface, BSTR *p)
177 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
178 FIXME("(%p)->(%p)\n", This, p);
179 return E_NOTIMPL;
182 static HRESULT WINAPI HTMLWindow2_setTimeout(IHTMLWindow2 *iface, BSTR expression,
183 long msec, VARIANT *language, long *timerID)
185 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
186 FIXME("(%p)->(%s %ld %p %p)\n", This, debugstr_w(expression), msec, language, timerID);
187 return E_NOTIMPL;
190 static HRESULT WINAPI HTMLWindow2_clearTimeout(IHTMLWindow2 *iface, long timerID)
192 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
193 FIXME("(%p)->(%ld)\n", This, timerID);
194 return E_NOTIMPL;
197 static HRESULT WINAPI HTMLWindow2_alert(IHTMLWindow2 *iface, BSTR message)
199 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
200 WCHAR wszTitle[100];
202 TRACE("(%p)->(%s)\n", This, debugstr_w(message));
204 if(!LoadStringW(get_shdoclc(), IDS_MESSAGE_BOX_TITLE, wszTitle,
205 sizeof(wszTitle)/sizeof(WCHAR))) {
206 WARN("Could not load message box title: %d\n", GetLastError());
207 return S_OK;
210 MessageBoxW(This->doc->hwnd, message, wszTitle, MB_ICONWARNING);
211 return S_OK;
214 static HRESULT WINAPI HTMLWindow2_confirm(IHTMLWindow2 *iface, BSTR message,
215 VARIANT_BOOL *confirmed)
217 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
218 FIXME("(%p)->(%s %p)\n", This, debugstr_w(message), confirmed);
219 return E_NOTIMPL;
222 static HRESULT WINAPI HTMLWindow2_prompt(IHTMLWindow2 *iface, BSTR message,
223 BSTR dststr, VARIANT *textdata)
225 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
226 FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(message), debugstr_w(dststr), textdata);
227 return E_NOTIMPL;
230 static HRESULT WINAPI HTMLWindow2_get_Image(IHTMLWindow2 *iface, IHTMLImageElementFactory **p)
232 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
233 FIXME("(%p)->(%p)\n", This, p);
234 return E_NOTIMPL;
237 static HRESULT WINAPI HTMLWindow2_get_location(IHTMLWindow2 *iface, IHTMLLocation **p)
239 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
240 FIXME("(%p)->(%p)\n", This, p);
241 return E_NOTIMPL;
244 static HRESULT WINAPI HTMLWindow2_get_history(IHTMLWindow2 *iface, IOmHistory **p)
246 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
247 FIXME("(%p)->(%p)\n", This, p);
248 return E_NOTIMPL;
251 static HRESULT WINAPI HTMLWindow2_close(IHTMLWindow2 *iface)
253 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
254 FIXME("(%p)->()\n", This);
255 return E_NOTIMPL;
258 static HRESULT WINAPI HTMLWindow2_put_opener(IHTMLWindow2 *iface, VARIANT v)
260 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
261 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
262 return E_NOTIMPL;
265 static HRESULT WINAPI HTMLWindow2_get_opener(IHTMLWindow2 *iface, VARIANT *p)
267 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
268 FIXME("(%p)->(%p)\n", This, p);
269 return E_NOTIMPL;
272 static HRESULT WINAPI HTMLWindow2_get_navigator(IHTMLWindow2 *iface, IOmNavigator **p)
274 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
275 FIXME("(%p)->(%p)\n", This, p);
276 return E_NOTIMPL;
279 static HRESULT WINAPI HTMLWindow2_put_name(IHTMLWindow2 *iface, BSTR v)
281 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
282 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
283 return E_NOTIMPL;
286 static HRESULT WINAPI HTMLWindow2_get_name(IHTMLWindow2 *iface, BSTR *p)
288 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
289 FIXME("(%p)->(%p)\n", This, p);
290 return E_NOTIMPL;
293 static HRESULT WINAPI HTMLWindow2_get_parent(IHTMLWindow2 *iface, IHTMLWindow2 **p)
295 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
296 FIXME("(%p)->(%p)\n", This, p);
297 return E_NOTIMPL;
300 static HRESULT WINAPI HTMLWindow2_open(IHTMLWindow2 *iface, BSTR url, BSTR name,
301 BSTR features, VARIANT_BOOL replace, IHTMLWindow2 **pomWindowResult)
303 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
304 FIXME("(%p)->(%s %s %s %x %p)\n", This, debugstr_w(url), debugstr_w(name),
305 debugstr_w(features), replace, pomWindowResult);
306 return E_NOTIMPL;
309 static HRESULT WINAPI HTMLWindow2_get_self(IHTMLWindow2 *iface, IHTMLWindow2 **p)
311 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
312 FIXME("(%p)->(%p)\n", This, p);
313 return E_NOTIMPL;
316 static HRESULT WINAPI HTMLWindow2_get_top(IHTMLWindow2 *iface, IHTMLWindow2 **p)
318 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
319 FIXME("(%p)->(%p)\n", This, p);
320 return E_NOTIMPL;
323 static HRESULT WINAPI HTMLWindow2_get_window(IHTMLWindow2 *iface, IHTMLWindow2 **p)
325 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
326 FIXME("(%p)->(%p)\n", This, p);
327 return E_NOTIMPL;
330 static HRESULT WINAPI HTMLWindow2_navigate(IHTMLWindow2 *iface, BSTR url)
332 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
333 FIXME("(%p)->(%s)\n", This, debugstr_w(url));
334 return E_NOTIMPL;
337 static HRESULT WINAPI HTMLWindow2_put_onfocus(IHTMLWindow2 *iface, VARIANT v)
339 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
340 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
341 return E_NOTIMPL;
344 static HRESULT WINAPI HTMLWindow2_get_onfocus(IHTMLWindow2 *iface, VARIANT *p)
346 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
347 FIXME("(%p)->(%p)\n", This, p);
348 return E_NOTIMPL;
351 static HRESULT WINAPI HTMLWindow2_put_onblur(IHTMLWindow2 *iface, VARIANT v)
353 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
354 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
355 return E_NOTIMPL;
358 static HRESULT WINAPI HTMLWindow2_get_onblur(IHTMLWindow2 *iface, VARIANT *p)
360 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
361 FIXME("(%p)->(%p)\n", This, p);
362 return E_NOTIMPL;
365 static HRESULT WINAPI HTMLWindow2_put_onload(IHTMLWindow2 *iface, VARIANT v)
367 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
368 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
369 return E_NOTIMPL;
372 static HRESULT WINAPI HTMLWindow2_get_onload(IHTMLWindow2 *iface, VARIANT *p)
374 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
375 FIXME("(%p)->(%p)\n", This, p);
376 return E_NOTIMPL;
379 static HRESULT WINAPI HTMLWindow2_put_onbeforeunload(IHTMLWindow2 *iface, VARIANT v)
381 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
382 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
383 return E_NOTIMPL;
386 static HRESULT WINAPI HTMLWindow2_get_onbeforeunload(IHTMLWindow2 *iface, VARIANT *p)
388 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
389 FIXME("(%p)->(%p)\n", This, p);
390 return E_NOTIMPL;
393 static HRESULT WINAPI HTMLWindow2_put_onunload(IHTMLWindow2 *iface, VARIANT v)
395 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
396 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
397 return E_NOTIMPL;
400 static HRESULT WINAPI HTMLWindow2_get_onunload(IHTMLWindow2 *iface, VARIANT *p)
402 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
403 FIXME("(%p)->(%p)\n", This, p);
404 return E_NOTIMPL;
407 static HRESULT WINAPI HTMLWindow2_put_onhelp(IHTMLWindow2 *iface, VARIANT v)
409 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
410 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
411 return E_NOTIMPL;
414 static HRESULT WINAPI HTMLWindow2_get_onhelp(IHTMLWindow2 *iface, VARIANT *p)
416 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
417 FIXME("(%p)->(%p)\n", This, p);
418 return E_NOTIMPL;
421 static HRESULT WINAPI HTMLWindow2_put_onerror(IHTMLWindow2 *iface, VARIANT v)
423 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
424 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
425 return E_NOTIMPL;
428 static HRESULT WINAPI HTMLWindow2_get_onerror(IHTMLWindow2 *iface, VARIANT *p)
430 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
431 FIXME("(%p)->(%p)\n", This, p);
432 return E_NOTIMPL;
435 static HRESULT WINAPI HTMLWindow2_put_onresize(IHTMLWindow2 *iface, VARIANT v)
437 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
438 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
439 return E_NOTIMPL;
442 static HRESULT WINAPI HTMLWindow2_get_onresize(IHTMLWindow2 *iface, VARIANT *p)
444 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
445 FIXME("(%p)->(%p)\n", This, p);
446 return E_NOTIMPL;
449 static HRESULT WINAPI HTMLWindow2_put_onscroll(IHTMLWindow2 *iface, VARIANT v)
451 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
452 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
453 return E_NOTIMPL;
456 static HRESULT WINAPI HTMLWindow2_get_onscroll(IHTMLWindow2 *iface, VARIANT *p)
458 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
459 FIXME("(%p)->(%p)\n", This, p);
460 return E_NOTIMPL;
463 static HRESULT WINAPI HTMLWindow2_get_document(IHTMLWindow2 *iface, IHTMLDocument2 **p)
465 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
466 FIXME("(%p)->(%p)\n", This, p);
467 return E_NOTIMPL;
470 static HRESULT WINAPI HTMLWindow2_get_event(IHTMLWindow2 *iface, IHTMLEventObj **p)
472 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
473 FIXME("(%p)->(%p)\n", This, p);
474 return E_NOTIMPL;
477 static HRESULT WINAPI HTMLWindow2_get__newEnum(IHTMLWindow2 *iface, IUnknown **p)
479 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
480 FIXME("(%p)->(%p)\n", This, p);
481 return E_NOTIMPL;
484 static HRESULT WINAPI HTMLWindow2_showModalDialog(IHTMLWindow2 *iface, BSTR dialog,
485 VARIANT *varArgIn, VARIANT *varOptions, VARIANT *varArgOut)
487 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
488 FIXME("(%p)->(%s %p %p %p)\n", This, debugstr_w(dialog), varArgIn, varOptions, varArgOut);
489 return E_NOTIMPL;
492 static HRESULT WINAPI HTMLWindow2_showHelp(IHTMLWindow2 *iface, BSTR helpURL, VARIANT helpArg,
493 BSTR features)
495 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
496 FIXME("(%p)->(%s v(%d) %s)\n", This, debugstr_w(helpURL), V_VT(&helpArg), debugstr_w(features));
497 return E_NOTIMPL;
500 static HRESULT WINAPI HTMLWindow2_get_screen(IHTMLWindow2 *iface, IHTMLScreen **p)
502 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
503 FIXME("(%p)->(%p)\n", This, p);
504 return E_NOTIMPL;
507 static HRESULT WINAPI HTMLWindow2_get_Option(IHTMLWindow2 *iface, IHTMLOptionElementFactory **p)
509 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
510 FIXME("(%p)->(%p)\n", This, p);
511 return E_NOTIMPL;
514 static HRESULT WINAPI HTMLWindow2_focus(IHTMLWindow2 *iface)
516 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
517 FIXME("(%p)->()\n", This);
518 return E_NOTIMPL;
521 static HRESULT WINAPI HTMLWindow2_get_closed(IHTMLWindow2 *iface, VARIANT_BOOL *p)
523 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
524 FIXME("(%p)->(%p)\n", This, p);
525 return E_NOTIMPL;
528 static HRESULT WINAPI HTMLWindow2_blur(IHTMLWindow2 *iface)
530 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
531 FIXME("(%p)->()\n", This);
532 return E_NOTIMPL;
535 static HRESULT WINAPI HTMLWindow2_scroll(IHTMLWindow2 *iface, long x, long y)
537 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
538 FIXME("(%p)->(%ld %ld)\n", This, x, y);
539 return E_NOTIMPL;
542 static HRESULT WINAPI HTMLWindow2_get_clientInformation(IHTMLWindow2 *iface, IOmNavigator **p)
544 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
545 FIXME("(%p)->(%p)\n", This, p);
546 return E_NOTIMPL;
549 static HRESULT WINAPI HTMLWindow2_setInterval(IHTMLWindow2 *iface, BSTR expression,
550 long msec, VARIANT *language, long *timerID)
552 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
553 FIXME("(%p)->(%s %ld %p %p)\n", This, debugstr_w(expression), msec, language, timerID);
554 return E_NOTIMPL;
557 static HRESULT WINAPI HTMLWindow2_clearInterval(IHTMLWindow2 *iface, long timerID)
559 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
560 FIXME("(%p)->(%ld)\n", This, timerID);
561 return E_NOTIMPL;
564 static HRESULT WINAPI HTMLWindow2_put_offscreenBuffering(IHTMLWindow2 *iface, VARIANT v)
566 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
567 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
568 return E_NOTIMPL;
571 static HRESULT WINAPI HTMLWindow2_get_offscreenBuffering(IHTMLWindow2 *iface, VARIANT *p)
573 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
574 FIXME("(%p)->(%p)\n", This, p);
575 return E_NOTIMPL;
578 static HRESULT WINAPI HTMLWindow2_execScript(IHTMLWindow2 *iface, BSTR scode, BSTR language,
579 VARIANT *pvarRet)
581 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
582 FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(scode), debugstr_w(language), pvarRet);
583 return E_NOTIMPL;
586 static HRESULT WINAPI HTMLWindow2_toString(IHTMLWindow2 *iface, BSTR *String)
588 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
589 FIXME("(%p)->(%p)\n", This, String);
590 return E_NOTIMPL;
593 static HRESULT WINAPI HTMLWindow2_scrollBy(IHTMLWindow2 *iface, long x, long y)
595 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
596 FIXME("(%p)->(%ld %ld)\n", This, x, y);
597 return E_NOTIMPL;
600 static HRESULT WINAPI HTMLWindow2_scrollTo(IHTMLWindow2 *iface, long x, long y)
602 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
603 FIXME("(%p)->(%ld %ld)\n", This, x, y);
604 return E_NOTIMPL;
607 static HRESULT WINAPI HTMLWindow2_moveTo(IHTMLWindow2 *iface, long x, long y)
609 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
610 FIXME("(%p)->(%ld %ld)\n", This, x, y);
611 return E_NOTIMPL;
614 static HRESULT WINAPI HTMLWindow2_moveBy(IHTMLWindow2 *iface, long x, long y)
616 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
617 FIXME("(%p)->(%ld %ld)\n", This, x, y);
618 return E_NOTIMPL;
621 static HRESULT WINAPI HTMLWindow2_resizeTo(IHTMLWindow2 *iface, long x, long y)
623 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
624 FIXME("(%p)->(%ld %ld)\n", This, x, y);
625 return E_NOTIMPL;
628 static HRESULT WINAPI HTMLWindow2_resizeBy(IHTMLWindow2 *iface, long x, long y)
630 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
631 FIXME("(%p)->(%ld %ld)\n", This, x, y);
632 return E_NOTIMPL;
635 static HRESULT WINAPI HTMLWindow2_get_external(IHTMLWindow2 *iface, IDispatch **p)
637 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
638 FIXME("(%p)->(%p)\n", This, p);
639 return E_NOTIMPL;
642 #undef HTMLWINDOW2_THIS
644 static const IHTMLWindow2Vtbl HTMLWindow2Vtbl = {
645 HTMLWindow2_QueryInterface,
646 HTMLWindow2_AddRef,
647 HTMLWindow2_Release,
648 HTMLWindow2_GetTypeInfoCount,
649 HTMLWindow2_GetTypeInfo,
650 HTMLWindow2_GetIDsOfNames,
651 HTMLWindow2_Invoke,
652 HTMLWindow2_item,
653 HTMLWindow2_get_length,
654 HTMLWindow2_get_frames,
655 HTMLWindow2_put_defaultStatus,
656 HTMLWindow2_get_defaultStatus,
657 HTMLWindow2_put_status,
658 HTMLWindow2_get_status,
659 HTMLWindow2_setTimeout,
660 HTMLWindow2_clearTimeout,
661 HTMLWindow2_alert,
662 HTMLWindow2_confirm,
663 HTMLWindow2_prompt,
664 HTMLWindow2_get_Image,
665 HTMLWindow2_get_location,
666 HTMLWindow2_get_history,
667 HTMLWindow2_close,
668 HTMLWindow2_put_opener,
669 HTMLWindow2_get_opener,
670 HTMLWindow2_get_navigator,
671 HTMLWindow2_put_name,
672 HTMLWindow2_get_name,
673 HTMLWindow2_get_parent,
674 HTMLWindow2_open,
675 HTMLWindow2_get_self,
676 HTMLWindow2_get_top,
677 HTMLWindow2_get_window,
678 HTMLWindow2_navigate,
679 HTMLWindow2_put_onfocus,
680 HTMLWindow2_get_onfocus,
681 HTMLWindow2_put_onblur,
682 HTMLWindow2_get_onblur,
683 HTMLWindow2_put_onload,
684 HTMLWindow2_get_onload,
685 HTMLWindow2_put_onbeforeunload,
686 HTMLWindow2_get_onbeforeunload,
687 HTMLWindow2_put_onunload,
688 HTMLWindow2_get_onunload,
689 HTMLWindow2_put_onhelp,
690 HTMLWindow2_get_onhelp,
691 HTMLWindow2_put_onerror,
692 HTMLWindow2_get_onerror,
693 HTMLWindow2_put_onresize,
694 HTMLWindow2_get_onresize,
695 HTMLWindow2_put_onscroll,
696 HTMLWindow2_get_onscroll,
697 HTMLWindow2_get_document,
698 HTMLWindow2_get_event,
699 HTMLWindow2_get__newEnum,
700 HTMLWindow2_showModalDialog,
701 HTMLWindow2_showHelp,
702 HTMLWindow2_get_screen,
703 HTMLWindow2_get_Option,
704 HTMLWindow2_focus,
705 HTMLWindow2_get_closed,
706 HTMLWindow2_blur,
707 HTMLWindow2_scroll,
708 HTMLWindow2_get_clientInformation,
709 HTMLWindow2_setInterval,
710 HTMLWindow2_clearInterval,
711 HTMLWindow2_put_offscreenBuffering,
712 HTMLWindow2_get_offscreenBuffering,
713 HTMLWindow2_execScript,
714 HTMLWindow2_toString,
715 HTMLWindow2_scrollBy,
716 HTMLWindow2_scrollTo,
717 HTMLWindow2_moveTo,
718 HTMLWindow2_moveBy,
719 HTMLWindow2_resizeTo,
720 HTMLWindow2_resizeBy,
721 HTMLWindow2_get_external
724 HTMLWindow *HTMLWindow_Create(HTMLDocument *doc)
726 HTMLWindow *ret = mshtml_alloc(sizeof(HTMLWindow));
728 ret->lpHTMLWindow2Vtbl = &HTMLWindow2Vtbl;
729 ret->ref = 1;
730 ret->nswindow = NULL;
731 ret->doc = doc;
733 if(doc->nscontainer) {
734 nsresult nsres;
736 nsres = nsIWebBrowser_GetContentDOMWindow(doc->nscontainer->webbrowser, &ret->nswindow);
737 if(NS_FAILED(nsres))
738 ERR("GetContentDOMWindow failed: %08x\n", nsres);
741 list_add_head(&window_list, &ret->entry);
743 return ret;
746 HTMLWindow *nswindow_to_window(nsIDOMWindow *nswindow)
748 HTMLWindow *iter;
750 LIST_FOR_EACH_ENTRY(iter, &window_list, HTMLWindow, entry) {
751 if(iter->nswindow == nswindow)
752 return iter;
755 return NULL;