2 * Copyright 2008,2009 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
29 #include "wine/debug.h"
31 #include "mshtml_private.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
35 typedef struct HTMLPluginsCollection HTMLPluginsCollection
;
36 typedef struct HTMLMimeTypesCollection HTMLMimeTypesCollection
;
40 IOmNavigator IOmNavigator_iface
;
44 HTMLPluginsCollection
*plugins
;
45 HTMLMimeTypesCollection
*mime_types
;
50 IHTMLDOMImplementation IHTMLDOMImplementation_iface
;
51 IHTMLDOMImplementation2 IHTMLDOMImplementation2_iface
;
55 nsIDOMDOMImplementation
*implementation
;
56 GeckoBrowser
*browser
;
57 } HTMLDOMImplementation
;
59 static inline HTMLDOMImplementation
*impl_from_IHTMLDOMImplementation(IHTMLDOMImplementation
*iface
)
61 return CONTAINING_RECORD(iface
, HTMLDOMImplementation
, IHTMLDOMImplementation_iface
);
64 static HRESULT WINAPI
HTMLDOMImplementation_QueryInterface(IHTMLDOMImplementation
*iface
, REFIID riid
, void **ppv
)
66 HTMLDOMImplementation
*This
= impl_from_IHTMLDOMImplementation(iface
);
68 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
70 if(IsEqualGUID(&IID_IUnknown
, riid
) || IsEqualGUID(&IID_IHTMLDOMImplementation
, riid
)) {
71 *ppv
= &This
->IHTMLDOMImplementation_iface
;
72 }else if(IsEqualGUID(&IID_IHTMLDOMImplementation2
, riid
)) {
73 *ppv
= &This
->IHTMLDOMImplementation2_iface
;
74 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
75 return *ppv
? S_OK
: E_NOINTERFACE
;
77 WARN("Unsupported interface %s\n", debugstr_mshtml_guid(riid
));
82 IUnknown_AddRef((IUnknown
*)*ppv
);
86 static ULONG WINAPI
HTMLDOMImplementation_AddRef(IHTMLDOMImplementation
*iface
)
88 HTMLDOMImplementation
*This
= impl_from_IHTMLDOMImplementation(iface
);
89 LONG ref
= InterlockedIncrement(&This
->ref
);
91 TRACE("(%p) ref=%d\n", This
, ref
);
96 static ULONG WINAPI
HTMLDOMImplementation_Release(IHTMLDOMImplementation
*iface
)
98 HTMLDOMImplementation
*This
= impl_from_IHTMLDOMImplementation(iface
);
99 LONG ref
= InterlockedDecrement(&This
->ref
);
101 TRACE("(%p) ref=%d\n", This
, ref
);
104 assert(!This
->browser
);
105 if(This
->implementation
)
106 nsIDOMDOMImplementation_Release(This
->implementation
);
107 release_dispex(&This
->dispex
);
114 static HRESULT WINAPI
HTMLDOMImplementation_GetTypeInfoCount(IHTMLDOMImplementation
*iface
, UINT
*pctinfo
)
116 HTMLDOMImplementation
*This
= impl_from_IHTMLDOMImplementation(iface
);
118 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
121 static HRESULT WINAPI
HTMLDOMImplementation_GetTypeInfo(IHTMLDOMImplementation
*iface
, UINT iTInfo
,
122 LCID lcid
, ITypeInfo
**ppTInfo
)
124 HTMLDOMImplementation
*This
= impl_from_IHTMLDOMImplementation(iface
);
126 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
129 static HRESULT WINAPI
HTMLDOMImplementation_GetIDsOfNames(IHTMLDOMImplementation
*iface
, REFIID riid
,
130 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
132 HTMLDOMImplementation
*This
= impl_from_IHTMLDOMImplementation(iface
);
134 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
,
135 cNames
, lcid
, rgDispId
);
138 static HRESULT WINAPI
HTMLDOMImplementation_Invoke(IHTMLDOMImplementation
*iface
, DISPID dispIdMember
,
139 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
,
140 EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
142 HTMLDOMImplementation
*This
= impl_from_IHTMLDOMImplementation(iface
);
144 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
145 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
148 static HRESULT WINAPI
HTMLDOMImplementation_hasFeature(IHTMLDOMImplementation
*iface
, BSTR feature
,
149 VARIANT version
, VARIANT_BOOL
*pfHasFeature
)
151 HTMLDOMImplementation
*This
= impl_from_IHTMLDOMImplementation(iface
);
153 FIXME("(%p)->(%s %s %p) returning false\n", This
, debugstr_w(feature
), debugstr_variant(&version
), pfHasFeature
);
155 *pfHasFeature
= VARIANT_FALSE
;
159 static const IHTMLDOMImplementationVtbl HTMLDOMImplementationVtbl
= {
160 HTMLDOMImplementation_QueryInterface
,
161 HTMLDOMImplementation_AddRef
,
162 HTMLDOMImplementation_Release
,
163 HTMLDOMImplementation_GetTypeInfoCount
,
164 HTMLDOMImplementation_GetTypeInfo
,
165 HTMLDOMImplementation_GetIDsOfNames
,
166 HTMLDOMImplementation_Invoke
,
167 HTMLDOMImplementation_hasFeature
170 static inline HTMLDOMImplementation
*impl_from_IHTMLDOMImplementation2(IHTMLDOMImplementation2
*iface
)
172 return CONTAINING_RECORD(iface
, HTMLDOMImplementation
, IHTMLDOMImplementation2_iface
);
175 static HRESULT WINAPI
HTMLDOMImplementation2_QueryInterface(IHTMLDOMImplementation2
*iface
, REFIID riid
, void **ppv
)
177 HTMLDOMImplementation
*This
= impl_from_IHTMLDOMImplementation2(iface
);
178 return IHTMLDOMImplementation_QueryInterface(&This
->IHTMLDOMImplementation_iface
, riid
, ppv
);
181 static ULONG WINAPI
HTMLDOMImplementation2_AddRef(IHTMLDOMImplementation2
*iface
)
183 HTMLDOMImplementation
*This
= impl_from_IHTMLDOMImplementation2(iface
);
184 return IHTMLDOMImplementation_AddRef(&This
->IHTMLDOMImplementation_iface
);
187 static ULONG WINAPI
HTMLDOMImplementation2_Release(IHTMLDOMImplementation2
*iface
)
189 HTMLDOMImplementation
*This
= impl_from_IHTMLDOMImplementation2(iface
);
190 return IHTMLDOMImplementation_Release(&This
->IHTMLDOMImplementation_iface
);
193 static HRESULT WINAPI
HTMLDOMImplementation2_GetTypeInfoCount(IHTMLDOMImplementation2
*iface
, UINT
*pctinfo
)
195 HTMLDOMImplementation
*This
= impl_from_IHTMLDOMImplementation2(iface
);
196 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
199 static HRESULT WINAPI
HTMLDOMImplementation2_GetTypeInfo(IHTMLDOMImplementation2
*iface
, UINT iTInfo
,
200 LCID lcid
, ITypeInfo
**ppTInfo
)
202 HTMLDOMImplementation
*This
= impl_from_IHTMLDOMImplementation2(iface
);
203 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
206 static HRESULT WINAPI
HTMLDOMImplementation2_GetIDsOfNames(IHTMLDOMImplementation2
*iface
, REFIID riid
,
207 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
209 HTMLDOMImplementation
*This
= impl_from_IHTMLDOMImplementation2(iface
);
210 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
,
211 cNames
, lcid
, rgDispId
);
214 static HRESULT WINAPI
HTMLDOMImplementation2_Invoke(IHTMLDOMImplementation2
*iface
, DISPID dispIdMember
,
215 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
,
216 EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
218 HTMLDOMImplementation
*This
= impl_from_IHTMLDOMImplementation2(iface
);
219 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
220 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
223 static HRESULT WINAPI
HTMLDOMImplementation2_createDocumentType(IHTMLDOMImplementation2
*iface
, BSTR name
,
224 VARIANT
*public_id
, VARIANT
*system_id
, IDOMDocumentType
**new_type
)
226 HTMLDOMImplementation
*This
= impl_from_IHTMLDOMImplementation2(iface
);
227 FIXME("(%p)->(%s %s %s %p)\n", This
, debugstr_w(name
), debugstr_variant(public_id
),
228 debugstr_variant(system_id
), new_type
);
232 static HRESULT WINAPI
HTMLDOMImplementation2_createDocument(IHTMLDOMImplementation2
*iface
, VARIANT
*ns
,
233 VARIANT
*tag_name
, IDOMDocumentType
*document_type
, IHTMLDocument7
**new_document
)
235 HTMLDOMImplementation
*This
= impl_from_IHTMLDOMImplementation2(iface
);
236 FIXME("(%p)->(%s %s %p %p)\n", This
, debugstr_variant(ns
), debugstr_variant(tag_name
),
237 document_type
, new_document
);
241 static HRESULT WINAPI
HTMLDOMImplementation2_createHTMLDocument(IHTMLDOMImplementation2
*iface
, BSTR title
,
242 IHTMLDocument7
**new_document
)
244 HTMLDOMImplementation
*This
= impl_from_IHTMLDOMImplementation2(iface
);
245 HTMLDocumentNode
*new_document_node
;
246 nsIDOMHTMLDocument
*html_doc
;
252 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(title
), new_document
);
257 nsAString_InitDepend(&title_str
, title
);
258 nsres
= nsIDOMDOMImplementation_CreateHTMLDocument(This
->implementation
, &title_str
, &doc
);
259 nsAString_Finish(&title_str
);
260 if(NS_FAILED(nsres
)) {
261 ERR("CreateHTMLDocument failed: %08x\n", nsres
);
265 nsres
= nsIDOMDocument_QueryInterface(doc
, &IID_nsIDOMHTMLDocument
, (void**)&html_doc
);
266 nsIDOMDocument_Release(doc
);
267 assert(nsres
== NS_OK
);
269 hres
= create_document_node(html_doc
, This
->browser
, NULL
, dispex_compat_mode(&This
->dispex
), &new_document_node
);
270 nsIDOMHTMLDocument_Release(html_doc
);
274 *new_document
= &new_document_node
->basedoc
.IHTMLDocument7_iface
;
278 static HRESULT WINAPI
HTMLDOMImplementation2_hasFeature(IHTMLDOMImplementation2
*iface
, BSTR feature
,
279 VARIANT version
, VARIANT_BOOL
*pfHasFeature
)
281 HTMLDOMImplementation
*This
= impl_from_IHTMLDOMImplementation2(iface
);
283 FIXME("(%p)->(%s %s %p) returning false\n", This
, debugstr_w(feature
), debugstr_variant(&version
), pfHasFeature
);
285 *pfHasFeature
= VARIANT_FALSE
;
289 static const IHTMLDOMImplementation2Vtbl HTMLDOMImplementation2Vtbl
= {
290 HTMLDOMImplementation2_QueryInterface
,
291 HTMLDOMImplementation2_AddRef
,
292 HTMLDOMImplementation2_Release
,
293 HTMLDOMImplementation2_GetTypeInfoCount
,
294 HTMLDOMImplementation2_GetTypeInfo
,
295 HTMLDOMImplementation2_GetIDsOfNames
,
296 HTMLDOMImplementation2_Invoke
,
297 HTMLDOMImplementation2_createDocumentType
,
298 HTMLDOMImplementation2_createDocument
,
299 HTMLDOMImplementation2_createHTMLDocument
,
300 HTMLDOMImplementation2_hasFeature
303 static const tid_t HTMLDOMImplementation_iface_tids
[] = {
304 IHTMLDOMImplementation_tid
,
307 static dispex_static_data_t HTMLDOMImplementation_dispex
= {
309 DispHTMLDOMImplementation_tid
,
310 HTMLDOMImplementation_iface_tids
313 HRESULT
create_dom_implementation(HTMLDocumentNode
*doc_node
, IHTMLDOMImplementation
**ret
)
315 HTMLDOMImplementation
*dom_implementation
;
318 if(!doc_node
->browser
)
321 dom_implementation
= heap_alloc_zero(sizeof(*dom_implementation
));
322 if(!dom_implementation
)
323 return E_OUTOFMEMORY
;
325 dom_implementation
->IHTMLDOMImplementation_iface
.lpVtbl
= &HTMLDOMImplementationVtbl
;
326 dom_implementation
->IHTMLDOMImplementation2_iface
.lpVtbl
= &HTMLDOMImplementation2Vtbl
;
327 dom_implementation
->ref
= 1;
328 dom_implementation
->browser
= doc_node
->browser
;
330 init_dispex_with_compat_mode(&dom_implementation
->dispex
, (IUnknown
*)&dom_implementation
->IHTMLDOMImplementation_iface
,
331 &HTMLDOMImplementation_dispex
, doc_node
->document_mode
);
333 nsres
= nsIDOMHTMLDocument_GetImplementation(doc_node
->nsdoc
, &dom_implementation
->implementation
);
334 if(NS_FAILED(nsres
)) {
335 ERR("GetDOMImplementation failed: %08x\n", nsres
);
336 IHTMLDOMImplementation_Release(&dom_implementation
->IHTMLDOMImplementation_iface
);
340 *ret
= &dom_implementation
->IHTMLDOMImplementation_iface
;
344 void detach_dom_implementation(IHTMLDOMImplementation
*iface
)
346 HTMLDOMImplementation
*dom_implementation
= impl_from_IHTMLDOMImplementation(iface
);
347 dom_implementation
->browser
= NULL
;
352 IHTMLScreen IHTMLScreen_iface
;
357 static inline HTMLScreen
*impl_from_IHTMLScreen(IHTMLScreen
*iface
)
359 return CONTAINING_RECORD(iface
, HTMLScreen
, IHTMLScreen_iface
);
362 static HRESULT WINAPI
HTMLScreen_QueryInterface(IHTMLScreen
*iface
, REFIID riid
, void **ppv
)
364 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
366 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
368 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
369 *ppv
= &This
->IHTMLScreen_iface
;
370 }else if(IsEqualGUID(&IID_IHTMLScreen
, riid
)) {
371 *ppv
= &This
->IHTMLScreen_iface
;
372 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
373 return *ppv
? S_OK
: E_NOINTERFACE
;
376 WARN("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
377 return E_NOINTERFACE
;
380 IUnknown_AddRef((IUnknown
*)*ppv
);
384 static ULONG WINAPI
HTMLScreen_AddRef(IHTMLScreen
*iface
)
386 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
387 LONG ref
= InterlockedIncrement(&This
->ref
);
389 TRACE("(%p) ref=%d\n", This
, ref
);
394 static ULONG WINAPI
HTMLScreen_Release(IHTMLScreen
*iface
)
396 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
397 LONG ref
= InterlockedDecrement(&This
->ref
);
399 TRACE("(%p) ref=%d\n", This
, ref
);
402 release_dispex(&This
->dispex
);
409 static HRESULT WINAPI
HTMLScreen_GetTypeInfoCount(IHTMLScreen
*iface
, UINT
*pctinfo
)
411 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
412 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
415 static HRESULT WINAPI
HTMLScreen_GetTypeInfo(IHTMLScreen
*iface
, UINT iTInfo
,
416 LCID lcid
, ITypeInfo
**ppTInfo
)
418 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
419 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
422 static HRESULT WINAPI
HTMLScreen_GetIDsOfNames(IHTMLScreen
*iface
, REFIID riid
,
423 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
425 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
426 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
430 static HRESULT WINAPI
HTMLScreen_Invoke(IHTMLScreen
*iface
, DISPID dispIdMember
,
431 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
432 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
434 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
435 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
,
436 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
439 static HRESULT WINAPI
HTMLScreen_get_colorDepth(IHTMLScreen
*iface
, LONG
*p
)
441 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
444 TRACE("(%p)->(%p)\n", This
, p
);
446 *p
= GetDeviceCaps(hdc
, BITSPIXEL
);
451 static HRESULT WINAPI
HTMLScreen_put_bufferDepth(IHTMLScreen
*iface
, LONG v
)
453 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
454 FIXME("(%p)->(%d)\n", This
, v
);
458 static HRESULT WINAPI
HTMLScreen_get_bufferDepth(IHTMLScreen
*iface
, LONG
*p
)
460 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
461 FIXME("(%p)->(%p)\n", This
, p
);
465 static HRESULT WINAPI
HTMLScreen_get_width(IHTMLScreen
*iface
, LONG
*p
)
467 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
469 TRACE("(%p)->(%p)\n", This
, p
);
471 *p
= GetSystemMetrics(SM_CXSCREEN
);
475 static HRESULT WINAPI
HTMLScreen_get_height(IHTMLScreen
*iface
, LONG
*p
)
477 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
479 TRACE("(%p)->(%p)\n", This
, p
);
481 *p
= GetSystemMetrics(SM_CYSCREEN
);
485 static HRESULT WINAPI
HTMLScreen_put_updateInterval(IHTMLScreen
*iface
, LONG v
)
487 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
488 FIXME("(%p)->(%d)\n", This
, v
);
492 static HRESULT WINAPI
HTMLScreen_get_updateInterval(IHTMLScreen
*iface
, LONG
*p
)
494 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
495 FIXME("(%p)->(%p)\n", This
, p
);
499 static HRESULT WINAPI
HTMLScreen_get_availHeight(IHTMLScreen
*iface
, LONG
*p
)
501 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
504 TRACE("(%p)->(%p)\n", This
, p
);
506 if(!SystemParametersInfoW(SPI_GETWORKAREA
, 0, &work_area
, 0))
509 *p
= work_area
.bottom
-work_area
.top
;
513 static HRESULT WINAPI
HTMLScreen_get_availWidth(IHTMLScreen
*iface
, LONG
*p
)
515 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
518 TRACE("(%p)->(%p)\n", This
, p
);
520 if(!SystemParametersInfoW(SPI_GETWORKAREA
, 0, &work_area
, 0))
523 *p
= work_area
.right
-work_area
.left
;
527 static HRESULT WINAPI
HTMLScreen_get_fontSmoothingEnabled(IHTMLScreen
*iface
, VARIANT_BOOL
*p
)
529 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
530 FIXME("(%p)->(%p)\n", This
, p
);
534 static const IHTMLScreenVtbl HTMLSreenVtbl
= {
535 HTMLScreen_QueryInterface
,
538 HTMLScreen_GetTypeInfoCount
,
539 HTMLScreen_GetTypeInfo
,
540 HTMLScreen_GetIDsOfNames
,
542 HTMLScreen_get_colorDepth
,
543 HTMLScreen_put_bufferDepth
,
544 HTMLScreen_get_bufferDepth
,
545 HTMLScreen_get_width
,
546 HTMLScreen_get_height
,
547 HTMLScreen_put_updateInterval
,
548 HTMLScreen_get_updateInterval
,
549 HTMLScreen_get_availHeight
,
550 HTMLScreen_get_availWidth
,
551 HTMLScreen_get_fontSmoothingEnabled
554 static const tid_t HTMLScreen_iface_tids
[] = {
558 static dispex_static_data_t HTMLScreen_dispex
= {
561 HTMLScreen_iface_tids
564 HRESULT
HTMLScreen_Create(IHTMLScreen
**ret
)
568 screen
= heap_alloc_zero(sizeof(HTMLScreen
));
570 return E_OUTOFMEMORY
;
572 screen
->IHTMLScreen_iface
.lpVtbl
= &HTMLSreenVtbl
;
575 init_dispex(&screen
->dispex
, (IUnknown
*)&screen
->IHTMLScreen_iface
, &HTMLScreen_dispex
);
577 *ret
= &screen
->IHTMLScreen_iface
;
581 static inline OmHistory
*impl_from_IOmHistory(IOmHistory
*iface
)
583 return CONTAINING_RECORD(iface
, OmHistory
, IOmHistory_iface
);
586 static HRESULT WINAPI
OmHistory_QueryInterface(IOmHistory
*iface
, REFIID riid
, void **ppv
)
588 OmHistory
*This
= impl_from_IOmHistory(iface
);
590 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
592 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
593 *ppv
= &This
->IOmHistory_iface
;
594 }else if(IsEqualGUID(&IID_IOmHistory
, riid
)) {
595 *ppv
= &This
->IOmHistory_iface
;
596 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
597 return *ppv
? S_OK
: E_NOINTERFACE
;
599 WARN("Unsupported interface %s\n", debugstr_mshtml_guid(riid
));
601 return E_NOINTERFACE
;
604 IUnknown_AddRef((IUnknown
*)*ppv
);
608 static ULONG WINAPI
OmHistory_AddRef(IOmHistory
*iface
)
610 OmHistory
*This
= impl_from_IOmHistory(iface
);
611 LONG ref
= InterlockedIncrement(&This
->ref
);
613 TRACE("(%p) ref=%d\n", This
, ref
);
618 static ULONG WINAPI
OmHistory_Release(IOmHistory
*iface
)
620 OmHistory
*This
= impl_from_IOmHistory(iface
);
621 LONG ref
= InterlockedDecrement(&This
->ref
);
623 TRACE("(%p) ref=%d\n", This
, ref
);
626 release_dispex(&This
->dispex
);
633 static HRESULT WINAPI
OmHistory_GetTypeInfoCount(IOmHistory
*iface
, UINT
*pctinfo
)
635 OmHistory
*This
= impl_from_IOmHistory(iface
);
636 FIXME("(%p)->(%p)\n", This
, pctinfo
);
640 static HRESULT WINAPI
OmHistory_GetTypeInfo(IOmHistory
*iface
, UINT iTInfo
,
641 LCID lcid
, ITypeInfo
**ppTInfo
)
643 OmHistory
*This
= impl_from_IOmHistory(iface
);
645 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
648 static HRESULT WINAPI
OmHistory_GetIDsOfNames(IOmHistory
*iface
, REFIID riid
, LPOLESTR
*rgszNames
, UINT cNames
,
649 LCID lcid
, DISPID
*rgDispId
)
651 OmHistory
*This
= impl_from_IOmHistory(iface
);
653 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
657 static HRESULT WINAPI
OmHistory_Invoke(IOmHistory
*iface
, DISPID dispIdMember
, REFIID riid
, LCID lcid
,
658 WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
660 OmHistory
*This
= impl_from_IOmHistory(iface
);
662 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
,
663 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
666 static HRESULT WINAPI
OmHistory_get_length(IOmHistory
*iface
, short *p
)
668 OmHistory
*This
= impl_from_IOmHistory(iface
);
669 GeckoBrowser
*browser
= NULL
;
671 TRACE("(%p)->(%p)\n", This
, p
);
673 if(This
->window
&& This
->window
->base
.outer_window
)
674 browser
= This
->window
->base
.outer_window
->browser
;
676 *p
= browser
->doc
->travel_log
677 ? ITravelLog_CountEntries(browser
->doc
->travel_log
, browser
->doc
->browser_service
)
682 static HRESULT WINAPI
OmHistory_back(IOmHistory
*iface
, VARIANT
*pvargdistance
)
684 OmHistory
*This
= impl_from_IOmHistory(iface
);
685 FIXME("(%p)->(%s)\n", This
, debugstr_variant(pvargdistance
));
689 static HRESULT WINAPI
OmHistory_forward(IOmHistory
*iface
, VARIANT
*pvargdistance
)
691 OmHistory
*This
= impl_from_IOmHistory(iface
);
692 FIXME("(%p)->(%s)\n", This
, debugstr_variant(pvargdistance
));
696 static HRESULT WINAPI
OmHistory_go(IOmHistory
*iface
, VARIANT
*pvargdistance
)
698 OmHistory
*This
= impl_from_IOmHistory(iface
);
699 FIXME("(%p)->(%s)\n", This
, debugstr_variant(pvargdistance
));
703 static const IOmHistoryVtbl OmHistoryVtbl
= {
704 OmHistory_QueryInterface
,
707 OmHistory_GetTypeInfoCount
,
708 OmHistory_GetTypeInfo
,
709 OmHistory_GetIDsOfNames
,
711 OmHistory_get_length
,
717 static const tid_t OmHistory_iface_tids
[] = {
721 static dispex_static_data_t OmHistory_dispex
= {
728 HRESULT
create_history(HTMLInnerWindow
*window
, OmHistory
**ret
)
732 history
= heap_alloc_zero(sizeof(*history
));
734 return E_OUTOFMEMORY
;
736 init_dispex(&history
->dispex
, (IUnknown
*)&history
->IOmHistory_iface
, &OmHistory_dispex
);
737 history
->IOmHistory_iface
.lpVtbl
= &OmHistoryVtbl
;
740 history
->window
= window
;
746 struct HTMLPluginsCollection
{
748 IHTMLPluginsCollection IHTMLPluginsCollection_iface
;
752 OmNavigator
*navigator
;
755 static inline HTMLPluginsCollection
*impl_from_IHTMLPluginsCollection(IHTMLPluginsCollection
*iface
)
757 return CONTAINING_RECORD(iface
, HTMLPluginsCollection
, IHTMLPluginsCollection_iface
);
760 static HRESULT WINAPI
HTMLPluginsCollection_QueryInterface(IHTMLPluginsCollection
*iface
, REFIID riid
, void **ppv
)
762 HTMLPluginsCollection
*This
= impl_from_IHTMLPluginsCollection(iface
);
764 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
766 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
767 *ppv
= &This
->IHTMLPluginsCollection_iface
;
768 }else if(IsEqualGUID(&IID_IHTMLPluginsCollection
, riid
)) {
769 *ppv
= &This
->IHTMLPluginsCollection_iface
;
770 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
771 return *ppv
? S_OK
: E_NOINTERFACE
;
774 WARN("Unsupported interface %s\n", debugstr_mshtml_guid(riid
));
775 return E_NOINTERFACE
;
778 IUnknown_AddRef((IUnknown
*)*ppv
);
782 static ULONG WINAPI
HTMLPluginsCollection_AddRef(IHTMLPluginsCollection
*iface
)
784 HTMLPluginsCollection
*This
= impl_from_IHTMLPluginsCollection(iface
);
785 LONG ref
= InterlockedIncrement(&This
->ref
);
787 TRACE("(%p) ref=%d\n", This
, ref
);
792 static ULONG WINAPI
HTMLPluginsCollection_Release(IHTMLPluginsCollection
*iface
)
794 HTMLPluginsCollection
*This
= impl_from_IHTMLPluginsCollection(iface
);
795 LONG ref
= InterlockedDecrement(&This
->ref
);
797 TRACE("(%p) ref=%d\n", This
, ref
);
801 This
->navigator
->plugins
= NULL
;
802 release_dispex(&This
->dispex
);
809 static HRESULT WINAPI
HTMLPluginsCollection_GetTypeInfoCount(IHTMLPluginsCollection
*iface
, UINT
*pctinfo
)
811 HTMLPluginsCollection
*This
= impl_from_IHTMLPluginsCollection(iface
);
812 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
815 static HRESULT WINAPI
HTMLPluginsCollection_GetTypeInfo(IHTMLPluginsCollection
*iface
, UINT iTInfo
,
816 LCID lcid
, ITypeInfo
**ppTInfo
)
818 HTMLPluginsCollection
*This
= impl_from_IHTMLPluginsCollection(iface
);
819 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
822 static HRESULT WINAPI
HTMLPluginsCollection_GetIDsOfNames(IHTMLPluginsCollection
*iface
, REFIID riid
,
823 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
825 HTMLPluginsCollection
*This
= impl_from_IHTMLPluginsCollection(iface
);
826 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
830 static HRESULT WINAPI
HTMLPluginsCollection_Invoke(IHTMLPluginsCollection
*iface
, DISPID dispIdMember
,
831 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
,
832 EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
834 HTMLPluginsCollection
*This
= impl_from_IHTMLPluginsCollection(iface
);
835 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
836 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
839 static HRESULT WINAPI
HTMLPluginsCollection_get_length(IHTMLPluginsCollection
*iface
, LONG
*p
)
841 HTMLPluginsCollection
*This
= impl_from_IHTMLPluginsCollection(iface
);
843 TRACE("(%p)->(%p)\n", This
, p
);
845 /* IE always returns 0 here */
850 static HRESULT WINAPI
HTMLPluginsCollection_refresh(IHTMLPluginsCollection
*iface
, VARIANT_BOOL reload
)
852 HTMLPluginsCollection
*This
= impl_from_IHTMLPluginsCollection(iface
);
854 TRACE("(%p)->(%x)\n", This
, reload
);
856 /* Nothing to do here. */
860 static const IHTMLPluginsCollectionVtbl HTMLPluginsCollectionVtbl
= {
861 HTMLPluginsCollection_QueryInterface
,
862 HTMLPluginsCollection_AddRef
,
863 HTMLPluginsCollection_Release
,
864 HTMLPluginsCollection_GetTypeInfoCount
,
865 HTMLPluginsCollection_GetTypeInfo
,
866 HTMLPluginsCollection_GetIDsOfNames
,
867 HTMLPluginsCollection_Invoke
,
868 HTMLPluginsCollection_get_length
,
869 HTMLPluginsCollection_refresh
872 static const tid_t HTMLPluginsCollection_iface_tids
[] = {
873 IHTMLPluginsCollection_tid
,
876 static dispex_static_data_t HTMLPluginsCollection_dispex
= {
879 HTMLPluginsCollection_iface_tids
882 static HRESULT
create_plugins_collection(OmNavigator
*navigator
, HTMLPluginsCollection
**ret
)
884 HTMLPluginsCollection
*col
;
886 col
= heap_alloc_zero(sizeof(*col
));
888 return E_OUTOFMEMORY
;
890 col
->IHTMLPluginsCollection_iface
.lpVtbl
= &HTMLPluginsCollectionVtbl
;
892 col
->navigator
= navigator
;
894 init_dispex(&col
->dispex
, (IUnknown
*)&col
->IHTMLPluginsCollection_iface
,
895 &HTMLPluginsCollection_dispex
);
901 struct HTMLMimeTypesCollection
{
903 IHTMLMimeTypesCollection IHTMLMimeTypesCollection_iface
;
907 OmNavigator
*navigator
;
910 static inline HTMLMimeTypesCollection
*impl_from_IHTMLMimeTypesCollection(IHTMLMimeTypesCollection
*iface
)
912 return CONTAINING_RECORD(iface
, HTMLMimeTypesCollection
, IHTMLMimeTypesCollection_iface
);
915 static HRESULT WINAPI
HTMLMimeTypesCollection_QueryInterface(IHTMLMimeTypesCollection
*iface
, REFIID riid
, void **ppv
)
917 HTMLMimeTypesCollection
*This
= impl_from_IHTMLMimeTypesCollection(iface
);
919 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
921 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
922 *ppv
= &This
->IHTMLMimeTypesCollection_iface
;
923 }else if(IsEqualGUID(&IID_IHTMLMimeTypesCollection
, riid
)) {
924 *ppv
= &This
->IHTMLMimeTypesCollection_iface
;
925 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
926 return *ppv
? S_OK
: E_NOINTERFACE
;
928 WARN("Unsupported interface %s\n", debugstr_mshtml_guid(riid
));
930 return E_NOINTERFACE
;
933 IUnknown_AddRef((IUnknown
*)*ppv
);
937 static ULONG WINAPI
HTMLMimeTypesCollection_AddRef(IHTMLMimeTypesCollection
*iface
)
939 HTMLMimeTypesCollection
*This
= impl_from_IHTMLMimeTypesCollection(iface
);
940 LONG ref
= InterlockedIncrement(&This
->ref
);
942 TRACE("(%p) ref=%d\n", This
, ref
);
947 static ULONG WINAPI
HTMLMimeTypesCollection_Release(IHTMLMimeTypesCollection
*iface
)
949 HTMLMimeTypesCollection
*This
= impl_from_IHTMLMimeTypesCollection(iface
);
950 LONG ref
= InterlockedDecrement(&This
->ref
);
952 TRACE("(%p) ref=%d\n", This
, ref
);
956 This
->navigator
->mime_types
= NULL
;
957 release_dispex(&This
->dispex
);
964 static HRESULT WINAPI
HTMLMimeTypesCollection_GetTypeInfoCount(IHTMLMimeTypesCollection
*iface
, UINT
*pctinfo
)
966 HTMLMimeTypesCollection
*This
= impl_from_IHTMLMimeTypesCollection(iface
);
967 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
970 static HRESULT WINAPI
HTMLMimeTypesCollection_GetTypeInfo(IHTMLMimeTypesCollection
*iface
, UINT iTInfo
,
971 LCID lcid
, ITypeInfo
**ppTInfo
)
973 HTMLMimeTypesCollection
*This
= impl_from_IHTMLMimeTypesCollection(iface
);
974 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
977 static HRESULT WINAPI
HTMLMimeTypesCollection_GetIDsOfNames(IHTMLMimeTypesCollection
*iface
, REFIID riid
,
978 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
980 HTMLMimeTypesCollection
*This
= impl_from_IHTMLMimeTypesCollection(iface
);
981 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
985 static HRESULT WINAPI
HTMLMimeTypesCollection_Invoke(IHTMLMimeTypesCollection
*iface
, DISPID dispIdMember
,
986 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
,
987 EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
989 HTMLMimeTypesCollection
*This
= impl_from_IHTMLMimeTypesCollection(iface
);
990 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
991 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
994 static HRESULT WINAPI
HTMLMimeTypesCollection_get_length(IHTMLMimeTypesCollection
*iface
, LONG
*p
)
996 HTMLMimeTypesCollection
*This
= impl_from_IHTMLMimeTypesCollection(iface
);
998 TRACE("(%p)->(%p)\n", This
, p
);
1000 /* This is just a stub for compatibility with other browser in IE */
1005 static const IHTMLMimeTypesCollectionVtbl HTMLMimeTypesCollectionVtbl
= {
1006 HTMLMimeTypesCollection_QueryInterface
,
1007 HTMLMimeTypesCollection_AddRef
,
1008 HTMLMimeTypesCollection_Release
,
1009 HTMLMimeTypesCollection_GetTypeInfoCount
,
1010 HTMLMimeTypesCollection_GetTypeInfo
,
1011 HTMLMimeTypesCollection_GetIDsOfNames
,
1012 HTMLMimeTypesCollection_Invoke
,
1013 HTMLMimeTypesCollection_get_length
1016 static const tid_t HTMLMimeTypesCollection_iface_tids
[] = {
1017 IHTMLMimeTypesCollection_tid
,
1020 static dispex_static_data_t HTMLMimeTypesCollection_dispex
= {
1022 IHTMLMimeTypesCollection_tid
,
1023 HTMLMimeTypesCollection_iface_tids
1026 static HRESULT
create_mime_types_collection(OmNavigator
*navigator
, HTMLMimeTypesCollection
**ret
)
1028 HTMLMimeTypesCollection
*col
;
1030 col
= heap_alloc_zero(sizeof(*col
));
1032 return E_OUTOFMEMORY
;
1034 col
->IHTMLMimeTypesCollection_iface
.lpVtbl
= &HTMLMimeTypesCollectionVtbl
;
1036 col
->navigator
= navigator
;
1038 init_dispex(&col
->dispex
, (IUnknown
*)&col
->IHTMLMimeTypesCollection_iface
,
1039 &HTMLMimeTypesCollection_dispex
);
1045 static inline OmNavigator
*impl_from_IOmNavigator(IOmNavigator
*iface
)
1047 return CONTAINING_RECORD(iface
, OmNavigator
, IOmNavigator_iface
);
1050 static HRESULT WINAPI
OmNavigator_QueryInterface(IOmNavigator
*iface
, REFIID riid
, void **ppv
)
1052 OmNavigator
*This
= impl_from_IOmNavigator(iface
);
1054 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
1056 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
1057 *ppv
= &This
->IOmNavigator_iface
;
1058 }else if(IsEqualGUID(&IID_IOmNavigator
, riid
)) {
1059 *ppv
= &This
->IOmNavigator_iface
;
1060 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
1061 return *ppv
? S_OK
: E_NOINTERFACE
;
1063 WARN("Unsupported interface %s\n", debugstr_mshtml_guid(riid
));
1065 return E_NOINTERFACE
;
1068 IUnknown_AddRef((IUnknown
*)*ppv
);
1072 static ULONG WINAPI
OmNavigator_AddRef(IOmNavigator
*iface
)
1074 OmNavigator
*This
= impl_from_IOmNavigator(iface
);
1075 LONG ref
= InterlockedIncrement(&This
->ref
);
1077 TRACE("(%p) ref=%d\n", This
, ref
);
1082 static ULONG WINAPI
OmNavigator_Release(IOmNavigator
*iface
)
1084 OmNavigator
*This
= impl_from_IOmNavigator(iface
);
1085 LONG ref
= InterlockedDecrement(&This
->ref
);
1087 TRACE("(%p) ref=%d\n", This
, ref
);
1091 This
->plugins
->navigator
= NULL
;
1092 if(This
->mime_types
)
1093 This
->mime_types
->navigator
= NULL
;
1094 release_dispex(&This
->dispex
);
1101 static HRESULT WINAPI
OmNavigator_GetTypeInfoCount(IOmNavigator
*iface
, UINT
*pctinfo
)
1103 OmNavigator
*This
= impl_from_IOmNavigator(iface
);
1104 FIXME("(%p)->(%p)\n", This
, pctinfo
);
1108 static HRESULT WINAPI
OmNavigator_GetTypeInfo(IOmNavigator
*iface
, UINT iTInfo
,
1109 LCID lcid
, ITypeInfo
**ppTInfo
)
1111 OmNavigator
*This
= impl_from_IOmNavigator(iface
);
1113 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
1116 static HRESULT WINAPI
OmNavigator_GetIDsOfNames(IOmNavigator
*iface
, REFIID riid
,
1117 LPOLESTR
*rgszNames
, UINT cNames
,
1118 LCID lcid
, DISPID
*rgDispId
)
1120 OmNavigator
*This
= impl_from_IOmNavigator(iface
);
1122 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
1126 static HRESULT WINAPI
OmNavigator_Invoke(IOmNavigator
*iface
, DISPID dispIdMember
,
1127 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
1128 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
1130 OmNavigator
*This
= impl_from_IOmNavigator(iface
);
1132 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
,
1133 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
1136 static HRESULT WINAPI
OmNavigator_get_appCodeName(IOmNavigator
*iface
, BSTR
*p
)
1138 OmNavigator
*This
= impl_from_IOmNavigator(iface
);
1140 static const WCHAR mozillaW
[] = {'M','o','z','i','l','l','a',0};
1142 TRACE("(%p)->(%p)\n", This
, p
);
1144 *p
= SysAllocString(mozillaW
);
1148 static HRESULT WINAPI
OmNavigator_get_appName(IOmNavigator
*iface
, BSTR
*p
)
1150 OmNavigator
*This
= impl_from_IOmNavigator(iface
);
1152 static const WCHAR app_nameW
[] =
1153 {'M','i','c','r','o','s','o','f','t',' ',
1154 'I','n','t','e','r','n','e','t',' ',
1155 'E','x','p','l','o','r','e','r',0};
1157 TRACE("(%p)->(%p)\n", This
, p
);
1159 *p
= SysAllocString(app_nameW
);
1161 return E_OUTOFMEMORY
;
1166 static HRESULT WINAPI
OmNavigator_get_appVersion(IOmNavigator
*iface
, BSTR
*p
)
1168 OmNavigator
*This
= impl_from_IOmNavigator(iface
);
1170 char user_agent
[512];
1173 const unsigned skip_prefix
= 8; /* strlen("Mozilla/") */
1175 TRACE("(%p)->(%p)\n", This
, p
);
1177 size
= sizeof(user_agent
);
1178 hres
= ObtainUserAgentString(0, user_agent
, &size
);
1182 if(size
<= skip_prefix
) {
1187 size
= MultiByteToWideChar(CP_ACP
, 0, user_agent
+ skip_prefix
, -1, NULL
, 0);
1188 *p
= SysAllocStringLen(NULL
, size
-1);
1190 return E_OUTOFMEMORY
;
1192 MultiByteToWideChar(CP_ACP
, 0, user_agent
+ skip_prefix
, -1, *p
, size
);
1196 static HRESULT WINAPI
OmNavigator_get_userAgent(IOmNavigator
*iface
, BSTR
*p
)
1198 OmNavigator
*This
= impl_from_IOmNavigator(iface
);
1199 char user_agent
[512];
1203 TRACE("(%p)->(%p)\n", This
, p
);
1205 size
= sizeof(user_agent
);
1206 hres
= ObtainUserAgentString(0, user_agent
, &size
);
1210 size
= MultiByteToWideChar(CP_ACP
, 0, user_agent
, -1, NULL
, 0);
1211 *p
= SysAllocStringLen(NULL
, size
-1);
1213 return E_OUTOFMEMORY
;
1215 MultiByteToWideChar(CP_ACP
, 0, user_agent
, -1, *p
, size
);
1219 static HRESULT WINAPI
OmNavigator_javaEnabled(IOmNavigator
*iface
, VARIANT_BOOL
*enabled
)
1221 OmNavigator
*This
= impl_from_IOmNavigator(iface
);
1223 FIXME("(%p)->(%p) semi-stub\n", This
, enabled
);
1225 *enabled
= VARIANT_TRUE
;
1229 static HRESULT WINAPI
OmNavigator_taintEnabled(IOmNavigator
*iface
, VARIANT_BOOL
*enabled
)
1231 OmNavigator
*This
= impl_from_IOmNavigator(iface
);
1232 FIXME("(%p)->(%p)\n", This
, enabled
);
1236 static HRESULT WINAPI
OmNavigator_get_mimeTypes(IOmNavigator
*iface
, IHTMLMimeTypesCollection
**p
)
1238 OmNavigator
*This
= impl_from_IOmNavigator(iface
);
1240 TRACE("(%p)->(%p)\n", This
, p
);
1242 if(!This
->mime_types
) {
1245 hres
= create_mime_types_collection(This
, &This
->mime_types
);
1249 IHTMLMimeTypesCollection_AddRef(&This
->mime_types
->IHTMLMimeTypesCollection_iface
);
1252 *p
= &This
->mime_types
->IHTMLMimeTypesCollection_iface
;
1256 static HRESULT WINAPI
OmNavigator_get_plugins(IOmNavigator
*iface
, IHTMLPluginsCollection
**p
)
1258 OmNavigator
*This
= impl_from_IOmNavigator(iface
);
1260 TRACE("(%p)->(%p)\n", This
, p
);
1262 if(!This
->plugins
) {
1265 hres
= create_plugins_collection(This
, &This
->plugins
);
1269 IHTMLPluginsCollection_AddRef(&This
->plugins
->IHTMLPluginsCollection_iface
);
1272 *p
= &This
->plugins
->IHTMLPluginsCollection_iface
;
1276 static HRESULT WINAPI
OmNavigator_get_cookieEnabled(IOmNavigator
*iface
, VARIANT_BOOL
*p
)
1278 OmNavigator
*This
= impl_from_IOmNavigator(iface
);
1280 WARN("(%p)->(%p) semi-stub\n", This
, p
);
1286 static HRESULT WINAPI
OmNavigator_get_opsProfile(IOmNavigator
*iface
, IHTMLOpsProfile
**p
)
1288 OmNavigator
*This
= impl_from_IOmNavigator(iface
);
1289 FIXME("(%p)->(%p)\n", This
, p
);
1293 static HRESULT WINAPI
OmNavigator_toString(IOmNavigator
*iface
, BSTR
*String
)
1295 OmNavigator
*This
= impl_from_IOmNavigator(iface
);
1297 static const WCHAR objectW
[] = {'[','o','b','j','e','c','t',']',0};
1299 TRACE("(%p)->(%p)\n", This
, String
);
1302 return E_INVALIDARG
;
1304 *String
= SysAllocString(objectW
);
1305 return *String
? S_OK
: E_OUTOFMEMORY
;
1308 static HRESULT WINAPI
OmNavigator_get_cpuClass(IOmNavigator
*iface
, BSTR
*p
)
1310 OmNavigator
*This
= impl_from_IOmNavigator(iface
);
1312 static const WCHAR cpu_classW
[] =
1319 TRACE("(%p)->(%p)\n", This
, p
);
1321 *p
= SysAllocString(cpu_classW
);
1322 return *p
? S_OK
: E_OUTOFMEMORY
;
1325 static HRESULT
get_language_string(LCID lcid
, BSTR
*p
)
1330 len
= LCIDToLocaleName(lcid
, NULL
, 0, 0);
1332 WARN("LCIDToLocaleName failed: %u\n", GetLastError());
1336 ret
= SysAllocStringLen(NULL
, len
-1);
1338 return E_OUTOFMEMORY
;
1340 len
= LCIDToLocaleName(lcid
, ret
, len
, 0);
1342 WARN("LCIDToLocaleName failed: %u\n", GetLastError());
1351 static HRESULT WINAPI
OmNavigator_get_systemLanguage(IOmNavigator
*iface
, BSTR
*p
)
1353 OmNavigator
*This
= impl_from_IOmNavigator(iface
);
1355 TRACE("(%p)->(%p)\n", This
, p
);
1357 return get_language_string(LOCALE_SYSTEM_DEFAULT
, p
);
1360 static HRESULT WINAPI
OmNavigator_get_browserLanguage(IOmNavigator
*iface
, BSTR
*p
)
1362 OmNavigator
*This
= impl_from_IOmNavigator(iface
);
1364 TRACE("(%p)->(%p)\n", This
, p
);
1366 return get_language_string(GetUserDefaultUILanguage(), p
);
1369 static HRESULT WINAPI
OmNavigator_get_userLanguage(IOmNavigator
*iface
, BSTR
*p
)
1371 OmNavigator
*This
= impl_from_IOmNavigator(iface
);
1373 TRACE("(%p)->(%p)\n", This
, p
);
1375 return get_language_string(LOCALE_USER_DEFAULT
, p
);
1378 static HRESULT WINAPI
OmNavigator_get_platform(IOmNavigator
*iface
, BSTR
*p
)
1380 OmNavigator
*This
= impl_from_IOmNavigator(iface
);
1383 static const WCHAR platformW
[] = {'W','i','n','6','4',0};
1385 static const WCHAR platformW
[] = {'W','i','n','3','2',0};
1388 TRACE("(%p)->(%p)\n", This
, p
);
1390 *p
= SysAllocString(platformW
);
1394 static HRESULT WINAPI
OmNavigator_get_appMinorVersion(IOmNavigator
*iface
, BSTR
*p
)
1396 OmNavigator
*This
= impl_from_IOmNavigator(iface
);
1398 static const WCHAR zeroW
[] = {'0',0};
1400 TRACE("(%p)->(%p)\n", This
, p
);
1402 /* NOTE: MSIE returns "0" or values like ";SP2;". Returning "0" should be enough. */
1403 *p
= SysAllocString(zeroW
);
1407 static HRESULT WINAPI
OmNavigator_get_connectionSpeed(IOmNavigator
*iface
, LONG
*p
)
1409 OmNavigator
*This
= impl_from_IOmNavigator(iface
);
1410 FIXME("(%p)->(%p)\n", This
, p
);
1414 static HRESULT WINAPI
OmNavigator_get_onLine(IOmNavigator
*iface
, VARIANT_BOOL
*p
)
1416 OmNavigator
*This
= impl_from_IOmNavigator(iface
);
1418 WARN("(%p)->(%p) semi-stub, returning true\n", This
, p
);
1424 static HRESULT WINAPI
OmNavigator_get_userProfile(IOmNavigator
*iface
, IHTMLOpsProfile
**p
)
1426 OmNavigator
*This
= impl_from_IOmNavigator(iface
);
1427 FIXME("(%p)->(%p)\n", This
, p
);
1431 static const IOmNavigatorVtbl OmNavigatorVtbl
= {
1432 OmNavigator_QueryInterface
,
1434 OmNavigator_Release
,
1435 OmNavigator_GetTypeInfoCount
,
1436 OmNavigator_GetTypeInfo
,
1437 OmNavigator_GetIDsOfNames
,
1439 OmNavigator_get_appCodeName
,
1440 OmNavigator_get_appName
,
1441 OmNavigator_get_appVersion
,
1442 OmNavigator_get_userAgent
,
1443 OmNavigator_javaEnabled
,
1444 OmNavigator_taintEnabled
,
1445 OmNavigator_get_mimeTypes
,
1446 OmNavigator_get_plugins
,
1447 OmNavigator_get_cookieEnabled
,
1448 OmNavigator_get_opsProfile
,
1449 OmNavigator_toString
,
1450 OmNavigator_get_cpuClass
,
1451 OmNavigator_get_systemLanguage
,
1452 OmNavigator_get_browserLanguage
,
1453 OmNavigator_get_userLanguage
,
1454 OmNavigator_get_platform
,
1455 OmNavigator_get_appMinorVersion
,
1456 OmNavigator_get_connectionSpeed
,
1457 OmNavigator_get_onLine
,
1458 OmNavigator_get_userProfile
1461 static const tid_t OmNavigator_iface_tids
[] = {
1465 static dispex_static_data_t OmNavigator_dispex
= {
1467 DispHTMLNavigator_tid
,
1468 OmNavigator_iface_tids
1471 IOmNavigator
*OmNavigator_Create(void)
1475 ret
= heap_alloc_zero(sizeof(*ret
));
1479 ret
->IOmNavigator_iface
.lpVtbl
= &OmNavigatorVtbl
;
1482 init_dispex(&ret
->dispex
, (IUnknown
*)&ret
->IOmNavigator_iface
, &OmNavigator_dispex
);
1484 return &ret
->IOmNavigator_iface
;
1489 IHTMLPerformanceTiming IHTMLPerformanceTiming_iface
;
1492 } HTMLPerformanceTiming
;
1494 static inline HTMLPerformanceTiming
*impl_from_IHTMLPerformanceTiming(IHTMLPerformanceTiming
*iface
)
1496 return CONTAINING_RECORD(iface
, HTMLPerformanceTiming
, IHTMLPerformanceTiming_iface
);
1499 static HRESULT WINAPI
HTMLPerformanceTiming_QueryInterface(IHTMLPerformanceTiming
*iface
, REFIID riid
, void **ppv
)
1501 HTMLPerformanceTiming
*This
= impl_from_IHTMLPerformanceTiming(iface
);
1503 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
1505 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
1506 *ppv
= &This
->IHTMLPerformanceTiming_iface
;
1507 }else if(IsEqualGUID(&IID_IHTMLPerformanceTiming
, riid
)) {
1508 *ppv
= &This
->IHTMLPerformanceTiming_iface
;
1509 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
1510 return *ppv
? S_OK
: E_NOINTERFACE
;
1512 WARN("Unsupported interface %s\n", debugstr_mshtml_guid(riid
));
1514 return E_NOINTERFACE
;
1517 IUnknown_AddRef((IUnknown
*)*ppv
);
1521 static ULONG WINAPI
HTMLPerformanceTiming_AddRef(IHTMLPerformanceTiming
*iface
)
1523 HTMLPerformanceTiming
*This
= impl_from_IHTMLPerformanceTiming(iface
);
1524 LONG ref
= InterlockedIncrement(&This
->ref
);
1526 TRACE("(%p) ref=%d\n", This
, ref
);
1531 static ULONG WINAPI
HTMLPerformanceTiming_Release(IHTMLPerformanceTiming
*iface
)
1533 HTMLPerformanceTiming
*This
= impl_from_IHTMLPerformanceTiming(iface
);
1534 LONG ref
= InterlockedDecrement(&This
->ref
);
1536 TRACE("(%p) ref=%d\n", This
, ref
);
1539 release_dispex(&This
->dispex
);
1546 static HRESULT WINAPI
HTMLPerformanceTiming_GetTypeInfoCount(IHTMLPerformanceTiming
*iface
, UINT
*pctinfo
)
1548 HTMLPerformanceTiming
*This
= impl_from_IHTMLPerformanceTiming(iface
);
1549 FIXME("(%p)->(%p)\n", This
, pctinfo
);
1553 static HRESULT WINAPI
HTMLPerformanceTiming_GetTypeInfo(IHTMLPerformanceTiming
*iface
, UINT iTInfo
,
1554 LCID lcid
, ITypeInfo
**ppTInfo
)
1556 HTMLPerformanceTiming
*This
= impl_from_IHTMLPerformanceTiming(iface
);
1558 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
1561 static HRESULT WINAPI
HTMLPerformanceTiming_GetIDsOfNames(IHTMLPerformanceTiming
*iface
, REFIID riid
,
1562 LPOLESTR
*rgszNames
, UINT cNames
,
1563 LCID lcid
, DISPID
*rgDispId
)
1565 HTMLPerformanceTiming
*This
= impl_from_IHTMLPerformanceTiming(iface
);
1567 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
1571 static HRESULT WINAPI
HTMLPerformanceTiming_Invoke(IHTMLPerformanceTiming
*iface
, DISPID dispIdMember
,
1572 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
1573 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
1575 HTMLPerformanceTiming
*This
= impl_from_IHTMLPerformanceTiming(iface
);
1577 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
,
1578 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
1581 #define TIMING_FAKE_TIMESTAMP 0xdeadbeef
1583 static HRESULT WINAPI
HTMLPerformanceTiming_get_navigationStart(IHTMLPerformanceTiming
*iface
, ULONGLONG
*p
)
1585 HTMLPerformanceTiming
*This
= impl_from_IHTMLPerformanceTiming(iface
);
1587 FIXME("(%p)->(%p) returning fake value\n", This
, p
);
1589 *p
= TIMING_FAKE_TIMESTAMP
;
1593 static HRESULT WINAPI
HTMLPerformanceTiming_get_unloadEventStart(IHTMLPerformanceTiming
*iface
, ULONGLONG
*p
)
1595 HTMLPerformanceTiming
*This
= impl_from_IHTMLPerformanceTiming(iface
);
1597 FIXME("(%p)->(%p) returning fake value\n", This
, p
);
1599 *p
= TIMING_FAKE_TIMESTAMP
;
1603 static HRESULT WINAPI
HTMLPerformanceTiming_get_unloadEventEnd(IHTMLPerformanceTiming
*iface
, ULONGLONG
*p
)
1605 HTMLPerformanceTiming
*This
= impl_from_IHTMLPerformanceTiming(iface
);
1607 FIXME("(%p)->(%p) returning fake value\n", This
, p
);
1609 *p
= TIMING_FAKE_TIMESTAMP
;
1613 static HRESULT WINAPI
HTMLPerformanceTiming_get_redirectStart(IHTMLPerformanceTiming
*iface
, ULONGLONG
*p
)
1615 HTMLPerformanceTiming
*This
= impl_from_IHTMLPerformanceTiming(iface
);
1617 FIXME("(%p)->(%p) returning fake value\n", This
, p
);
1619 *p
= TIMING_FAKE_TIMESTAMP
;
1623 static HRESULT WINAPI
HTMLPerformanceTiming_get_redirectEnd(IHTMLPerformanceTiming
*iface
, ULONGLONG
*p
)
1625 HTMLPerformanceTiming
*This
= impl_from_IHTMLPerformanceTiming(iface
);
1627 FIXME("(%p)->(%p) returning fake value\n", This
, p
);
1629 *p
= TIMING_FAKE_TIMESTAMP
;
1633 static HRESULT WINAPI
HTMLPerformanceTiming_get_fetchStart(IHTMLPerformanceTiming
*iface
, ULONGLONG
*p
)
1635 HTMLPerformanceTiming
*This
= impl_from_IHTMLPerformanceTiming(iface
);
1637 FIXME("(%p)->(%p) returning fake value\n", This
, p
);
1639 *p
= TIMING_FAKE_TIMESTAMP
;
1643 static HRESULT WINAPI
HTMLPerformanceTiming_get_domainLookupStart(IHTMLPerformanceTiming
*iface
, ULONGLONG
*p
)
1645 HTMLPerformanceTiming
*This
= impl_from_IHTMLPerformanceTiming(iface
);
1647 FIXME("(%p)->(%p) returning fake value\n", This
, p
);
1649 *p
= TIMING_FAKE_TIMESTAMP
;
1653 static HRESULT WINAPI
HTMLPerformanceTiming_get_domainLookupEnd(IHTMLPerformanceTiming
*iface
, ULONGLONG
*p
)
1655 HTMLPerformanceTiming
*This
= impl_from_IHTMLPerformanceTiming(iface
);
1657 FIXME("(%p)->(%p) returning fake value\n", This
, p
);
1659 *p
= TIMING_FAKE_TIMESTAMP
;
1663 static HRESULT WINAPI
HTMLPerformanceTiming_get_connectStart(IHTMLPerformanceTiming
*iface
, ULONGLONG
*p
)
1665 HTMLPerformanceTiming
*This
= impl_from_IHTMLPerformanceTiming(iface
);
1667 FIXME("(%p)->(%p) returning fake value\n", This
, p
);
1669 *p
= TIMING_FAKE_TIMESTAMP
;
1673 static HRESULT WINAPI
HTMLPerformanceTiming_get_connectEnd(IHTMLPerformanceTiming
*iface
, ULONGLONG
*p
)
1675 HTMLPerformanceTiming
*This
= impl_from_IHTMLPerformanceTiming(iface
);
1677 FIXME("(%p)->(%p) returning fake value\n", This
, p
);
1679 *p
= TIMING_FAKE_TIMESTAMP
;
1683 static HRESULT WINAPI
HTMLPerformanceTiming_get_requestStart(IHTMLPerformanceTiming
*iface
, ULONGLONG
*p
)
1685 HTMLPerformanceTiming
*This
= impl_from_IHTMLPerformanceTiming(iface
);
1687 FIXME("(%p)->(%p) returning fake value\n", This
, p
);
1689 *p
= TIMING_FAKE_TIMESTAMP
;
1693 static HRESULT WINAPI
HTMLPerformanceTiming_get_responseStart(IHTMLPerformanceTiming
*iface
, ULONGLONG
*p
)
1695 HTMLPerformanceTiming
*This
= impl_from_IHTMLPerformanceTiming(iface
);
1697 FIXME("(%p)->(%p) returning fake value\n", This
, p
);
1699 *p
= TIMING_FAKE_TIMESTAMP
;
1703 static HRESULT WINAPI
HTMLPerformanceTiming_get_responseEnd(IHTMLPerformanceTiming
*iface
, ULONGLONG
*p
)
1705 HTMLPerformanceTiming
*This
= impl_from_IHTMLPerformanceTiming(iface
);
1707 FIXME("(%p)->(%p) returning fake value\n", This
, p
);
1709 *p
= TIMING_FAKE_TIMESTAMP
;
1713 static HRESULT WINAPI
HTMLPerformanceTiming_get_domLoading(IHTMLPerformanceTiming
*iface
, ULONGLONG
*p
)
1715 HTMLPerformanceTiming
*This
= impl_from_IHTMLPerformanceTiming(iface
);
1717 FIXME("(%p)->(%p) returning fake value\n", This
, p
);
1719 *p
= TIMING_FAKE_TIMESTAMP
;
1723 static HRESULT WINAPI
HTMLPerformanceTiming_get_domInteractive(IHTMLPerformanceTiming
*iface
, ULONGLONG
*p
)
1725 HTMLPerformanceTiming
*This
= impl_from_IHTMLPerformanceTiming(iface
);
1727 FIXME("(%p)->(%p) returning fake value\n", This
, p
);
1729 *p
= TIMING_FAKE_TIMESTAMP
;
1733 static HRESULT WINAPI
HTMLPerformanceTiming_get_domContentLoadedEventStart(IHTMLPerformanceTiming
*iface
, ULONGLONG
*p
)
1735 HTMLPerformanceTiming
*This
= impl_from_IHTMLPerformanceTiming(iface
);
1737 FIXME("(%p)->(%p) returning fake value\n", This
, p
);
1739 *p
= TIMING_FAKE_TIMESTAMP
;
1743 static HRESULT WINAPI
HTMLPerformanceTiming_get_domContentLoadedEventEnd(IHTMLPerformanceTiming
*iface
, ULONGLONG
*p
)
1745 HTMLPerformanceTiming
*This
= impl_from_IHTMLPerformanceTiming(iface
);
1747 FIXME("(%p)->(%p) returning fake value\n", This
, p
);
1749 *p
= TIMING_FAKE_TIMESTAMP
;
1753 static HRESULT WINAPI
HTMLPerformanceTiming_get_domComplete(IHTMLPerformanceTiming
*iface
, ULONGLONG
*p
)
1755 HTMLPerformanceTiming
*This
= impl_from_IHTMLPerformanceTiming(iface
);
1757 FIXME("(%p)->(%p) returning fake value\n", This
, p
);
1759 *p
= TIMING_FAKE_TIMESTAMP
;
1763 static HRESULT WINAPI
HTMLPerformanceTiming_get_loadEventStart(IHTMLPerformanceTiming
*iface
, ULONGLONG
*p
)
1765 HTMLPerformanceTiming
*This
= impl_from_IHTMLPerformanceTiming(iface
);
1767 FIXME("(%p)->(%p) returning fake value\n", This
, p
);
1769 *p
= TIMING_FAKE_TIMESTAMP
;
1773 static HRESULT WINAPI
HTMLPerformanceTiming_get_loadEventEnd(IHTMLPerformanceTiming
*iface
, ULONGLONG
*p
)
1775 HTMLPerformanceTiming
*This
= impl_from_IHTMLPerformanceTiming(iface
);
1777 FIXME("(%p)->(%p) returning fake value\n", This
, p
);
1779 *p
= TIMING_FAKE_TIMESTAMP
;
1783 static HRESULT WINAPI
HTMLPerformanceTiming_get_msFirstPaint(IHTMLPerformanceTiming
*iface
, ULONGLONG
*p
)
1785 HTMLPerformanceTiming
*This
= impl_from_IHTMLPerformanceTiming(iface
);
1787 FIXME("(%p)->(%p) returning fake value\n", This
, p
);
1789 *p
= TIMING_FAKE_TIMESTAMP
;
1793 static HRESULT WINAPI
HTMLPerformanceTiming_toString(IHTMLPerformanceTiming
*iface
, BSTR
*string
)
1795 HTMLPerformanceTiming
*This
= impl_from_IHTMLPerformanceTiming(iface
);
1796 FIXME("(%p)->(%p)\n", This
, string
);
1800 static HRESULT WINAPI
HTMLPerformanceTiming_toJSON(IHTMLPerformanceTiming
*iface
, VARIANT
*p
)
1802 HTMLPerformanceTiming
*This
= impl_from_IHTMLPerformanceTiming(iface
);
1803 FIXME("(%p)->(%p)\n", This
, p
);
1807 static const IHTMLPerformanceTimingVtbl HTMLPerformanceTimingVtbl
= {
1808 HTMLPerformanceTiming_QueryInterface
,
1809 HTMLPerformanceTiming_AddRef
,
1810 HTMLPerformanceTiming_Release
,
1811 HTMLPerformanceTiming_GetTypeInfoCount
,
1812 HTMLPerformanceTiming_GetTypeInfo
,
1813 HTMLPerformanceTiming_GetIDsOfNames
,
1814 HTMLPerformanceTiming_Invoke
,
1815 HTMLPerformanceTiming_get_navigationStart
,
1816 HTMLPerformanceTiming_get_unloadEventStart
,
1817 HTMLPerformanceTiming_get_unloadEventEnd
,
1818 HTMLPerformanceTiming_get_redirectStart
,
1819 HTMLPerformanceTiming_get_redirectEnd
,
1820 HTMLPerformanceTiming_get_fetchStart
,
1821 HTMLPerformanceTiming_get_domainLookupStart
,
1822 HTMLPerformanceTiming_get_domainLookupEnd
,
1823 HTMLPerformanceTiming_get_connectStart
,
1824 HTMLPerformanceTiming_get_connectEnd
,
1825 HTMLPerformanceTiming_get_requestStart
,
1826 HTMLPerformanceTiming_get_responseStart
,
1827 HTMLPerformanceTiming_get_responseEnd
,
1828 HTMLPerformanceTiming_get_domLoading
,
1829 HTMLPerformanceTiming_get_domInteractive
,
1830 HTMLPerformanceTiming_get_domContentLoadedEventStart
,
1831 HTMLPerformanceTiming_get_domContentLoadedEventEnd
,
1832 HTMLPerformanceTiming_get_domComplete
,
1833 HTMLPerformanceTiming_get_loadEventStart
,
1834 HTMLPerformanceTiming_get_loadEventEnd
,
1835 HTMLPerformanceTiming_get_msFirstPaint
,
1836 HTMLPerformanceTiming_toString
,
1837 HTMLPerformanceTiming_toJSON
1840 static const tid_t HTMLPerformanceTiming_iface_tids
[] = {
1841 IHTMLPerformanceTiming_tid
,
1844 static dispex_static_data_t HTMLPerformanceTiming_dispex
= {
1846 IHTMLPerformanceTiming_tid
,
1847 HTMLPerformanceTiming_iface_tids
1852 IHTMLPerformanceNavigation IHTMLPerformanceNavigation_iface
;
1855 } HTMLPerformanceNavigation
;
1857 static inline HTMLPerformanceNavigation
*impl_from_IHTMLPerformanceNavigation(IHTMLPerformanceNavigation
*iface
)
1859 return CONTAINING_RECORD(iface
, HTMLPerformanceNavigation
, IHTMLPerformanceNavigation_iface
);
1862 static HRESULT WINAPI
HTMLPerformanceNavigation_QueryInterface(IHTMLPerformanceNavigation
*iface
, REFIID riid
, void **ppv
)
1864 HTMLPerformanceNavigation
*This
= impl_from_IHTMLPerformanceNavigation(iface
);
1866 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
1868 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
1869 *ppv
= &This
->IHTMLPerformanceNavigation_iface
;
1870 }else if(IsEqualGUID(&IID_IHTMLPerformanceNavigation
, riid
)) {
1871 *ppv
= &This
->IHTMLPerformanceNavigation_iface
;
1872 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
1873 return *ppv
? S_OK
: E_NOINTERFACE
;
1875 WARN("Unsupported interface %s\n", debugstr_mshtml_guid(riid
));
1877 return E_NOINTERFACE
;
1880 IUnknown_AddRef((IUnknown
*)*ppv
);
1884 static ULONG WINAPI
HTMLPerformanceNavigation_AddRef(IHTMLPerformanceNavigation
*iface
)
1886 HTMLPerformanceNavigation
*This
= impl_from_IHTMLPerformanceNavigation(iface
);
1887 LONG ref
= InterlockedIncrement(&This
->ref
);
1889 TRACE("(%p) ref=%d\n", This
, ref
);
1894 static ULONG WINAPI
HTMLPerformanceNavigation_Release(IHTMLPerformanceNavigation
*iface
)
1896 HTMLPerformanceNavigation
*This
= impl_from_IHTMLPerformanceNavigation(iface
);
1897 LONG ref
= InterlockedDecrement(&This
->ref
);
1899 TRACE("(%p) ref=%d\n", This
, ref
);
1902 release_dispex(&This
->dispex
);
1909 static HRESULT WINAPI
HTMLPerformanceNavigation_GetTypeInfoCount(IHTMLPerformanceNavigation
*iface
, UINT
*pctinfo
)
1911 HTMLPerformanceNavigation
*This
= impl_from_IHTMLPerformanceNavigation(iface
);
1912 FIXME("(%p)->(%p)\n", This
, pctinfo
);
1916 static HRESULT WINAPI
HTMLPerformanceNavigation_GetTypeInfo(IHTMLPerformanceNavigation
*iface
, UINT iTInfo
,
1917 LCID lcid
, ITypeInfo
**ppTInfo
)
1919 HTMLPerformanceNavigation
*This
= impl_from_IHTMLPerformanceNavigation(iface
);
1921 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
1924 static HRESULT WINAPI
HTMLPerformanceNavigation_GetIDsOfNames(IHTMLPerformanceNavigation
*iface
, REFIID riid
,
1925 LPOLESTR
*rgszNames
, UINT cNames
,
1926 LCID lcid
, DISPID
*rgDispId
)
1928 HTMLPerformanceNavigation
*This
= impl_from_IHTMLPerformanceNavigation(iface
);
1930 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
1934 static HRESULT WINAPI
HTMLPerformanceNavigation_Invoke(IHTMLPerformanceNavigation
*iface
, DISPID dispIdMember
,
1935 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
1936 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
1938 HTMLPerformanceNavigation
*This
= impl_from_IHTMLPerformanceNavigation(iface
);
1940 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
,
1941 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
1944 static HRESULT WINAPI
HTMLPerformanceNavigation_get_type(IHTMLPerformanceNavigation
*iface
, ULONG
*p
)
1946 HTMLPerformanceNavigation
*This
= impl_from_IHTMLPerformanceNavigation(iface
);
1948 FIXME("(%p)->(%p) returning TYPE_NAVIGATE\n", This
, p
);
1950 *p
= 0; /* TYPE_NAVIGATE */
1954 static HRESULT WINAPI
HTMLPerformanceNavigation_get_redirectCount(IHTMLPerformanceNavigation
*iface
, ULONG
*p
)
1956 HTMLPerformanceNavigation
*This
= impl_from_IHTMLPerformanceNavigation(iface
);
1957 FIXME("(%p)->(%p)\n", This
, p
);
1961 static HRESULT WINAPI
HTMLPerformanceNavigation_toString(IHTMLPerformanceNavigation
*iface
, BSTR
*string
)
1963 HTMLPerformanceNavigation
*This
= impl_from_IHTMLPerformanceNavigation(iface
);
1964 FIXME("(%p)->(%p)\n", This
, string
);
1968 static HRESULT WINAPI
HTMLPerformanceNavigation_toJSON(IHTMLPerformanceNavigation
*iface
, VARIANT
*p
)
1970 HTMLPerformanceNavigation
*This
= impl_from_IHTMLPerformanceNavigation(iface
);
1971 FIXME("(%p)->(%p)\n", This
, p
);
1975 static const IHTMLPerformanceNavigationVtbl HTMLPerformanceNavigationVtbl
= {
1976 HTMLPerformanceNavigation_QueryInterface
,
1977 HTMLPerformanceNavigation_AddRef
,
1978 HTMLPerformanceNavigation_Release
,
1979 HTMLPerformanceNavigation_GetTypeInfoCount
,
1980 HTMLPerformanceNavigation_GetTypeInfo
,
1981 HTMLPerformanceNavigation_GetIDsOfNames
,
1982 HTMLPerformanceNavigation_Invoke
,
1983 HTMLPerformanceNavigation_get_type
,
1984 HTMLPerformanceNavigation_get_redirectCount
,
1985 HTMLPerformanceNavigation_toString
,
1986 HTMLPerformanceNavigation_toJSON
1989 static const tid_t HTMLPerformanceNavigation_iface_tids
[] = {
1990 IHTMLPerformanceNavigation_tid
,
1993 static dispex_static_data_t HTMLPerformanceNavigation_dispex
= {
1995 IHTMLPerformanceNavigation_tid
,
1996 HTMLPerformanceNavigation_iface_tids
2001 IHTMLPerformance IHTMLPerformance_iface
;
2005 IHTMLPerformanceNavigation
*navigation
;
2006 IHTMLPerformanceTiming
*timing
;
2009 static inline HTMLPerformance
*impl_from_IHTMLPerformance(IHTMLPerformance
*iface
)
2011 return CONTAINING_RECORD(iface
, HTMLPerformance
, IHTMLPerformance_iface
);
2014 static HRESULT WINAPI
HTMLPerformance_QueryInterface(IHTMLPerformance
*iface
, REFIID riid
, void **ppv
)
2016 HTMLPerformance
*This
= impl_from_IHTMLPerformance(iface
);
2018 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
2020 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
2021 *ppv
= &This
->IHTMLPerformance_iface
;
2022 }else if(IsEqualGUID(&IID_IHTMLPerformance
, riid
)) {
2023 *ppv
= &This
->IHTMLPerformance_iface
;
2024 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
2025 return *ppv
? S_OK
: E_NOINTERFACE
;
2027 WARN("Unsupported interface %s\n", debugstr_mshtml_guid(riid
));
2029 return E_NOINTERFACE
;
2032 IUnknown_AddRef((IUnknown
*)*ppv
);
2036 static ULONG WINAPI
HTMLPerformance_AddRef(IHTMLPerformance
*iface
)
2038 HTMLPerformance
*This
= impl_from_IHTMLPerformance(iface
);
2039 LONG ref
= InterlockedIncrement(&This
->ref
);
2041 TRACE("(%p) ref=%d\n", This
, ref
);
2046 static ULONG WINAPI
HTMLPerformance_Release(IHTMLPerformance
*iface
)
2048 HTMLPerformance
*This
= impl_from_IHTMLPerformance(iface
);
2049 LONG ref
= InterlockedDecrement(&This
->ref
);
2051 TRACE("(%p) ref=%d\n", This
, ref
);
2055 IHTMLPerformanceTiming_Release(This
->timing
);
2056 if(This
->navigation
)
2057 IHTMLPerformanceNavigation_Release(This
->navigation
);
2058 release_dispex(&This
->dispex
);
2065 static HRESULT WINAPI
HTMLPerformance_GetTypeInfoCount(IHTMLPerformance
*iface
, UINT
*pctinfo
)
2067 HTMLPerformance
*This
= impl_from_IHTMLPerformance(iface
);
2068 FIXME("(%p)->(%p)\n", This
, pctinfo
);
2072 static HRESULT WINAPI
HTMLPerformance_GetTypeInfo(IHTMLPerformance
*iface
, UINT iTInfo
,
2073 LCID lcid
, ITypeInfo
**ppTInfo
)
2075 HTMLPerformance
*This
= impl_from_IHTMLPerformance(iface
);
2077 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
2080 static HRESULT WINAPI
HTMLPerformance_GetIDsOfNames(IHTMLPerformance
*iface
, REFIID riid
,
2081 LPOLESTR
*rgszNames
, UINT cNames
,
2082 LCID lcid
, DISPID
*rgDispId
)
2084 HTMLPerformance
*This
= impl_from_IHTMLPerformance(iface
);
2086 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
2090 static HRESULT WINAPI
HTMLPerformance_Invoke(IHTMLPerformance
*iface
, DISPID dispIdMember
,
2091 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
2092 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
2094 HTMLPerformance
*This
= impl_from_IHTMLPerformance(iface
);
2096 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
,
2097 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
2100 static HRESULT WINAPI
HTMLPerformance_get_navigation(IHTMLPerformance
*iface
,
2101 IHTMLPerformanceNavigation
**p
)
2103 HTMLPerformance
*This
= impl_from_IHTMLPerformance(iface
);
2105 TRACE("(%p)->(%p)\n", This
, p
);
2107 if(!This
->navigation
) {
2108 HTMLPerformanceNavigation
*navigation
;
2110 navigation
= heap_alloc_zero(sizeof(*navigation
));
2112 return E_OUTOFMEMORY
;
2114 navigation
->IHTMLPerformanceNavigation_iface
.lpVtbl
= &HTMLPerformanceNavigationVtbl
;
2115 navigation
->ref
= 1;
2116 init_dispex(&navigation
->dispex
, (IUnknown
*)&navigation
->IHTMLPerformanceNavigation_iface
,
2117 &HTMLPerformanceNavigation_dispex
);
2119 This
->navigation
= &navigation
->IHTMLPerformanceNavigation_iface
;
2122 IHTMLPerformanceNavigation_AddRef(*p
= This
->navigation
);
2126 static HRESULT WINAPI
HTMLPerformance_get_timing(IHTMLPerformance
*iface
, IHTMLPerformanceTiming
**p
)
2128 HTMLPerformance
*This
= impl_from_IHTMLPerformance(iface
);
2130 TRACE("(%p)->(%p)\n", This
, p
);
2133 HTMLPerformanceTiming
*timing
;
2135 timing
= heap_alloc_zero(sizeof(*timing
));
2137 return E_OUTOFMEMORY
;
2139 timing
->IHTMLPerformanceTiming_iface
.lpVtbl
= &HTMLPerformanceTimingVtbl
;
2141 init_dispex(&timing
->dispex
, (IUnknown
*)&timing
->IHTMLPerformanceTiming_iface
,
2142 &HTMLPerformanceTiming_dispex
);
2144 This
->timing
= &timing
->IHTMLPerformanceTiming_iface
;
2147 IHTMLPerformanceTiming_AddRef(*p
= This
->timing
);
2151 static HRESULT WINAPI
HTMLPerformance_toString(IHTMLPerformance
*iface
, BSTR
*string
)
2153 HTMLPerformance
*This
= impl_from_IHTMLPerformance(iface
);
2154 FIXME("(%p)->(%p)\n", This
, string
);
2158 static HRESULT WINAPI
HTMLPerformance_toJSON(IHTMLPerformance
*iface
, VARIANT
*var
)
2160 HTMLPerformance
*This
= impl_from_IHTMLPerformance(iface
);
2161 FIXME("(%p)->(%p)\n", This
, var
);
2165 static const IHTMLPerformanceVtbl HTMLPerformanceVtbl
= {
2166 HTMLPerformance_QueryInterface
,
2167 HTMLPerformance_AddRef
,
2168 HTMLPerformance_Release
,
2169 HTMLPerformance_GetTypeInfoCount
,
2170 HTMLPerformance_GetTypeInfo
,
2171 HTMLPerformance_GetIDsOfNames
,
2172 HTMLPerformance_Invoke
,
2173 HTMLPerformance_get_navigation
,
2174 HTMLPerformance_get_timing
,
2175 HTMLPerformance_toString
,
2176 HTMLPerformance_toJSON
2179 static const tid_t HTMLPerformance_iface_tids
[] = {
2180 IHTMLPerformance_tid
,
2183 static dispex_static_data_t HTMLPerformance_dispex
= {
2185 IHTMLPerformance_tid
,
2186 HTMLPerformance_iface_tids
2189 HRESULT
create_performance(IHTMLPerformance
**ret
)
2191 HTMLPerformance
*performance
;
2193 performance
= heap_alloc_zero(sizeof(*performance
));
2195 return E_OUTOFMEMORY
;
2197 performance
->IHTMLPerformance_iface
.lpVtbl
= &HTMLPerformanceVtbl
;
2198 performance
->ref
= 1;
2200 init_dispex(&performance
->dispex
, (IUnknown
*)&performance
->IHTMLPerformance_iface
,
2201 &HTMLPerformance_dispex
);
2203 *ret
= &performance
->IHTMLPerformance_iface
;
2209 IHTMLNamespaceCollection IHTMLNamespaceCollection_iface
;
2212 } HTMLNamespaceCollection
;
2214 static inline HTMLNamespaceCollection
*impl_from_IHTMLNamespaceCollection(IHTMLNamespaceCollection
*iface
)
2216 return CONTAINING_RECORD(iface
, HTMLNamespaceCollection
, IHTMLNamespaceCollection_iface
);
2219 static HRESULT WINAPI
HTMLNamespaceCollection_QueryInterface(IHTMLNamespaceCollection
*iface
, REFIID riid
, void **ppv
)
2221 HTMLNamespaceCollection
*This
= impl_from_IHTMLNamespaceCollection(iface
);
2223 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
2225 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
2226 *ppv
= &This
->IHTMLNamespaceCollection_iface
;
2227 }else if(IsEqualGUID(&IID_IHTMLNamespaceCollection
, riid
)) {
2228 *ppv
= &This
->IHTMLNamespaceCollection_iface
;
2229 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
2230 return *ppv
? S_OK
: E_NOINTERFACE
;
2232 WARN("Unsupported interface %s\n", debugstr_mshtml_guid(riid
));
2234 return E_NOINTERFACE
;
2237 IUnknown_AddRef((IUnknown
*)*ppv
);
2241 static ULONG WINAPI
HTMLNamespaceCollection_AddRef(IHTMLNamespaceCollection
*iface
)
2243 HTMLNamespaceCollection
*This
= impl_from_IHTMLNamespaceCollection(iface
);
2244 LONG ref
= InterlockedIncrement(&This
->ref
);
2246 TRACE("(%p) ref=%d\n", This
, ref
);
2251 static ULONG WINAPI
HTMLNamespaceCollection_Release(IHTMLNamespaceCollection
*iface
)
2253 HTMLNamespaceCollection
*This
= impl_from_IHTMLNamespaceCollection(iface
);
2254 LONG ref
= InterlockedDecrement(&This
->ref
);
2256 TRACE("(%p) ref=%d\n", This
, ref
);
2259 release_dispex(&This
->dispex
);
2266 static HRESULT WINAPI
HTMLNamespaceCollection_GetTypeInfoCount(IHTMLNamespaceCollection
*iface
, UINT
*pctinfo
)
2268 HTMLNamespaceCollection
*This
= impl_from_IHTMLNamespaceCollection(iface
);
2269 FIXME("(%p)->(%p)\n", This
, pctinfo
);
2273 static HRESULT WINAPI
HTMLNamespaceCollection_GetTypeInfo(IHTMLNamespaceCollection
*iface
, UINT iTInfo
,
2274 LCID lcid
, ITypeInfo
**ppTInfo
)
2276 HTMLNamespaceCollection
*This
= impl_from_IHTMLNamespaceCollection(iface
);
2278 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
2281 static HRESULT WINAPI
HTMLNamespaceCollection_GetIDsOfNames(IHTMLNamespaceCollection
*iface
, REFIID riid
,
2282 LPOLESTR
*rgszNames
, UINT cNames
,
2283 LCID lcid
, DISPID
*rgDispId
)
2285 HTMLNamespaceCollection
*This
= impl_from_IHTMLNamespaceCollection(iface
);
2287 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
2291 static HRESULT WINAPI
HTMLNamespaceCollection_Invoke(IHTMLNamespaceCollection
*iface
, DISPID dispIdMember
,
2292 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
2293 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
2295 HTMLNamespaceCollection
*This
= impl_from_IHTMLNamespaceCollection(iface
);
2297 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
,
2298 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
2301 static HRESULT WINAPI
HTMLNamespaceCollection_get_length(IHTMLNamespaceCollection
*iface
, LONG
*p
)
2303 HTMLNamespaceCollection
*This
= impl_from_IHTMLNamespaceCollection(iface
);
2304 FIXME("(%p)->(%p) returning 0\n", This
, p
);
2309 static HRESULT WINAPI
HTMLNamespaceCollection_item(IHTMLNamespaceCollection
*iface
, VARIANT index
, IDispatch
**p
)
2311 HTMLNamespaceCollection
*This
= impl_from_IHTMLNamespaceCollection(iface
);
2312 FIXME("(%p)->(%s %p)\n", This
, debugstr_variant(&index
), p
);
2316 static HRESULT WINAPI
HTMLNamespaceCollection_add(IHTMLNamespaceCollection
*iface
, BSTR
namespace, BSTR urn
,
2317 VARIANT implementation_url
, IDispatch
**p
)
2319 HTMLNamespaceCollection
*This
= impl_from_IHTMLNamespaceCollection(iface
);
2320 FIXME("(%p)->(%s %s %s %p)\n", This
, debugstr_w(namespace), debugstr_w(urn
), debugstr_variant(&implementation_url
), p
);
2324 static const IHTMLNamespaceCollectionVtbl HTMLNamespaceCollectionVtbl
= {
2325 HTMLNamespaceCollection_QueryInterface
,
2326 HTMLNamespaceCollection_AddRef
,
2327 HTMLNamespaceCollection_Release
,
2328 HTMLNamespaceCollection_GetTypeInfoCount
,
2329 HTMLNamespaceCollection_GetTypeInfo
,
2330 HTMLNamespaceCollection_GetIDsOfNames
,
2331 HTMLNamespaceCollection_Invoke
,
2332 HTMLNamespaceCollection_get_length
,
2333 HTMLNamespaceCollection_item
,
2334 HTMLNamespaceCollection_add
2337 static const tid_t HTMLNamespaceCollection_iface_tids
[] = {
2338 IHTMLNamespaceCollection_tid
,
2341 static dispex_static_data_t HTMLNamespaceCollection_dispex
= {
2343 DispHTMLNamespaceCollection_tid
,
2344 HTMLNamespaceCollection_iface_tids
2347 HRESULT
create_namespace_collection(IHTMLNamespaceCollection
**ret
)
2349 HTMLNamespaceCollection
*namespaces
;
2351 if (!(namespaces
= heap_alloc_zero(sizeof(*namespaces
))))
2352 return E_OUTOFMEMORY
;
2354 namespaces
->IHTMLNamespaceCollection_iface
.lpVtbl
= &HTMLNamespaceCollectionVtbl
;
2355 namespaces
->ref
= 1;
2356 init_dispex(&namespaces
->dispex
, (IUnknown
*)&namespaces
->IHTMLNamespaceCollection_iface
, &HTMLNamespaceCollection_dispex
);
2357 *ret
= &namespaces
->IHTMLNamespaceCollection_iface
;