2008-04-07 12:34:24 +02:00
|
|
|
/*
|
2018-02-28 16:31:41 +01:00
|
|
|
* Copyright 2008,2009 Jacek Caban for CodeWeavers
|
2008-04-07 12:34:24 +02:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
2019-03-13 17:54:22 +01:00
|
|
|
#include <assert.h>
|
2008-04-07 12:34:24 +02:00
|
|
|
|
|
|
|
#define COBJMACROS
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "ole2.h"
|
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
#include "mshtml_private.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
|
|
|
|
2010-11-08 12:48:55 +01:00
|
|
|
typedef struct HTMLPluginsCollection HTMLPluginsCollection;
|
2011-05-31 12:19:40 +02:00
|
|
|
typedef struct HTMLMimeTypesCollection HTMLMimeTypesCollection;
|
2010-11-08 12:48:55 +01:00
|
|
|
|
2008-04-07 12:34:24 +02:00
|
|
|
typedef struct {
|
2008-04-17 02:31:43 +02:00
|
|
|
DispatchEx dispex;
|
2010-12-06 23:32:14 +01:00
|
|
|
IOmNavigator IOmNavigator_iface;
|
2008-04-07 12:34:24 +02:00
|
|
|
|
|
|
|
LONG ref;
|
2010-11-08 12:48:55 +01:00
|
|
|
|
|
|
|
HTMLPluginsCollection *plugins;
|
2011-05-31 12:19:40 +02:00
|
|
|
HTMLMimeTypesCollection *mime_types;
|
2008-04-07 12:34:24 +02:00
|
|
|
} OmNavigator;
|
|
|
|
|
2014-08-22 14:48:37 +02:00
|
|
|
typedef struct {
|
|
|
|
DispatchEx dispex;
|
|
|
|
IHTMLDOMImplementation IHTMLDOMImplementation_iface;
|
2019-03-04 18:14:10 +01:00
|
|
|
IHTMLDOMImplementation2 IHTMLDOMImplementation2_iface;
|
2014-08-22 14:48:37 +02:00
|
|
|
|
|
|
|
LONG ref;
|
2019-03-13 17:54:22 +01:00
|
|
|
|
|
|
|
nsIDOMDOMImplementation *implementation;
|
|
|
|
GeckoBrowser *browser;
|
2014-08-22 14:48:37 +02:00
|
|
|
} HTMLDOMImplementation;
|
|
|
|
|
|
|
|
static inline HTMLDOMImplementation *impl_from_IHTMLDOMImplementation(IHTMLDOMImplementation *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLDOMImplementation, IHTMLDOMImplementation_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDOMImplementation_QueryInterface(IHTMLDOMImplementation *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation(iface);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
|
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IHTMLDOMImplementation, riid)) {
|
|
|
|
*ppv = &This->IHTMLDOMImplementation_iface;
|
2019-03-04 18:14:10 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IHTMLDOMImplementation2, riid)) {
|
|
|
|
*ppv = &This->IHTMLDOMImplementation2_iface;
|
2014-08-22 14:48:37 +02:00
|
|
|
}else if(dispex_query_interface(&This->dispex, riid, ppv)) {
|
|
|
|
return *ppv ? S_OK : E_NOINTERFACE;
|
|
|
|
}else {
|
|
|
|
WARN("Unsupported interface %s\n", debugstr_mshtml_guid(riid));
|
|
|
|
*ppv = NULL;
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLDOMImplementation_AddRef(IHTMLDOMImplementation *iface)
|
|
|
|
{
|
|
|
|
HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation(iface);
|
|
|
|
LONG ref = InterlockedIncrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLDOMImplementation_Release(IHTMLDOMImplementation *iface)
|
|
|
|
{
|
|
|
|
HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation(iface);
|
|
|
|
LONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
if(!ref) {
|
2019-03-13 17:54:22 +01:00
|
|
|
assert(!This->browser);
|
|
|
|
if(This->implementation)
|
|
|
|
nsIDOMDOMImplementation_Release(This->implementation);
|
2014-08-22 14:48:37 +02:00
|
|
|
release_dispex(&This->dispex);
|
|
|
|
heap_free(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDOMImplementation_GetTypeInfoCount(IHTMLDOMImplementation *iface, UINT *pctinfo)
|
|
|
|
{
|
|
|
|
HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation(iface);
|
|
|
|
|
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDOMImplementation_GetTypeInfo(IHTMLDOMImplementation *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
|
|
|
HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation(iface);
|
|
|
|
|
|
|
|
return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDOMImplementation_GetIDsOfNames(IHTMLDOMImplementation *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
|
|
|
HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation(iface);
|
|
|
|
|
|
|
|
return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames,
|
|
|
|
cNames, lcid, rgDispId);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDOMImplementation_Invoke(IHTMLDOMImplementation *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult,
|
|
|
|
EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
|
|
|
HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation(iface);
|
|
|
|
|
|
|
|
return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid,
|
|
|
|
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDOMImplementation_hasFeature(IHTMLDOMImplementation *iface, BSTR feature,
|
|
|
|
VARIANT version, VARIANT_BOOL *pfHasFeature)
|
|
|
|
{
|
|
|
|
HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%s %s %p) returning false\n", This, debugstr_w(feature), debugstr_variant(&version), pfHasFeature);
|
|
|
|
|
|
|
|
*pfHasFeature = VARIANT_FALSE;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLDOMImplementationVtbl HTMLDOMImplementationVtbl = {
|
|
|
|
HTMLDOMImplementation_QueryInterface,
|
|
|
|
HTMLDOMImplementation_AddRef,
|
|
|
|
HTMLDOMImplementation_Release,
|
|
|
|
HTMLDOMImplementation_GetTypeInfoCount,
|
|
|
|
HTMLDOMImplementation_GetTypeInfo,
|
|
|
|
HTMLDOMImplementation_GetIDsOfNames,
|
|
|
|
HTMLDOMImplementation_Invoke,
|
|
|
|
HTMLDOMImplementation_hasFeature
|
|
|
|
};
|
|
|
|
|
2019-03-04 18:14:10 +01:00
|
|
|
static inline HTMLDOMImplementation *impl_from_IHTMLDOMImplementation2(IHTMLDOMImplementation2 *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLDOMImplementation, IHTMLDOMImplementation2_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDOMImplementation2_QueryInterface(IHTMLDOMImplementation2 *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation2(iface);
|
|
|
|
return IHTMLDOMImplementation_QueryInterface(&This->IHTMLDOMImplementation_iface, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLDOMImplementation2_AddRef(IHTMLDOMImplementation2 *iface)
|
|
|
|
{
|
|
|
|
HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation2(iface);
|
|
|
|
return IHTMLDOMImplementation_AddRef(&This->IHTMLDOMImplementation_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLDOMImplementation2_Release(IHTMLDOMImplementation2 *iface)
|
|
|
|
{
|
|
|
|
HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation2(iface);
|
|
|
|
return IHTMLDOMImplementation_Release(&This->IHTMLDOMImplementation_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDOMImplementation2_GetTypeInfoCount(IHTMLDOMImplementation2 *iface, UINT *pctinfo)
|
|
|
|
{
|
|
|
|
HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation2(iface);
|
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDOMImplementation2_GetTypeInfo(IHTMLDOMImplementation2 *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
|
|
|
HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation2(iface);
|
|
|
|
return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDOMImplementation2_GetIDsOfNames(IHTMLDOMImplementation2 *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
|
|
|
HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation2(iface);
|
|
|
|
return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames,
|
|
|
|
cNames, lcid, rgDispId);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDOMImplementation2_Invoke(IHTMLDOMImplementation2 *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult,
|
|
|
|
EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
|
|
|
HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation2(iface);
|
|
|
|
return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid,
|
|
|
|
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDOMImplementation2_createDocumentType(IHTMLDOMImplementation2 *iface, BSTR name,
|
|
|
|
VARIANT *public_id, VARIANT *system_id, IDOMDocumentType **new_type)
|
|
|
|
{
|
|
|
|
HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation2(iface);
|
|
|
|
FIXME("(%p)->(%s %s %s %p)\n", This, debugstr_w(name), debugstr_variant(public_id),
|
|
|
|
debugstr_variant(system_id), new_type);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDOMImplementation2_createDocument(IHTMLDOMImplementation2 *iface, VARIANT *ns,
|
|
|
|
VARIANT *tag_name, IDOMDocumentType *document_type, IHTMLDocument7 **new_document)
|
|
|
|
{
|
|
|
|
HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation2(iface);
|
|
|
|
FIXME("(%p)->(%s %s %p %p)\n", This, debugstr_variant(ns), debugstr_variant(tag_name),
|
|
|
|
document_type, new_document);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDOMImplementation2_createHTMLDocument(IHTMLDOMImplementation2 *iface, BSTR title,
|
|
|
|
IHTMLDocument7 **new_document)
|
|
|
|
{
|
|
|
|
HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation2(iface);
|
2019-03-13 17:54:22 +01:00
|
|
|
HTMLDocumentNode *new_document_node;
|
|
|
|
nsIDOMHTMLDocument *html_doc;
|
|
|
|
nsIDOMDocument *doc;
|
|
|
|
nsAString title_str;
|
|
|
|
nsresult nsres;
|
|
|
|
HRESULT hres;
|
|
|
|
|
2019-03-04 18:14:10 +01:00
|
|
|
FIXME("(%p)->(%s %p)\n", This, debugstr_w(title), new_document);
|
2019-03-13 17:54:22 +01:00
|
|
|
|
|
|
|
if(!This->browser)
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
|
|
|
|
nsAString_InitDepend(&title_str, title);
|
|
|
|
nsres = nsIDOMDOMImplementation_CreateHTMLDocument(This->implementation, &title_str, &doc);
|
|
|
|
nsAString_Finish(&title_str);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("CreateHTMLDocument failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsres = nsIDOMDocument_QueryInterface(doc, &IID_nsIDOMHTMLDocument, (void**)&html_doc);
|
|
|
|
nsIDOMDocument_Release(doc);
|
|
|
|
assert(nsres == NS_OK);
|
|
|
|
|
|
|
|
hres = create_document_node(html_doc, This->browser, NULL, dispex_compat_mode(&This->dispex), &new_document_node);
|
|
|
|
nsIDOMHTMLDocument_Release(html_doc);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
*new_document = &new_document_node->basedoc.IHTMLDocument7_iface;
|
|
|
|
return S_OK;
|
2019-03-04 18:14:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDOMImplementation2_hasFeature(IHTMLDOMImplementation2 *iface, BSTR feature,
|
|
|
|
VARIANT version, VARIANT_BOOL *pfHasFeature)
|
|
|
|
{
|
|
|
|
HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation2(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%s %s %p) returning false\n", This, debugstr_w(feature), debugstr_variant(&version), pfHasFeature);
|
|
|
|
|
|
|
|
*pfHasFeature = VARIANT_FALSE;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLDOMImplementation2Vtbl HTMLDOMImplementation2Vtbl = {
|
|
|
|
HTMLDOMImplementation2_QueryInterface,
|
|
|
|
HTMLDOMImplementation2_AddRef,
|
|
|
|
HTMLDOMImplementation2_Release,
|
|
|
|
HTMLDOMImplementation2_GetTypeInfoCount,
|
|
|
|
HTMLDOMImplementation2_GetTypeInfo,
|
|
|
|
HTMLDOMImplementation2_GetIDsOfNames,
|
|
|
|
HTMLDOMImplementation2_Invoke,
|
|
|
|
HTMLDOMImplementation2_createDocumentType,
|
|
|
|
HTMLDOMImplementation2_createDocument,
|
|
|
|
HTMLDOMImplementation2_createHTMLDocument,
|
|
|
|
HTMLDOMImplementation2_hasFeature
|
|
|
|
};
|
|
|
|
|
2014-08-22 14:48:37 +02:00
|
|
|
static const tid_t HTMLDOMImplementation_iface_tids[] = {
|
|
|
|
IHTMLDOMImplementation_tid,
|
|
|
|
0
|
|
|
|
};
|
|
|
|
static dispex_static_data_t HTMLDOMImplementation_dispex = {
|
|
|
|
NULL,
|
2019-04-18 15:36:56 +02:00
|
|
|
DispHTMLDOMImplementation_tid,
|
2014-08-22 14:48:37 +02:00
|
|
|
HTMLDOMImplementation_iface_tids
|
|
|
|
};
|
|
|
|
|
2019-03-13 17:54:22 +01:00
|
|
|
HRESULT create_dom_implementation(HTMLDocumentNode *doc_node, IHTMLDOMImplementation **ret)
|
2014-08-22 14:48:37 +02:00
|
|
|
{
|
|
|
|
HTMLDOMImplementation *dom_implementation;
|
2019-03-13 17:54:22 +01:00
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
if(!doc_node->browser)
|
|
|
|
return E_UNEXPECTED;
|
2014-08-22 14:48:37 +02:00
|
|
|
|
|
|
|
dom_implementation = heap_alloc_zero(sizeof(*dom_implementation));
|
|
|
|
if(!dom_implementation)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
dom_implementation->IHTMLDOMImplementation_iface.lpVtbl = &HTMLDOMImplementationVtbl;
|
2019-03-04 18:14:10 +01:00
|
|
|
dom_implementation->IHTMLDOMImplementation2_iface.lpVtbl = &HTMLDOMImplementation2Vtbl;
|
2014-08-22 14:48:37 +02:00
|
|
|
dom_implementation->ref = 1;
|
2019-03-13 17:54:22 +01:00
|
|
|
dom_implementation->browser = doc_node->browser;
|
|
|
|
|
|
|
|
init_dispex_with_compat_mode(&dom_implementation->dispex, (IUnknown*)&dom_implementation->IHTMLDOMImplementation_iface,
|
|
|
|
&HTMLDOMImplementation_dispex, doc_node->document_mode);
|
2014-08-22 14:48:37 +02:00
|
|
|
|
2019-03-13 17:54:22 +01:00
|
|
|
nsres = nsIDOMHTMLDocument_GetImplementation(doc_node->nsdoc, &dom_implementation->implementation);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("GetDOMImplementation failed: %08x\n", nsres);
|
|
|
|
IHTMLDOMImplementation_Release(&dom_implementation->IHTMLDOMImplementation_iface);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
2014-08-22 14:48:37 +02:00
|
|
|
|
|
|
|
*ret = &dom_implementation->IHTMLDOMImplementation_iface;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2019-03-13 17:54:22 +01:00
|
|
|
void detach_dom_implementation(IHTMLDOMImplementation *iface)
|
|
|
|
{
|
|
|
|
HTMLDOMImplementation *dom_implementation = impl_from_IHTMLDOMImplementation(iface);
|
|
|
|
dom_implementation->browser = NULL;
|
|
|
|
}
|
|
|
|
|
2018-02-28 16:31:41 +01:00
|
|
|
typedef struct {
|
|
|
|
DispatchEx dispex;
|
|
|
|
IHTMLScreen IHTMLScreen_iface;
|
|
|
|
|
|
|
|
LONG ref;
|
|
|
|
} HTMLScreen;
|
|
|
|
|
|
|
|
static inline HTMLScreen *impl_from_IHTMLScreen(IHTMLScreen *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLScreen, IHTMLScreen_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLScreen_QueryInterface(IHTMLScreen *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLScreen *This = impl_from_IHTMLScreen(iface);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
|
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
|
|
|
*ppv = &This->IHTMLScreen_iface;
|
|
|
|
}else if(IsEqualGUID(&IID_IHTMLScreen, riid)) {
|
|
|
|
*ppv = &This->IHTMLScreen_iface;
|
|
|
|
}else if(dispex_query_interface(&This->dispex, riid, ppv)) {
|
|
|
|
return *ppv ? S_OK : E_NOINTERFACE;
|
|
|
|
}else {
|
|
|
|
*ppv = NULL;
|
|
|
|
WARN("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLScreen_AddRef(IHTMLScreen *iface)
|
|
|
|
{
|
|
|
|
HTMLScreen *This = impl_from_IHTMLScreen(iface);
|
|
|
|
LONG ref = InterlockedIncrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLScreen_Release(IHTMLScreen *iface)
|
|
|
|
{
|
|
|
|
HTMLScreen *This = impl_from_IHTMLScreen(iface);
|
|
|
|
LONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
if(!ref) {
|
|
|
|
release_dispex(&This->dispex);
|
|
|
|
heap_free(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLScreen_GetTypeInfoCount(IHTMLScreen *iface, UINT *pctinfo)
|
|
|
|
{
|
|
|
|
HTMLScreen *This = impl_from_IHTMLScreen(iface);
|
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLScreen_GetTypeInfo(IHTMLScreen *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
|
|
|
HTMLScreen *This = impl_from_IHTMLScreen(iface);
|
|
|
|
return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLScreen_GetIDsOfNames(IHTMLScreen *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
|
|
|
HTMLScreen *This = impl_from_IHTMLScreen(iface);
|
|
|
|
return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
|
|
|
|
lcid, rgDispId);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLScreen_Invoke(IHTMLScreen *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
|
|
|
HTMLScreen *This = impl_from_IHTMLScreen(iface);
|
|
|
|
return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
|
|
|
|
pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLScreen_get_colorDepth(IHTMLScreen *iface, LONG *p)
|
|
|
|
{
|
|
|
|
HTMLScreen *This = impl_from_IHTMLScreen(iface);
|
|
|
|
HDC hdc = GetDC(0);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
*p = GetDeviceCaps(hdc, BITSPIXEL);
|
|
|
|
ReleaseDC(0, hdc);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLScreen_put_bufferDepth(IHTMLScreen *iface, LONG v)
|
|
|
|
{
|
|
|
|
HTMLScreen *This = impl_from_IHTMLScreen(iface);
|
|
|
|
FIXME("(%p)->(%d)\n", This, v);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLScreen_get_bufferDepth(IHTMLScreen *iface, LONG *p)
|
|
|
|
{
|
|
|
|
HTMLScreen *This = impl_from_IHTMLScreen(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLScreen_get_width(IHTMLScreen *iface, LONG *p)
|
|
|
|
{
|
|
|
|
HTMLScreen *This = impl_from_IHTMLScreen(iface);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
*p = GetSystemMetrics(SM_CXSCREEN);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLScreen_get_height(IHTMLScreen *iface, LONG *p)
|
|
|
|
{
|
|
|
|
HTMLScreen *This = impl_from_IHTMLScreen(iface);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
*p = GetSystemMetrics(SM_CYSCREEN);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLScreen_put_updateInterval(IHTMLScreen *iface, LONG v)
|
|
|
|
{
|
|
|
|
HTMLScreen *This = impl_from_IHTMLScreen(iface);
|
|
|
|
FIXME("(%p)->(%d)\n", This, v);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLScreen_get_updateInterval(IHTMLScreen *iface, LONG *p)
|
|
|
|
{
|
|
|
|
HTMLScreen *This = impl_from_IHTMLScreen(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLScreen_get_availHeight(IHTMLScreen *iface, LONG *p)
|
|
|
|
{
|
|
|
|
HTMLScreen *This = impl_from_IHTMLScreen(iface);
|
|
|
|
RECT work_area;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
if(!SystemParametersInfoW(SPI_GETWORKAREA, 0, &work_area, 0))
|
|
|
|
return E_FAIL;
|
|
|
|
|
|
|
|
*p = work_area.bottom-work_area.top;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLScreen_get_availWidth(IHTMLScreen *iface, LONG *p)
|
|
|
|
{
|
|
|
|
HTMLScreen *This = impl_from_IHTMLScreen(iface);
|
|
|
|
RECT work_area;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
if(!SystemParametersInfoW(SPI_GETWORKAREA, 0, &work_area, 0))
|
|
|
|
return E_FAIL;
|
|
|
|
|
|
|
|
*p = work_area.right-work_area.left;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLScreen_get_fontSmoothingEnabled(IHTMLScreen *iface, VARIANT_BOOL *p)
|
|
|
|
{
|
|
|
|
HTMLScreen *This = impl_from_IHTMLScreen(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLScreenVtbl HTMLSreenVtbl = {
|
|
|
|
HTMLScreen_QueryInterface,
|
|
|
|
HTMLScreen_AddRef,
|
|
|
|
HTMLScreen_Release,
|
|
|
|
HTMLScreen_GetTypeInfoCount,
|
|
|
|
HTMLScreen_GetTypeInfo,
|
|
|
|
HTMLScreen_GetIDsOfNames,
|
|
|
|
HTMLScreen_Invoke,
|
|
|
|
HTMLScreen_get_colorDepth,
|
|
|
|
HTMLScreen_put_bufferDepth,
|
|
|
|
HTMLScreen_get_bufferDepth,
|
|
|
|
HTMLScreen_get_width,
|
|
|
|
HTMLScreen_get_height,
|
|
|
|
HTMLScreen_put_updateInterval,
|
|
|
|
HTMLScreen_get_updateInterval,
|
|
|
|
HTMLScreen_get_availHeight,
|
|
|
|
HTMLScreen_get_availWidth,
|
|
|
|
HTMLScreen_get_fontSmoothingEnabled
|
|
|
|
};
|
|
|
|
|
|
|
|
static const tid_t HTMLScreen_iface_tids[] = {
|
|
|
|
IHTMLScreen_tid,
|
|
|
|
0
|
|
|
|
};
|
|
|
|
static dispex_static_data_t HTMLScreen_dispex = {
|
|
|
|
NULL,
|
|
|
|
DispHTMLScreen_tid,
|
|
|
|
HTMLScreen_iface_tids
|
|
|
|
};
|
|
|
|
|
|
|
|
HRESULT HTMLScreen_Create(IHTMLScreen **ret)
|
|
|
|
{
|
|
|
|
HTMLScreen *screen;
|
|
|
|
|
|
|
|
screen = heap_alloc_zero(sizeof(HTMLScreen));
|
|
|
|
if(!screen)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
screen->IHTMLScreen_iface.lpVtbl = &HTMLSreenVtbl;
|
|
|
|
screen->ref = 1;
|
|
|
|
|
|
|
|
init_dispex(&screen->dispex, (IUnknown*)&screen->IHTMLScreen_iface, &HTMLScreen_dispex);
|
|
|
|
|
|
|
|
*ret = &screen->IHTMLScreen_iface;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2012-05-02 10:28:09 +02:00
|
|
|
static inline OmHistory *impl_from_IOmHistory(IOmHistory *iface)
|
2010-12-06 23:32:14 +01:00
|
|
|
{
|
2012-05-02 10:28:09 +02:00
|
|
|
return CONTAINING_RECORD(iface, OmHistory, IOmHistory_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmHistory_QueryInterface(IOmHistory *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
OmHistory *This = impl_from_IOmHistory(iface);
|
|
|
|
|
2015-01-08 14:42:10 +01:00
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
|
2012-05-02 10:28:09 +02:00
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
|
|
|
*ppv = &This->IOmHistory_iface;
|
|
|
|
}else if(IsEqualGUID(&IID_IOmHistory, riid)) {
|
|
|
|
*ppv = &This->IOmHistory_iface;
|
|
|
|
}else if(dispex_query_interface(&This->dispex, riid, ppv)) {
|
|
|
|
return *ppv ? S_OK : E_NOINTERFACE;
|
2015-01-08 14:42:10 +01:00
|
|
|
}else {
|
|
|
|
WARN("Unsupported interface %s\n", debugstr_mshtml_guid(riid));
|
|
|
|
*ppv = NULL;
|
|
|
|
return E_NOINTERFACE;
|
2012-05-02 10:28:09 +02:00
|
|
|
}
|
|
|
|
|
2015-01-08 14:42:10 +01:00
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
2012-05-02 10:28:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI OmHistory_AddRef(IOmHistory *iface)
|
|
|
|
{
|
|
|
|
OmHistory *This = impl_from_IOmHistory(iface);
|
|
|
|
LONG ref = InterlockedIncrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI OmHistory_Release(IOmHistory *iface)
|
|
|
|
{
|
|
|
|
OmHistory *This = impl_from_IOmHistory(iface);
|
|
|
|
LONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
if(!ref) {
|
|
|
|
release_dispex(&This->dispex);
|
|
|
|
heap_free(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmHistory_GetTypeInfoCount(IOmHistory *iface, UINT *pctinfo)
|
|
|
|
{
|
|
|
|
OmHistory *This = impl_from_IOmHistory(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, pctinfo);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmHistory_GetTypeInfo(IOmHistory *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
|
|
|
OmHistory *This = impl_from_IOmHistory(iface);
|
|
|
|
|
|
|
|
return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmHistory_GetIDsOfNames(IOmHistory *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
|
|
|
OmHistory *This = impl_from_IOmHistory(iface);
|
|
|
|
|
|
|
|
return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
|
|
|
|
lcid, rgDispId);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmHistory_Invoke(IOmHistory *iface, DISPID dispIdMember, REFIID riid, LCID lcid,
|
|
|
|
WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
|
|
|
OmHistory *This = impl_from_IOmHistory(iface);
|
|
|
|
|
|
|
|
return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
|
|
|
|
pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmHistory_get_length(IOmHistory *iface, short *p)
|
|
|
|
{
|
|
|
|
OmHistory *This = impl_from_IOmHistory(iface);
|
2019-03-14 14:12:55 +01:00
|
|
|
GeckoBrowser *browser = NULL;
|
2013-04-23 16:21:04 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2019-03-14 14:12:55 +01:00
|
|
|
if(This->window && This->window->base.outer_window)
|
|
|
|
browser = This->window->base.outer_window->browser;
|
|
|
|
|
|
|
|
*p = browser->doc->travel_log
|
|
|
|
? ITravelLog_CountEntries(browser->doc->travel_log, browser->doc->browser_service)
|
|
|
|
: 0;
|
2013-04-23 16:21:04 +02:00
|
|
|
return S_OK;
|
2012-05-02 10:28:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmHistory_back(IOmHistory *iface, VARIANT *pvargdistance)
|
|
|
|
{
|
|
|
|
OmHistory *This = impl_from_IOmHistory(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(pvargdistance));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmHistory_forward(IOmHistory *iface, VARIANT *pvargdistance)
|
|
|
|
{
|
|
|
|
OmHistory *This = impl_from_IOmHistory(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(pvargdistance));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmHistory_go(IOmHistory *iface, VARIANT *pvargdistance)
|
|
|
|
{
|
|
|
|
OmHistory *This = impl_from_IOmHistory(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(pvargdistance));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IOmHistoryVtbl OmHistoryVtbl = {
|
|
|
|
OmHistory_QueryInterface,
|
|
|
|
OmHistory_AddRef,
|
|
|
|
OmHistory_Release,
|
|
|
|
OmHistory_GetTypeInfoCount,
|
|
|
|
OmHistory_GetTypeInfo,
|
|
|
|
OmHistory_GetIDsOfNames,
|
|
|
|
OmHistory_Invoke,
|
|
|
|
OmHistory_get_length,
|
|
|
|
OmHistory_back,
|
|
|
|
OmHistory_forward,
|
|
|
|
OmHistory_go
|
|
|
|
};
|
|
|
|
|
|
|
|
static const tid_t OmHistory_iface_tids[] = {
|
|
|
|
IOmHistory_tid,
|
|
|
|
0
|
|
|
|
};
|
|
|
|
static dispex_static_data_t OmHistory_dispex = {
|
|
|
|
NULL,
|
|
|
|
DispHTMLHistory_tid,
|
|
|
|
OmHistory_iface_tids
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2013-04-23 16:21:04 +02:00
|
|
|
HRESULT create_history(HTMLInnerWindow *window, OmHistory **ret)
|
2012-05-02 10:28:09 +02:00
|
|
|
{
|
|
|
|
OmHistory *history;
|
|
|
|
|
|
|
|
history = heap_alloc_zero(sizeof(*history));
|
|
|
|
if(!history)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
init_dispex(&history->dispex, (IUnknown*)&history->IOmHistory_iface, &OmHistory_dispex);
|
|
|
|
history->IOmHistory_iface.lpVtbl = &OmHistoryVtbl;
|
|
|
|
history->ref = 1;
|
|
|
|
|
2013-04-23 16:21:04 +02:00
|
|
|
history->window = window;
|
|
|
|
|
|
|
|
*ret = history;
|
2012-05-02 10:28:09 +02:00
|
|
|
return S_OK;
|
2010-12-06 23:32:14 +01:00
|
|
|
}
|
2008-04-07 12:34:24 +02:00
|
|
|
|
2010-11-08 12:48:55 +01:00
|
|
|
struct HTMLPluginsCollection {
|
|
|
|
DispatchEx dispex;
|
2010-12-08 01:09:32 +01:00
|
|
|
IHTMLPluginsCollection IHTMLPluginsCollection_iface;
|
2010-11-08 12:48:55 +01:00
|
|
|
|
|
|
|
LONG ref;
|
|
|
|
|
|
|
|
OmNavigator *navigator;
|
|
|
|
};
|
|
|
|
|
2010-12-08 01:09:32 +01:00
|
|
|
static inline HTMLPluginsCollection *impl_from_IHTMLPluginsCollection(IHTMLPluginsCollection *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLPluginsCollection, IHTMLPluginsCollection_iface);
|
|
|
|
}
|
2010-11-08 12:48:55 +01:00
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPluginsCollection_QueryInterface(IHTMLPluginsCollection *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
2010-12-08 01:09:32 +01:00
|
|
|
HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
|
2010-11-08 12:48:55 +01:00
|
|
|
|
2015-01-08 14:42:10 +01:00
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
|
|
|
|
|
2010-11-08 12:48:55 +01:00
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
2010-12-08 01:09:32 +01:00
|
|
|
*ppv = &This->IHTMLPluginsCollection_iface;
|
2010-11-08 12:48:55 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IHTMLPluginsCollection, riid)) {
|
2010-12-08 01:09:32 +01:00
|
|
|
*ppv = &This->IHTMLPluginsCollection_iface;
|
2010-11-08 12:48:55 +01:00
|
|
|
}else if(dispex_query_interface(&This->dispex, riid, ppv)) {
|
|
|
|
return *ppv ? S_OK : E_NOINTERFACE;
|
|
|
|
}else {
|
|
|
|
*ppv = NULL;
|
2015-01-08 14:42:10 +01:00
|
|
|
WARN("Unsupported interface %s\n", debugstr_mshtml_guid(riid));
|
2010-11-08 12:48:55 +01:00
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLPluginsCollection_AddRef(IHTMLPluginsCollection *iface)
|
|
|
|
{
|
2010-12-08 01:09:32 +01:00
|
|
|
HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
|
2010-11-08 12:48:55 +01:00
|
|
|
LONG ref = InterlockedIncrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLPluginsCollection_Release(IHTMLPluginsCollection *iface)
|
|
|
|
{
|
2010-12-08 01:09:32 +01:00
|
|
|
HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
|
2010-11-08 12:48:55 +01:00
|
|
|
LONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
if(!ref) {
|
|
|
|
if(This->navigator)
|
|
|
|
This->navigator->plugins = NULL;
|
|
|
|
release_dispex(&This->dispex);
|
|
|
|
heap_free(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPluginsCollection_GetTypeInfoCount(IHTMLPluginsCollection *iface, UINT *pctinfo)
|
|
|
|
{
|
2010-12-08 01:09:32 +01:00
|
|
|
HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
|
2010-12-31 11:07:33 +01:00
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
|
2010-11-08 12:48:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPluginsCollection_GetTypeInfo(IHTMLPluginsCollection *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
2010-12-08 01:09:32 +01:00
|
|
|
HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
|
2010-12-31 11:07:33 +01:00
|
|
|
return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
|
2010-11-08 12:48:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPluginsCollection_GetIDsOfNames(IHTMLPluginsCollection *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
2010-12-08 01:09:32 +01:00
|
|
|
HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
|
2010-12-31 11:07:33 +01:00
|
|
|
return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
|
|
|
|
lcid, rgDispId);
|
2010-11-08 12:48:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPluginsCollection_Invoke(IHTMLPluginsCollection *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult,
|
|
|
|
EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
2010-12-08 01:09:32 +01:00
|
|
|
HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
|
2010-12-31 11:07:33 +01:00
|
|
|
return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
|
2010-11-08 12:48:55 +01:00
|
|
|
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPluginsCollection_get_length(IHTMLPluginsCollection *iface, LONG *p)
|
|
|
|
{
|
2010-12-08 01:09:32 +01:00
|
|
|
HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
|
2011-07-31 16:45:08 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
/* IE always returns 0 here */
|
|
|
|
*p = 0;
|
|
|
|
return S_OK;
|
2010-11-08 12:48:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPluginsCollection_refresh(IHTMLPluginsCollection *iface, VARIANT_BOOL reload)
|
|
|
|
{
|
2010-12-08 01:09:32 +01:00
|
|
|
HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
|
2015-03-06 13:01:29 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%x)\n", This, reload);
|
|
|
|
|
|
|
|
/* Nothing to do here. */
|
|
|
|
return S_OK;
|
2010-11-08 12:48:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLPluginsCollectionVtbl HTMLPluginsCollectionVtbl = {
|
|
|
|
HTMLPluginsCollection_QueryInterface,
|
|
|
|
HTMLPluginsCollection_AddRef,
|
|
|
|
HTMLPluginsCollection_Release,
|
|
|
|
HTMLPluginsCollection_GetTypeInfoCount,
|
|
|
|
HTMLPluginsCollection_GetTypeInfo,
|
|
|
|
HTMLPluginsCollection_GetIDsOfNames,
|
|
|
|
HTMLPluginsCollection_Invoke,
|
|
|
|
HTMLPluginsCollection_get_length,
|
|
|
|
HTMLPluginsCollection_refresh
|
|
|
|
};
|
|
|
|
|
|
|
|
static const tid_t HTMLPluginsCollection_iface_tids[] = {
|
|
|
|
IHTMLPluginsCollection_tid,
|
|
|
|
0
|
|
|
|
};
|
|
|
|
static dispex_static_data_t HTMLPluginsCollection_dispex = {
|
|
|
|
NULL,
|
|
|
|
DispCPlugins_tid,
|
|
|
|
HTMLPluginsCollection_iface_tids
|
|
|
|
};
|
|
|
|
|
|
|
|
static HRESULT create_plugins_collection(OmNavigator *navigator, HTMLPluginsCollection **ret)
|
|
|
|
{
|
|
|
|
HTMLPluginsCollection *col;
|
|
|
|
|
|
|
|
col = heap_alloc_zero(sizeof(*col));
|
|
|
|
if(!col)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2010-12-08 01:09:32 +01:00
|
|
|
col->IHTMLPluginsCollection_iface.lpVtbl = &HTMLPluginsCollectionVtbl;
|
2010-11-08 12:48:55 +01:00
|
|
|
col->ref = 1;
|
|
|
|
col->navigator = navigator;
|
|
|
|
|
2010-12-08 01:09:32 +01:00
|
|
|
init_dispex(&col->dispex, (IUnknown*)&col->IHTMLPluginsCollection_iface,
|
|
|
|
&HTMLPluginsCollection_dispex);
|
2010-11-08 12:48:55 +01:00
|
|
|
|
|
|
|
*ret = col;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2011-05-31 12:19:40 +02:00
|
|
|
struct HTMLMimeTypesCollection {
|
2011-05-31 12:20:15 +02:00
|
|
|
DispatchEx dispex;
|
2011-05-31 12:19:40 +02:00
|
|
|
IHTMLMimeTypesCollection IHTMLMimeTypesCollection_iface;
|
|
|
|
|
|
|
|
LONG ref;
|
|
|
|
|
|
|
|
OmNavigator *navigator;
|
|
|
|
};
|
|
|
|
|
|
|
|
static inline HTMLMimeTypesCollection *impl_from_IHTMLMimeTypesCollection(IHTMLMimeTypesCollection *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLMimeTypesCollection, IHTMLMimeTypesCollection_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLMimeTypesCollection_QueryInterface(IHTMLMimeTypesCollection *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLMimeTypesCollection *This = impl_from_IHTMLMimeTypesCollection(iface);
|
|
|
|
|
2015-01-08 14:42:10 +01:00
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
|
|
|
|
|
2011-05-31 12:19:40 +02:00
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
|
|
|
*ppv = &This->IHTMLMimeTypesCollection_iface;
|
|
|
|
}else if(IsEqualGUID(&IID_IHTMLMimeTypesCollection, riid)) {
|
|
|
|
*ppv = &This->IHTMLMimeTypesCollection_iface;
|
2011-05-31 12:20:15 +02:00
|
|
|
}else if(dispex_query_interface(&This->dispex, riid, ppv)) {
|
|
|
|
return *ppv ? S_OK : E_NOINTERFACE;
|
2011-05-31 12:19:40 +02:00
|
|
|
}else {
|
2015-01-08 14:42:10 +01:00
|
|
|
WARN("Unsupported interface %s\n", debugstr_mshtml_guid(riid));
|
2011-05-31 12:19:40 +02:00
|
|
|
*ppv = NULL;
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLMimeTypesCollection_AddRef(IHTMLMimeTypesCollection *iface)
|
|
|
|
{
|
|
|
|
HTMLMimeTypesCollection *This = impl_from_IHTMLMimeTypesCollection(iface);
|
|
|
|
LONG ref = InterlockedIncrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLMimeTypesCollection_Release(IHTMLMimeTypesCollection *iface)
|
|
|
|
{
|
|
|
|
HTMLMimeTypesCollection *This = impl_from_IHTMLMimeTypesCollection(iface);
|
|
|
|
LONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
if(!ref) {
|
|
|
|
if(This->navigator)
|
|
|
|
This->navigator->mime_types = NULL;
|
2011-05-31 12:20:15 +02:00
|
|
|
release_dispex(&This->dispex);
|
2011-05-31 12:19:40 +02:00
|
|
|
heap_free(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLMimeTypesCollection_GetTypeInfoCount(IHTMLMimeTypesCollection *iface, UINT *pctinfo)
|
|
|
|
{
|
|
|
|
HTMLMimeTypesCollection *This = impl_from_IHTMLMimeTypesCollection(iface);
|
2011-05-31 12:20:15 +02:00
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
|
2011-05-31 12:19:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLMimeTypesCollection_GetTypeInfo(IHTMLMimeTypesCollection *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
|
|
|
HTMLMimeTypesCollection *This = impl_from_IHTMLMimeTypesCollection(iface);
|
2011-05-31 12:20:15 +02:00
|
|
|
return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
|
2011-05-31 12:19:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLMimeTypesCollection_GetIDsOfNames(IHTMLMimeTypesCollection *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
|
|
|
HTMLMimeTypesCollection *This = impl_from_IHTMLMimeTypesCollection(iface);
|
2011-05-31 12:20:15 +02:00
|
|
|
return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
|
|
|
|
lcid, rgDispId);
|
2011-05-31 12:19:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLMimeTypesCollection_Invoke(IHTMLMimeTypesCollection *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult,
|
|
|
|
EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
|
|
|
HTMLMimeTypesCollection *This = impl_from_IHTMLMimeTypesCollection(iface);
|
2011-05-31 12:20:15 +02:00
|
|
|
return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
|
|
|
|
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
2011-05-31 12:19:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLMimeTypesCollection_get_length(IHTMLMimeTypesCollection *iface, LONG *p)
|
|
|
|
{
|
|
|
|
HTMLMimeTypesCollection *This = impl_from_IHTMLMimeTypesCollection(iface);
|
2011-05-31 12:20:24 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
/* This is just a stub for compatibility with other browser in IE */
|
|
|
|
*p = 0;
|
|
|
|
return S_OK;
|
2011-05-31 12:19:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLMimeTypesCollectionVtbl HTMLMimeTypesCollectionVtbl = {
|
|
|
|
HTMLMimeTypesCollection_QueryInterface,
|
|
|
|
HTMLMimeTypesCollection_AddRef,
|
|
|
|
HTMLMimeTypesCollection_Release,
|
|
|
|
HTMLMimeTypesCollection_GetTypeInfoCount,
|
|
|
|
HTMLMimeTypesCollection_GetTypeInfo,
|
|
|
|
HTMLMimeTypesCollection_GetIDsOfNames,
|
|
|
|
HTMLMimeTypesCollection_Invoke,
|
|
|
|
HTMLMimeTypesCollection_get_length
|
|
|
|
};
|
|
|
|
|
2011-05-31 12:20:15 +02:00
|
|
|
static const tid_t HTMLMimeTypesCollection_iface_tids[] = {
|
|
|
|
IHTMLMimeTypesCollection_tid,
|
|
|
|
0
|
|
|
|
};
|
|
|
|
static dispex_static_data_t HTMLMimeTypesCollection_dispex = {
|
|
|
|
NULL,
|
|
|
|
IHTMLMimeTypesCollection_tid,
|
|
|
|
HTMLMimeTypesCollection_iface_tids
|
|
|
|
};
|
|
|
|
|
2011-05-31 12:19:40 +02:00
|
|
|
static HRESULT create_mime_types_collection(OmNavigator *navigator, HTMLMimeTypesCollection **ret)
|
|
|
|
{
|
|
|
|
HTMLMimeTypesCollection *col;
|
|
|
|
|
|
|
|
col = heap_alloc_zero(sizeof(*col));
|
|
|
|
if(!col)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
col->IHTMLMimeTypesCollection_iface.lpVtbl = &HTMLMimeTypesCollectionVtbl;
|
|
|
|
col->ref = 1;
|
|
|
|
col->navigator = navigator;
|
|
|
|
|
2011-05-31 12:20:15 +02:00
|
|
|
init_dispex(&col->dispex, (IUnknown*)&col->IHTMLMimeTypesCollection_iface,
|
|
|
|
&HTMLMimeTypesCollection_dispex);
|
|
|
|
|
2011-05-31 12:19:40 +02:00
|
|
|
*ret = col;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2012-05-02 10:28:09 +02:00
|
|
|
static inline OmNavigator *impl_from_IOmNavigator(IOmNavigator *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, OmNavigator, IOmNavigator_iface);
|
|
|
|
}
|
|
|
|
|
2008-04-07 12:34:24 +02:00
|
|
|
static HRESULT WINAPI OmNavigator_QueryInterface(IOmNavigator *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-04-07 12:34:24 +02:00
|
|
|
|
2015-01-08 14:42:10 +01:00
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
|
2008-04-07 12:34:24 +02:00
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
2010-12-06 23:32:14 +01:00
|
|
|
*ppv = &This->IOmNavigator_iface;
|
2008-04-07 12:34:24 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IOmNavigator, riid)) {
|
2010-12-06 23:32:14 +01:00
|
|
|
*ppv = &This->IOmNavigator_iface;
|
2008-06-30 21:38:23 +02:00
|
|
|
}else if(dispex_query_interface(&This->dispex, riid, ppv)) {
|
|
|
|
return *ppv ? S_OK : E_NOINTERFACE;
|
2015-01-08 14:42:10 +01:00
|
|
|
}else {
|
|
|
|
WARN("Unsupported interface %s\n", debugstr_mshtml_guid(riid));
|
|
|
|
*ppv = NULL;
|
|
|
|
return E_NOINTERFACE;
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
2015-01-08 14:42:10 +01:00
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI OmNavigator_AddRef(IOmNavigator *iface)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-04-07 12:34:24 +02:00
|
|
|
LONG ref = InterlockedIncrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI OmNavigator_Release(IOmNavigator *iface)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-04-07 12:34:24 +02:00
|
|
|
LONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
2009-08-31 20:47:55 +02:00
|
|
|
if(!ref) {
|
2011-05-31 12:19:55 +02:00
|
|
|
if(This->plugins)
|
2010-11-08 12:48:55 +01:00
|
|
|
This->plugins->navigator = NULL;
|
2011-05-31 12:19:40 +02:00
|
|
|
if(This->mime_types)
|
|
|
|
This->mime_types->navigator = NULL;
|
2009-08-31 20:47:55 +02:00
|
|
|
release_dispex(&This->dispex);
|
2008-04-07 12:34:24 +02:00
|
|
|
heap_free(This);
|
2009-08-31 20:47:55 +02:00
|
|
|
}
|
2008-04-07 12:34:24 +02:00
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_GetTypeInfoCount(IOmNavigator *iface, UINT *pctinfo)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-04-07 12:34:24 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, pctinfo);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_GetTypeInfo(IOmNavigator *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-04-18 22:33:44 +02:00
|
|
|
|
2010-12-31 11:07:33 +01:00
|
|
|
return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_GetIDsOfNames(IOmNavigator *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-04-18 22:33:44 +02:00
|
|
|
|
2010-12-31 11:07:33 +01:00
|
|
|
return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
|
|
|
|
lcid, rgDispId);
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_Invoke(IOmNavigator *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-04-18 22:33:44 +02:00
|
|
|
|
2010-12-31 11:07:33 +01:00
|
|
|
return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
|
|
|
|
pDispParams, pVarResult, pExcepInfo, puArgErr);
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_appCodeName(IOmNavigator *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-07-23 13:17:48 +02:00
|
|
|
|
|
|
|
static const WCHAR mozillaW[] = {'M','o','z','i','l','l','a',0};
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
*p = SysAllocString(mozillaW);
|
|
|
|
return S_OK;
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_appName(IOmNavigator *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2009-08-18 10:15:34 +02:00
|
|
|
|
|
|
|
static const WCHAR app_nameW[] =
|
|
|
|
{'M','i','c','r','o','s','o','f','t',' ',
|
|
|
|
'I','n','t','e','r','n','e','t',' ',
|
|
|
|
'E','x','p','l','o','r','e','r',0};
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
*p = SysAllocString(app_nameW);
|
|
|
|
if(!*p)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
return S_OK;
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_appVersion(IOmNavigator *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-10-13 21:51:42 +02:00
|
|
|
|
2010-03-13 16:46:18 +01:00
|
|
|
char user_agent[512];
|
|
|
|
DWORD size;
|
|
|
|
HRESULT hres;
|
2019-02-08 17:37:25 +01:00
|
|
|
const unsigned skip_prefix = 8; /* strlen("Mozilla/") */
|
2008-10-13 21:51:42 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2010-03-13 16:46:18 +01:00
|
|
|
size = sizeof(user_agent);
|
|
|
|
hres = ObtainUserAgentString(0, user_agent, &size);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
2019-02-08 17:37:25 +01:00
|
|
|
if(size <= skip_prefix) {
|
|
|
|
*p = NULL;
|
|
|
|
return S_OK;
|
2010-03-13 16:46:18 +01:00
|
|
|
}
|
|
|
|
|
2019-02-08 17:37:25 +01:00
|
|
|
size = MultiByteToWideChar(CP_ACP, 0, user_agent + skip_prefix, -1, NULL, 0);
|
2010-03-13 16:46:18 +01:00
|
|
|
*p = SysAllocStringLen(NULL, size-1);
|
2008-10-13 21:51:42 +02:00
|
|
|
if(!*p)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2019-02-08 17:37:25 +01:00
|
|
|
MultiByteToWideChar(CP_ACP, 0, user_agent + skip_prefix, -1, *p, size);
|
2008-10-13 21:51:42 +02:00
|
|
|
return S_OK;
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_userAgent(IOmNavigator *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2009-09-02 12:28:07 +02:00
|
|
|
char user_agent[512];
|
|
|
|
DWORD size;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
size = sizeof(user_agent);
|
|
|
|
hres = ObtainUserAgentString(0, user_agent, &size);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
size = MultiByteToWideChar(CP_ACP, 0, user_agent, -1, NULL, 0);
|
|
|
|
*p = SysAllocStringLen(NULL, size-1);
|
|
|
|
if(!*p)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
MultiByteToWideChar(CP_ACP, 0, user_agent, -1, *p, size);
|
|
|
|
return S_OK;
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_javaEnabled(IOmNavigator *iface, VARIANT_BOOL *enabled)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2010-12-17 03:38:56 +01:00
|
|
|
|
|
|
|
FIXME("(%p)->(%p) semi-stub\n", This, enabled);
|
|
|
|
|
2012-06-18 17:52:01 +02:00
|
|
|
*enabled = VARIANT_TRUE;
|
2010-12-17 03:38:56 +01:00
|
|
|
return S_OK;
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_taintEnabled(IOmNavigator *iface, VARIANT_BOOL *enabled)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-04-07 12:34:24 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, enabled);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_mimeTypes(IOmNavigator *iface, IHTMLMimeTypesCollection **p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2011-05-31 12:19:40 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
if(!This->mime_types) {
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
hres = create_mime_types_collection(This, &This->mime_types);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
}else {
|
|
|
|
IHTMLMimeTypesCollection_AddRef(&This->mime_types->IHTMLMimeTypesCollection_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
*p = &This->mime_types->IHTMLMimeTypesCollection_iface;
|
|
|
|
return S_OK;
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_plugins(IOmNavigator *iface, IHTMLPluginsCollection **p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2010-11-08 12:48:55 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
if(!This->plugins) {
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
hres = create_plugins_collection(This, &This->plugins);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
}else {
|
2010-12-08 01:09:32 +01:00
|
|
|
IHTMLPluginsCollection_AddRef(&This->plugins->IHTMLPluginsCollection_iface);
|
2010-11-08 12:48:55 +01:00
|
|
|
}
|
|
|
|
|
2010-12-08 01:09:32 +01:00
|
|
|
*p = &This->plugins->IHTMLPluginsCollection_iface;
|
2010-11-08 12:48:55 +01:00
|
|
|
return S_OK;
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_cookieEnabled(IOmNavigator *iface, VARIANT_BOOL *p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2012-04-05 13:58:29 +02:00
|
|
|
|
|
|
|
WARN("(%p)->(%p) semi-stub\n", This, p);
|
|
|
|
|
|
|
|
*p = VARIANT_TRUE;
|
|
|
|
return S_OK;
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_opsProfile(IOmNavigator *iface, IHTMLOpsProfile **p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-04-07 12:34:24 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_toString(IOmNavigator *iface, BSTR *String)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2009-08-31 20:44:47 +02:00
|
|
|
|
|
|
|
static const WCHAR objectW[] = {'[','o','b','j','e','c','t',']',0};
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, String);
|
|
|
|
|
|
|
|
if(!String)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
*String = SysAllocString(objectW);
|
|
|
|
return *String ? S_OK : E_OUTOFMEMORY;
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_cpuClass(IOmNavigator *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2011-05-11 16:58:35 +02:00
|
|
|
|
|
|
|
static const WCHAR cpu_classW[] =
|
|
|
|
#ifdef _WIN64
|
|
|
|
{'x','6','4',0};
|
|
|
|
#else
|
|
|
|
{'x','8','6',0};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
*p = SysAllocString(cpu_classW);
|
|
|
|
return *p ? S_OK : E_OUTOFMEMORY;
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
2011-07-31 16:45:26 +02:00
|
|
|
static HRESULT get_language_string(LCID lcid, BSTR *p)
|
|
|
|
{
|
|
|
|
BSTR ret;
|
|
|
|
int len;
|
|
|
|
|
|
|
|
len = LCIDToLocaleName(lcid, NULL, 0, 0);
|
|
|
|
if(!len) {
|
|
|
|
WARN("LCIDToLocaleName failed: %u\n", GetLastError());
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = SysAllocStringLen(NULL, len-1);
|
|
|
|
if(!ret)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
len = LCIDToLocaleName(lcid, ret, len, 0);
|
|
|
|
if(!len) {
|
|
|
|
WARN("LCIDToLocaleName failed: %u\n", GetLastError());
|
|
|
|
SysFreeString(ret);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
*p = ret;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2008-04-07 12:34:24 +02:00
|
|
|
static HRESULT WINAPI OmNavigator_get_systemLanguage(IOmNavigator *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2011-07-31 16:45:26 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return get_language_string(LOCALE_SYSTEM_DEFAULT, p);
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_browserLanguage(IOmNavigator *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2011-07-31 16:45:26 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return get_language_string(GetUserDefaultUILanguage(), p);
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_userLanguage(IOmNavigator *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2011-07-31 16:45:26 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return get_language_string(LOCALE_USER_DEFAULT, p);
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_platform(IOmNavigator *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-07-28 22:01:25 +02:00
|
|
|
|
2009-01-05 18:17:50 +01:00
|
|
|
#ifdef _WIN64
|
|
|
|
static const WCHAR platformW[] = {'W','i','n','6','4',0};
|
|
|
|
#else
|
|
|
|
static const WCHAR platformW[] = {'W','i','n','3','2',0};
|
|
|
|
#endif
|
2008-07-28 22:01:25 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2009-01-05 18:17:50 +01:00
|
|
|
*p = SysAllocString(platformW);
|
2008-07-28 22:01:25 +02:00
|
|
|
return S_OK;
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_appMinorVersion(IOmNavigator *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2011-07-31 16:46:01 +02:00
|
|
|
|
|
|
|
static const WCHAR zeroW[] = {'0',0};
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
/* NOTE: MSIE returns "0" or values like ";SP2;". Returning "0" should be enough. */
|
|
|
|
*p = SysAllocString(zeroW);
|
|
|
|
return S_OK;
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
2009-03-12 01:43:31 +01:00
|
|
|
static HRESULT WINAPI OmNavigator_get_connectionSpeed(IOmNavigator *iface, LONG *p)
|
2008-04-07 12:34:24 +02:00
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-04-07 12:34:24 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_onLine(IOmNavigator *iface, VARIANT_BOOL *p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2012-10-17 12:18:48 +02:00
|
|
|
|
|
|
|
WARN("(%p)->(%p) semi-stub, returning true\n", This, p);
|
|
|
|
|
|
|
|
*p = VARIANT_TRUE;
|
|
|
|
return S_OK;
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OmNavigator_get_userProfile(IOmNavigator *iface, IHTMLOpsProfile **p)
|
|
|
|
{
|
2010-12-06 23:32:14 +01:00
|
|
|
OmNavigator *This = impl_from_IOmNavigator(iface);
|
2008-04-07 12:34:24 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IOmNavigatorVtbl OmNavigatorVtbl = {
|
|
|
|
OmNavigator_QueryInterface,
|
|
|
|
OmNavigator_AddRef,
|
|
|
|
OmNavigator_Release,
|
|
|
|
OmNavigator_GetTypeInfoCount,
|
|
|
|
OmNavigator_GetTypeInfo,
|
|
|
|
OmNavigator_GetIDsOfNames,
|
|
|
|
OmNavigator_Invoke,
|
|
|
|
OmNavigator_get_appCodeName,
|
|
|
|
OmNavigator_get_appName,
|
|
|
|
OmNavigator_get_appVersion,
|
|
|
|
OmNavigator_get_userAgent,
|
|
|
|
OmNavigator_javaEnabled,
|
|
|
|
OmNavigator_taintEnabled,
|
|
|
|
OmNavigator_get_mimeTypes,
|
|
|
|
OmNavigator_get_plugins,
|
|
|
|
OmNavigator_get_cookieEnabled,
|
|
|
|
OmNavigator_get_opsProfile,
|
|
|
|
OmNavigator_toString,
|
|
|
|
OmNavigator_get_cpuClass,
|
|
|
|
OmNavigator_get_systemLanguage,
|
|
|
|
OmNavigator_get_browserLanguage,
|
|
|
|
OmNavigator_get_userLanguage,
|
|
|
|
OmNavigator_get_platform,
|
|
|
|
OmNavigator_get_appMinorVersion,
|
|
|
|
OmNavigator_get_connectionSpeed,
|
|
|
|
OmNavigator_get_onLine,
|
|
|
|
OmNavigator_get_userProfile
|
|
|
|
};
|
|
|
|
|
2008-05-06 16:04:58 +02:00
|
|
|
static const tid_t OmNavigator_iface_tids[] = {
|
|
|
|
IOmNavigator_tid,
|
|
|
|
0
|
|
|
|
};
|
2008-04-19 12:55:24 +02:00
|
|
|
static dispex_static_data_t OmNavigator_dispex = {
|
2008-04-29 01:38:09 +02:00
|
|
|
NULL,
|
2009-06-22 19:25:58 +02:00
|
|
|
DispHTMLNavigator_tid,
|
2008-05-06 16:04:58 +02:00
|
|
|
OmNavigator_iface_tids
|
2008-04-19 12:55:24 +02:00
|
|
|
};
|
|
|
|
|
2008-04-07 12:34:24 +02:00
|
|
|
IOmNavigator *OmNavigator_Create(void)
|
|
|
|
{
|
|
|
|
OmNavigator *ret;
|
|
|
|
|
2008-06-19 00:05:23 +02:00
|
|
|
ret = heap_alloc_zero(sizeof(*ret));
|
2012-10-19 11:57:47 +02:00
|
|
|
if(!ret)
|
|
|
|
return NULL;
|
|
|
|
|
2010-12-06 23:32:14 +01:00
|
|
|
ret->IOmNavigator_iface.lpVtbl = &OmNavigatorVtbl;
|
2008-04-07 12:34:24 +02:00
|
|
|
ret->ref = 1;
|
|
|
|
|
2010-12-06 23:32:14 +01:00
|
|
|
init_dispex(&ret->dispex, (IUnknown*)&ret->IOmNavigator_iface, &OmNavigator_dispex);
|
2008-04-17 02:31:43 +02:00
|
|
|
|
2010-12-06 23:32:14 +01:00
|
|
|
return &ret->IOmNavigator_iface;
|
2008-04-07 12:34:24 +02:00
|
|
|
}
|
2018-06-14 17:35:14 +02:00
|
|
|
|
2018-07-11 21:37:59 +02:00
|
|
|
typedef struct {
|
|
|
|
DispatchEx dispex;
|
|
|
|
IHTMLPerformanceTiming IHTMLPerformanceTiming_iface;
|
|
|
|
|
|
|
|
LONG ref;
|
|
|
|
} HTMLPerformanceTiming;
|
|
|
|
|
|
|
|
static inline HTMLPerformanceTiming *impl_from_IHTMLPerformanceTiming(IHTMLPerformanceTiming *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLPerformanceTiming, IHTMLPerformanceTiming_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceTiming_QueryInterface(IHTMLPerformanceTiming *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
|
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
|
|
|
*ppv = &This->IHTMLPerformanceTiming_iface;
|
|
|
|
}else if(IsEqualGUID(&IID_IHTMLPerformanceTiming, riid)) {
|
|
|
|
*ppv = &This->IHTMLPerformanceTiming_iface;
|
|
|
|
}else if(dispex_query_interface(&This->dispex, riid, ppv)) {
|
|
|
|
return *ppv ? S_OK : E_NOINTERFACE;
|
|
|
|
}else {
|
|
|
|
WARN("Unsupported interface %s\n", debugstr_mshtml_guid(riid));
|
|
|
|
*ppv = NULL;
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLPerformanceTiming_AddRef(IHTMLPerformanceTiming *iface)
|
|
|
|
{
|
|
|
|
HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
|
|
|
|
LONG ref = InterlockedIncrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLPerformanceTiming_Release(IHTMLPerformanceTiming *iface)
|
|
|
|
{
|
|
|
|
HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
|
|
|
|
LONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
if(!ref) {
|
|
|
|
release_dispex(&This->dispex);
|
|
|
|
heap_free(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceTiming_GetTypeInfoCount(IHTMLPerformanceTiming *iface, UINT *pctinfo)
|
|
|
|
{
|
|
|
|
HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, pctinfo);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceTiming_GetTypeInfo(IHTMLPerformanceTiming *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
|
|
|
HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
|
|
|
|
|
|
|
|
return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceTiming_GetIDsOfNames(IHTMLPerformanceTiming *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
|
|
|
HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
|
|
|
|
|
|
|
|
return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
|
|
|
|
lcid, rgDispId);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceTiming_Invoke(IHTMLPerformanceTiming *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
|
|
|
HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
|
|
|
|
|
|
|
|
return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
|
|
|
|
pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
}
|
|
|
|
|
|
|
|
#define TIMING_FAKE_TIMESTAMP 0xdeadbeef
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceTiming_get_navigationStart(IHTMLPerformanceTiming *iface, ULONGLONG *p)
|
|
|
|
{
|
|
|
|
HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p) returning fake value\n", This, p);
|
|
|
|
|
|
|
|
*p = TIMING_FAKE_TIMESTAMP;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceTiming_get_unloadEventStart(IHTMLPerformanceTiming *iface, ULONGLONG *p)
|
|
|
|
{
|
|
|
|
HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p) returning fake value\n", This, p);
|
|
|
|
|
|
|
|
*p = TIMING_FAKE_TIMESTAMP;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceTiming_get_unloadEventEnd(IHTMLPerformanceTiming *iface, ULONGLONG *p)
|
|
|
|
{
|
|
|
|
HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p) returning fake value\n", This, p);
|
|
|
|
|
|
|
|
*p = TIMING_FAKE_TIMESTAMP;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceTiming_get_redirectStart(IHTMLPerformanceTiming *iface, ULONGLONG *p)
|
|
|
|
{
|
|
|
|
HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p) returning fake value\n", This, p);
|
|
|
|
|
|
|
|
*p = TIMING_FAKE_TIMESTAMP;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceTiming_get_redirectEnd(IHTMLPerformanceTiming *iface, ULONGLONG *p)
|
|
|
|
{
|
|
|
|
HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p) returning fake value\n", This, p);
|
|
|
|
|
|
|
|
*p = TIMING_FAKE_TIMESTAMP;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceTiming_get_fetchStart(IHTMLPerformanceTiming *iface, ULONGLONG *p)
|
|
|
|
{
|
|
|
|
HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p) returning fake value\n", This, p);
|
|
|
|
|
|
|
|
*p = TIMING_FAKE_TIMESTAMP;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceTiming_get_domainLookupStart(IHTMLPerformanceTiming *iface, ULONGLONG *p)
|
|
|
|
{
|
|
|
|
HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p) returning fake value\n", This, p);
|
|
|
|
|
|
|
|
*p = TIMING_FAKE_TIMESTAMP;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceTiming_get_domainLookupEnd(IHTMLPerformanceTiming *iface, ULONGLONG *p)
|
|
|
|
{
|
|
|
|
HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p) returning fake value\n", This, p);
|
|
|
|
|
|
|
|
*p = TIMING_FAKE_TIMESTAMP;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceTiming_get_connectStart(IHTMLPerformanceTiming *iface, ULONGLONG *p)
|
|
|
|
{
|
|
|
|
HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p) returning fake value\n", This, p);
|
|
|
|
|
|
|
|
*p = TIMING_FAKE_TIMESTAMP;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceTiming_get_connectEnd(IHTMLPerformanceTiming *iface, ULONGLONG *p)
|
|
|
|
{
|
|
|
|
HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p) returning fake value\n", This, p);
|
|
|
|
|
|
|
|
*p = TIMING_FAKE_TIMESTAMP;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceTiming_get_requestStart(IHTMLPerformanceTiming *iface, ULONGLONG *p)
|
|
|
|
{
|
|
|
|
HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p) returning fake value\n", This, p);
|
|
|
|
|
|
|
|
*p = TIMING_FAKE_TIMESTAMP;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceTiming_get_responseStart(IHTMLPerformanceTiming *iface, ULONGLONG *p)
|
|
|
|
{
|
|
|
|
HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p) returning fake value\n", This, p);
|
|
|
|
|
|
|
|
*p = TIMING_FAKE_TIMESTAMP;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceTiming_get_responseEnd(IHTMLPerformanceTiming *iface, ULONGLONG *p)
|
|
|
|
{
|
|
|
|
HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p) returning fake value\n", This, p);
|
|
|
|
|
|
|
|
*p = TIMING_FAKE_TIMESTAMP;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceTiming_get_domLoading(IHTMLPerformanceTiming *iface, ULONGLONG *p)
|
|
|
|
{
|
|
|
|
HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p) returning fake value\n", This, p);
|
|
|
|
|
|
|
|
*p = TIMING_FAKE_TIMESTAMP;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceTiming_get_domInteractive(IHTMLPerformanceTiming *iface, ULONGLONG *p)
|
|
|
|
{
|
|
|
|
HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p) returning fake value\n", This, p);
|
|
|
|
|
|
|
|
*p = TIMING_FAKE_TIMESTAMP;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceTiming_get_domContentLoadedEventStart(IHTMLPerformanceTiming *iface, ULONGLONG *p)
|
|
|
|
{
|
|
|
|
HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p) returning fake value\n", This, p);
|
|
|
|
|
|
|
|
*p = TIMING_FAKE_TIMESTAMP;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceTiming_get_domContentLoadedEventEnd(IHTMLPerformanceTiming *iface, ULONGLONG *p)
|
|
|
|
{
|
|
|
|
HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p) returning fake value\n", This, p);
|
|
|
|
|
|
|
|
*p = TIMING_FAKE_TIMESTAMP;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceTiming_get_domComplete(IHTMLPerformanceTiming *iface, ULONGLONG *p)
|
|
|
|
{
|
|
|
|
HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p) returning fake value\n", This, p);
|
|
|
|
|
|
|
|
*p = TIMING_FAKE_TIMESTAMP;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceTiming_get_loadEventStart(IHTMLPerformanceTiming *iface, ULONGLONG *p)
|
|
|
|
{
|
|
|
|
HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p) returning fake value\n", This, p);
|
|
|
|
|
|
|
|
*p = TIMING_FAKE_TIMESTAMP;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceTiming_get_loadEventEnd(IHTMLPerformanceTiming *iface, ULONGLONG *p)
|
|
|
|
{
|
|
|
|
HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p) returning fake value\n", This, p);
|
|
|
|
|
|
|
|
*p = TIMING_FAKE_TIMESTAMP;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceTiming_get_msFirstPaint(IHTMLPerformanceTiming *iface, ULONGLONG *p)
|
|
|
|
{
|
|
|
|
HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p) returning fake value\n", This, p);
|
|
|
|
|
|
|
|
*p = TIMING_FAKE_TIMESTAMP;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceTiming_toString(IHTMLPerformanceTiming *iface, BSTR *string)
|
|
|
|
{
|
|
|
|
HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, string);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceTiming_toJSON(IHTMLPerformanceTiming *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLPerformanceTimingVtbl HTMLPerformanceTimingVtbl = {
|
|
|
|
HTMLPerformanceTiming_QueryInterface,
|
|
|
|
HTMLPerformanceTiming_AddRef,
|
|
|
|
HTMLPerformanceTiming_Release,
|
|
|
|
HTMLPerformanceTiming_GetTypeInfoCount,
|
|
|
|
HTMLPerformanceTiming_GetTypeInfo,
|
|
|
|
HTMLPerformanceTiming_GetIDsOfNames,
|
|
|
|
HTMLPerformanceTiming_Invoke,
|
|
|
|
HTMLPerformanceTiming_get_navigationStart,
|
|
|
|
HTMLPerformanceTiming_get_unloadEventStart,
|
|
|
|
HTMLPerformanceTiming_get_unloadEventEnd,
|
|
|
|
HTMLPerformanceTiming_get_redirectStart,
|
|
|
|
HTMLPerformanceTiming_get_redirectEnd,
|
|
|
|
HTMLPerformanceTiming_get_fetchStart,
|
|
|
|
HTMLPerformanceTiming_get_domainLookupStart,
|
|
|
|
HTMLPerformanceTiming_get_domainLookupEnd,
|
|
|
|
HTMLPerformanceTiming_get_connectStart,
|
|
|
|
HTMLPerformanceTiming_get_connectEnd,
|
|
|
|
HTMLPerformanceTiming_get_requestStart,
|
|
|
|
HTMLPerformanceTiming_get_responseStart,
|
|
|
|
HTMLPerformanceTiming_get_responseEnd,
|
|
|
|
HTMLPerformanceTiming_get_domLoading,
|
|
|
|
HTMLPerformanceTiming_get_domInteractive,
|
|
|
|
HTMLPerformanceTiming_get_domContentLoadedEventStart,
|
|
|
|
HTMLPerformanceTiming_get_domContentLoadedEventEnd,
|
|
|
|
HTMLPerformanceTiming_get_domComplete,
|
|
|
|
HTMLPerformanceTiming_get_loadEventStart,
|
|
|
|
HTMLPerformanceTiming_get_loadEventEnd,
|
|
|
|
HTMLPerformanceTiming_get_msFirstPaint,
|
|
|
|
HTMLPerformanceTiming_toString,
|
|
|
|
HTMLPerformanceTiming_toJSON
|
|
|
|
};
|
|
|
|
|
|
|
|
static const tid_t HTMLPerformanceTiming_iface_tids[] = {
|
|
|
|
IHTMLPerformanceTiming_tid,
|
|
|
|
0
|
|
|
|
};
|
|
|
|
static dispex_static_data_t HTMLPerformanceTiming_dispex = {
|
|
|
|
NULL,
|
|
|
|
IHTMLPerformanceTiming_tid,
|
|
|
|
HTMLPerformanceTiming_iface_tids
|
|
|
|
};
|
|
|
|
|
2018-07-11 21:37:48 +02:00
|
|
|
typedef struct {
|
|
|
|
DispatchEx dispex;
|
|
|
|
IHTMLPerformanceNavigation IHTMLPerformanceNavigation_iface;
|
|
|
|
|
|
|
|
LONG ref;
|
|
|
|
} HTMLPerformanceNavigation;
|
|
|
|
|
|
|
|
static inline HTMLPerformanceNavigation *impl_from_IHTMLPerformanceNavigation(IHTMLPerformanceNavigation *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLPerformanceNavigation, IHTMLPerformanceNavigation_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceNavigation_QueryInterface(IHTMLPerformanceNavigation *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLPerformanceNavigation *This = impl_from_IHTMLPerformanceNavigation(iface);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
|
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
|
|
|
*ppv = &This->IHTMLPerformanceNavigation_iface;
|
|
|
|
}else if(IsEqualGUID(&IID_IHTMLPerformanceNavigation, riid)) {
|
|
|
|
*ppv = &This->IHTMLPerformanceNavigation_iface;
|
|
|
|
}else if(dispex_query_interface(&This->dispex, riid, ppv)) {
|
|
|
|
return *ppv ? S_OK : E_NOINTERFACE;
|
|
|
|
}else {
|
|
|
|
WARN("Unsupported interface %s\n", debugstr_mshtml_guid(riid));
|
|
|
|
*ppv = NULL;
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLPerformanceNavigation_AddRef(IHTMLPerformanceNavigation *iface)
|
|
|
|
{
|
|
|
|
HTMLPerformanceNavigation *This = impl_from_IHTMLPerformanceNavigation(iface);
|
|
|
|
LONG ref = InterlockedIncrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLPerformanceNavigation_Release(IHTMLPerformanceNavigation *iface)
|
|
|
|
{
|
|
|
|
HTMLPerformanceNavigation *This = impl_from_IHTMLPerformanceNavigation(iface);
|
|
|
|
LONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
if(!ref) {
|
|
|
|
release_dispex(&This->dispex);
|
|
|
|
heap_free(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceNavigation_GetTypeInfoCount(IHTMLPerformanceNavigation *iface, UINT *pctinfo)
|
|
|
|
{
|
|
|
|
HTMLPerformanceNavigation *This = impl_from_IHTMLPerformanceNavigation(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, pctinfo);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceNavigation_GetTypeInfo(IHTMLPerformanceNavigation *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
|
|
|
HTMLPerformanceNavigation *This = impl_from_IHTMLPerformanceNavigation(iface);
|
|
|
|
|
|
|
|
return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceNavigation_GetIDsOfNames(IHTMLPerformanceNavigation *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
|
|
|
HTMLPerformanceNavigation *This = impl_from_IHTMLPerformanceNavigation(iface);
|
|
|
|
|
|
|
|
return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
|
|
|
|
lcid, rgDispId);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceNavigation_Invoke(IHTMLPerformanceNavigation *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
|
|
|
HTMLPerformanceNavigation *This = impl_from_IHTMLPerformanceNavigation(iface);
|
|
|
|
|
|
|
|
return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
|
|
|
|
pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceNavigation_get_type(IHTMLPerformanceNavigation *iface, ULONG *p)
|
|
|
|
{
|
|
|
|
HTMLPerformanceNavigation *This = impl_from_IHTMLPerformanceNavigation(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p) returning TYPE_NAVIGATE\n", This, p);
|
|
|
|
|
|
|
|
*p = 0; /* TYPE_NAVIGATE */
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceNavigation_get_redirectCount(IHTMLPerformanceNavigation *iface, ULONG *p)
|
|
|
|
{
|
|
|
|
HTMLPerformanceNavigation *This = impl_from_IHTMLPerformanceNavigation(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceNavigation_toString(IHTMLPerformanceNavigation *iface, BSTR *string)
|
|
|
|
{
|
|
|
|
HTMLPerformanceNavigation *This = impl_from_IHTMLPerformanceNavigation(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, string);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformanceNavigation_toJSON(IHTMLPerformanceNavigation *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLPerformanceNavigation *This = impl_from_IHTMLPerformanceNavigation(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLPerformanceNavigationVtbl HTMLPerformanceNavigationVtbl = {
|
|
|
|
HTMLPerformanceNavigation_QueryInterface,
|
|
|
|
HTMLPerformanceNavigation_AddRef,
|
|
|
|
HTMLPerformanceNavigation_Release,
|
|
|
|
HTMLPerformanceNavigation_GetTypeInfoCount,
|
|
|
|
HTMLPerformanceNavigation_GetTypeInfo,
|
|
|
|
HTMLPerformanceNavigation_GetIDsOfNames,
|
|
|
|
HTMLPerformanceNavigation_Invoke,
|
|
|
|
HTMLPerformanceNavigation_get_type,
|
|
|
|
HTMLPerformanceNavigation_get_redirectCount,
|
|
|
|
HTMLPerformanceNavigation_toString,
|
|
|
|
HTMLPerformanceNavigation_toJSON
|
|
|
|
};
|
|
|
|
|
|
|
|
static const tid_t HTMLPerformanceNavigation_iface_tids[] = {
|
|
|
|
IHTMLPerformanceNavigation_tid,
|
|
|
|
0
|
|
|
|
};
|
|
|
|
static dispex_static_data_t HTMLPerformanceNavigation_dispex = {
|
|
|
|
NULL,
|
|
|
|
IHTMLPerformanceNavigation_tid,
|
|
|
|
HTMLPerformanceNavigation_iface_tids
|
|
|
|
};
|
|
|
|
|
2018-06-14 17:35:14 +02:00
|
|
|
typedef struct {
|
|
|
|
DispatchEx dispex;
|
|
|
|
IHTMLPerformance IHTMLPerformance_iface;
|
2018-07-11 21:37:48 +02:00
|
|
|
|
2018-06-14 17:35:14 +02:00
|
|
|
LONG ref;
|
2018-07-11 21:37:48 +02:00
|
|
|
|
|
|
|
IHTMLPerformanceNavigation *navigation;
|
2018-07-11 21:37:59 +02:00
|
|
|
IHTMLPerformanceTiming *timing;
|
2018-06-14 17:35:14 +02:00
|
|
|
} HTMLPerformance;
|
|
|
|
|
|
|
|
static inline HTMLPerformance *impl_from_IHTMLPerformance(IHTMLPerformance *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLPerformance, IHTMLPerformance_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformance_QueryInterface(IHTMLPerformance *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLPerformance *This = impl_from_IHTMLPerformance(iface);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
|
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
|
|
|
*ppv = &This->IHTMLPerformance_iface;
|
|
|
|
}else if(IsEqualGUID(&IID_IHTMLPerformance, riid)) {
|
|
|
|
*ppv = &This->IHTMLPerformance_iface;
|
|
|
|
}else if(dispex_query_interface(&This->dispex, riid, ppv)) {
|
|
|
|
return *ppv ? S_OK : E_NOINTERFACE;
|
|
|
|
}else {
|
|
|
|
WARN("Unsupported interface %s\n", debugstr_mshtml_guid(riid));
|
|
|
|
*ppv = NULL;
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLPerformance_AddRef(IHTMLPerformance *iface)
|
|
|
|
{
|
|
|
|
HTMLPerformance *This = impl_from_IHTMLPerformance(iface);
|
|
|
|
LONG ref = InterlockedIncrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLPerformance_Release(IHTMLPerformance *iface)
|
|
|
|
{
|
|
|
|
HTMLPerformance *This = impl_from_IHTMLPerformance(iface);
|
|
|
|
LONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
if(!ref) {
|
2018-07-11 21:37:59 +02:00
|
|
|
if(This->timing)
|
|
|
|
IHTMLPerformanceTiming_Release(This->timing);
|
2018-07-11 21:37:48 +02:00
|
|
|
if(This->navigation)
|
|
|
|
IHTMLPerformanceNavigation_Release(This->navigation);
|
2018-06-14 17:35:14 +02:00
|
|
|
release_dispex(&This->dispex);
|
|
|
|
heap_free(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformance_GetTypeInfoCount(IHTMLPerformance *iface, UINT *pctinfo)
|
|
|
|
{
|
|
|
|
HTMLPerformance *This = impl_from_IHTMLPerformance(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, pctinfo);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformance_GetTypeInfo(IHTMLPerformance *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
|
|
|
HTMLPerformance *This = impl_from_IHTMLPerformance(iface);
|
|
|
|
|
|
|
|
return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformance_GetIDsOfNames(IHTMLPerformance *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
|
|
|
HTMLPerformance *This = impl_from_IHTMLPerformance(iface);
|
|
|
|
|
|
|
|
return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
|
|
|
|
lcid, rgDispId);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformance_Invoke(IHTMLPerformance *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
|
|
|
HTMLPerformance *This = impl_from_IHTMLPerformance(iface);
|
|
|
|
|
|
|
|
return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
|
|
|
|
pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformance_get_navigation(IHTMLPerformance *iface,
|
|
|
|
IHTMLPerformanceNavigation **p)
|
|
|
|
{
|
|
|
|
HTMLPerformance *This = impl_from_IHTMLPerformance(iface);
|
2018-07-11 21:37:48 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
if(!This->navigation) {
|
|
|
|
HTMLPerformanceNavigation *navigation;
|
|
|
|
|
|
|
|
navigation = heap_alloc_zero(sizeof(*navigation));
|
|
|
|
if(!navigation)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
navigation->IHTMLPerformanceNavigation_iface.lpVtbl = &HTMLPerformanceNavigationVtbl;
|
|
|
|
navigation->ref = 1;
|
|
|
|
init_dispex(&navigation->dispex, (IUnknown*)&navigation->IHTMLPerformanceNavigation_iface,
|
|
|
|
&HTMLPerformanceNavigation_dispex);
|
|
|
|
|
|
|
|
This->navigation = &navigation->IHTMLPerformanceNavigation_iface;
|
|
|
|
}
|
|
|
|
|
|
|
|
IHTMLPerformanceNavigation_AddRef(*p = This->navigation);
|
|
|
|
return S_OK;
|
2018-06-14 17:35:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformance_get_timing(IHTMLPerformance *iface, IHTMLPerformanceTiming **p)
|
|
|
|
{
|
|
|
|
HTMLPerformance *This = impl_from_IHTMLPerformance(iface);
|
2018-07-11 21:37:59 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
if(!This->timing) {
|
|
|
|
HTMLPerformanceTiming *timing;
|
|
|
|
|
|
|
|
timing = heap_alloc_zero(sizeof(*timing));
|
|
|
|
if(!timing)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
timing->IHTMLPerformanceTiming_iface.lpVtbl = &HTMLPerformanceTimingVtbl;
|
|
|
|
timing->ref = 1;
|
|
|
|
init_dispex(&timing->dispex, (IUnknown*)&timing->IHTMLPerformanceTiming_iface,
|
|
|
|
&HTMLPerformanceTiming_dispex);
|
|
|
|
|
|
|
|
This->timing = &timing->IHTMLPerformanceTiming_iface;
|
|
|
|
}
|
|
|
|
|
|
|
|
IHTMLPerformanceTiming_AddRef(*p = This->timing);
|
|
|
|
return S_OK;
|
2018-06-14 17:35:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformance_toString(IHTMLPerformance *iface, BSTR *string)
|
|
|
|
{
|
|
|
|
HTMLPerformance *This = impl_from_IHTMLPerformance(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, string);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPerformance_toJSON(IHTMLPerformance *iface, VARIANT *var)
|
|
|
|
{
|
|
|
|
HTMLPerformance *This = impl_from_IHTMLPerformance(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, var);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLPerformanceVtbl HTMLPerformanceVtbl = {
|
|
|
|
HTMLPerformance_QueryInterface,
|
|
|
|
HTMLPerformance_AddRef,
|
|
|
|
HTMLPerformance_Release,
|
|
|
|
HTMLPerformance_GetTypeInfoCount,
|
|
|
|
HTMLPerformance_GetTypeInfo,
|
|
|
|
HTMLPerformance_GetIDsOfNames,
|
|
|
|
HTMLPerformance_Invoke,
|
|
|
|
HTMLPerformance_get_navigation,
|
|
|
|
HTMLPerformance_get_timing,
|
|
|
|
HTMLPerformance_toString,
|
|
|
|
HTMLPerformance_toJSON
|
|
|
|
};
|
|
|
|
|
|
|
|
static const tid_t HTMLPerformance_iface_tids[] = {
|
|
|
|
IHTMLPerformance_tid,
|
|
|
|
0
|
|
|
|
};
|
|
|
|
static dispex_static_data_t HTMLPerformance_dispex = {
|
|
|
|
NULL,
|
|
|
|
IHTMLPerformance_tid,
|
|
|
|
HTMLPerformance_iface_tids
|
|
|
|
};
|
|
|
|
|
|
|
|
HRESULT create_performance(IHTMLPerformance **ret)
|
|
|
|
{
|
|
|
|
HTMLPerformance *performance;
|
|
|
|
|
|
|
|
performance = heap_alloc_zero(sizeof(*performance));
|
|
|
|
if(!performance)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
performance->IHTMLPerformance_iface.lpVtbl = &HTMLPerformanceVtbl;
|
|
|
|
performance->ref = 1;
|
|
|
|
|
|
|
|
init_dispex(&performance->dispex, (IUnknown*)&performance->IHTMLPerformance_iface,
|
|
|
|
&HTMLPerformance_dispex);
|
|
|
|
|
|
|
|
*ret = &performance->IHTMLPerformance_iface;
|
|
|
|
return S_OK;
|
|
|
|
}
|
2020-07-02 16:56:48 +02:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
DispatchEx dispex;
|
|
|
|
IHTMLNamespaceCollection IHTMLNamespaceCollection_iface;
|
|
|
|
|
|
|
|
LONG ref;
|
|
|
|
} HTMLNamespaceCollection;
|
|
|
|
|
|
|
|
static inline HTMLNamespaceCollection *impl_from_IHTMLNamespaceCollection(IHTMLNamespaceCollection *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLNamespaceCollection, IHTMLNamespaceCollection_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLNamespaceCollection_QueryInterface(IHTMLNamespaceCollection *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLNamespaceCollection *This = impl_from_IHTMLNamespaceCollection(iface);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
|
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
|
|
|
*ppv = &This->IHTMLNamespaceCollection_iface;
|
|
|
|
}else if(IsEqualGUID(&IID_IHTMLNamespaceCollection, riid)) {
|
|
|
|
*ppv = &This->IHTMLNamespaceCollection_iface;
|
|
|
|
}else if(dispex_query_interface(&This->dispex, riid, ppv)) {
|
|
|
|
return *ppv ? S_OK : E_NOINTERFACE;
|
|
|
|
}else {
|
|
|
|
WARN("Unsupported interface %s\n", debugstr_mshtml_guid(riid));
|
|
|
|
*ppv = NULL;
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLNamespaceCollection_AddRef(IHTMLNamespaceCollection *iface)
|
|
|
|
{
|
|
|
|
HTMLNamespaceCollection *This = impl_from_IHTMLNamespaceCollection(iface);
|
|
|
|
LONG ref = InterlockedIncrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLNamespaceCollection_Release(IHTMLNamespaceCollection *iface)
|
|
|
|
{
|
|
|
|
HTMLNamespaceCollection *This = impl_from_IHTMLNamespaceCollection(iface);
|
|
|
|
LONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
if(!ref) {
|
|
|
|
release_dispex(&This->dispex);
|
|
|
|
heap_free(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLNamespaceCollection_GetTypeInfoCount(IHTMLNamespaceCollection *iface, UINT *pctinfo)
|
|
|
|
{
|
|
|
|
HTMLNamespaceCollection *This = impl_from_IHTMLNamespaceCollection(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, pctinfo);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLNamespaceCollection_GetTypeInfo(IHTMLNamespaceCollection *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
|
|
|
HTMLNamespaceCollection *This = impl_from_IHTMLNamespaceCollection(iface);
|
|
|
|
|
|
|
|
return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLNamespaceCollection_GetIDsOfNames(IHTMLNamespaceCollection *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
|
|
|
HTMLNamespaceCollection *This = impl_from_IHTMLNamespaceCollection(iface);
|
|
|
|
|
|
|
|
return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
|
|
|
|
lcid, rgDispId);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLNamespaceCollection_Invoke(IHTMLNamespaceCollection *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
|
|
|
HTMLNamespaceCollection *This = impl_from_IHTMLNamespaceCollection(iface);
|
|
|
|
|
|
|
|
return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
|
|
|
|
pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLNamespaceCollection_get_length(IHTMLNamespaceCollection *iface, LONG *p)
|
|
|
|
{
|
|
|
|
HTMLNamespaceCollection *This = impl_from_IHTMLNamespaceCollection(iface);
|
|
|
|
FIXME("(%p)->(%p) returning 0\n", This, p);
|
|
|
|
*p = 0;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLNamespaceCollection_item(IHTMLNamespaceCollection *iface, VARIANT index, IDispatch **p)
|
|
|
|
{
|
|
|
|
HTMLNamespaceCollection *This = impl_from_IHTMLNamespaceCollection(iface);
|
|
|
|
FIXME("(%p)->(%s %p)\n", This, debugstr_variant(&index), p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLNamespaceCollection_add(IHTMLNamespaceCollection *iface, BSTR namespace, BSTR urn,
|
|
|
|
VARIANT implementation_url, IDispatch **p)
|
|
|
|
{
|
|
|
|
HTMLNamespaceCollection *This = impl_from_IHTMLNamespaceCollection(iface);
|
|
|
|
FIXME("(%p)->(%s %s %s %p)\n", This, debugstr_w(namespace), debugstr_w(urn), debugstr_variant(&implementation_url), p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLNamespaceCollectionVtbl HTMLNamespaceCollectionVtbl = {
|
|
|
|
HTMLNamespaceCollection_QueryInterface,
|
|
|
|
HTMLNamespaceCollection_AddRef,
|
|
|
|
HTMLNamespaceCollection_Release,
|
|
|
|
HTMLNamespaceCollection_GetTypeInfoCount,
|
|
|
|
HTMLNamespaceCollection_GetTypeInfo,
|
|
|
|
HTMLNamespaceCollection_GetIDsOfNames,
|
|
|
|
HTMLNamespaceCollection_Invoke,
|
|
|
|
HTMLNamespaceCollection_get_length,
|
|
|
|
HTMLNamespaceCollection_item,
|
|
|
|
HTMLNamespaceCollection_add
|
|
|
|
};
|
|
|
|
|
|
|
|
static const tid_t HTMLNamespaceCollection_iface_tids[] = {
|
|
|
|
IHTMLNamespaceCollection_tid,
|
|
|
|
0
|
|
|
|
};
|
|
|
|
static dispex_static_data_t HTMLNamespaceCollection_dispex = {
|
|
|
|
NULL,
|
|
|
|
DispHTMLNamespaceCollection_tid,
|
|
|
|
HTMLNamespaceCollection_iface_tids
|
|
|
|
};
|
|
|
|
|
|
|
|
HRESULT create_namespace_collection(IHTMLNamespaceCollection **ret)
|
|
|
|
{
|
|
|
|
HTMLNamespaceCollection *namespaces;
|
|
|
|
|
|
|
|
if (!(namespaces = heap_alloc_zero(sizeof(*namespaces))))
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
namespaces->IHTMLNamespaceCollection_iface.lpVtbl = &HTMLNamespaceCollectionVtbl;
|
|
|
|
namespaces->ref = 1;
|
|
|
|
init_dispex(&namespaces->dispex, (IUnknown*)&namespaces->IHTMLNamespaceCollection_iface, &HTMLNamespaceCollection_dispex);
|
|
|
|
*ret = &namespaces->IHTMLNamespaceCollection_iface;
|
|
|
|
return S_OK;
|
|
|
|
}
|