mshtml: Added HTMLWindow's IDispatch methods implementation.
This commit is contained in:
parent
7d1c59edce
commit
4005cf72d6
|
@ -98,16 +98,26 @@ static ULONG WINAPI HTMLWindow2_Release(IHTMLWindow2 *iface)
|
||||||
static HRESULT WINAPI HTMLWindow2_GetTypeInfoCount(IHTMLWindow2 *iface, UINT *pctinfo)
|
static HRESULT WINAPI HTMLWindow2_GetTypeInfoCount(IHTMLWindow2 *iface, UINT *pctinfo)
|
||||||
{
|
{
|
||||||
HTMLWindow *This = HTMLWINDOW2_THIS(iface);
|
HTMLWindow *This = HTMLWINDOW2_THIS(iface);
|
||||||
FIXME("(%p)->(%p)\n", This, pctinfo);
|
|
||||||
return E_NOTIMPL;
|
TRACE("(%p)->(%p)\n", This, pctinfo);
|
||||||
|
|
||||||
|
*pctinfo = 1;
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI HTMLWindow2_GetTypeInfo(IHTMLWindow2 *iface, UINT iTInfo,
|
static HRESULT WINAPI HTMLWindow2_GetTypeInfo(IHTMLWindow2 *iface, UINT iTInfo,
|
||||||
LCID lcid, ITypeInfo **ppTInfo)
|
LCID lcid, ITypeInfo **ppTInfo)
|
||||||
{
|
{
|
||||||
HTMLWindow *This = HTMLWINDOW2_THIS(iface);
|
HTMLWindow *This = HTMLWINDOW2_THIS(iface);
|
||||||
FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
|
HRESULT hres;
|
||||||
return E_NOTIMPL;
|
|
||||||
|
TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
|
||||||
|
|
||||||
|
hres = get_typeinfo(IHTMLWindow2_tid, ppTInfo);
|
||||||
|
if(SUCCEEDED(hres))
|
||||||
|
ITypeInfo_AddRef(*ppTInfo);
|
||||||
|
|
||||||
|
return hres;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI HTMLWindow2_GetIDsOfNames(IHTMLWindow2 *iface, REFIID riid,
|
static HRESULT WINAPI HTMLWindow2_GetIDsOfNames(IHTMLWindow2 *iface, REFIID riid,
|
||||||
|
@ -115,9 +125,17 @@ static HRESULT WINAPI HTMLWindow2_GetIDsOfNames(IHTMLWindow2 *iface, REFIID riid
|
||||||
LCID lcid, DISPID *rgDispId)
|
LCID lcid, DISPID *rgDispId)
|
||||||
{
|
{
|
||||||
HTMLWindow *This = HTMLWINDOW2_THIS(iface);
|
HTMLWindow *This = HTMLWINDOW2_THIS(iface);
|
||||||
FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
|
ITypeInfo *typeinfo;
|
||||||
|
HRESULT hres;
|
||||||
|
|
||||||
|
TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
|
||||||
lcid, rgDispId);
|
lcid, rgDispId);
|
||||||
return E_NOTIMPL;
|
|
||||||
|
hres = get_typeinfo(IHTMLWindow2_tid, &typeinfo);
|
||||||
|
if(SUCCEEDED(hres))
|
||||||
|
hres = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
|
||||||
|
|
||||||
|
return hres;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI HTMLWindow2_Invoke(IHTMLWindow2 *iface, DISPID dispIdMember,
|
static HRESULT WINAPI HTMLWindow2_Invoke(IHTMLWindow2 *iface, DISPID dispIdMember,
|
||||||
|
@ -125,9 +143,18 @@ static HRESULT WINAPI HTMLWindow2_Invoke(IHTMLWindow2 *iface, DISPID dispIdMembe
|
||||||
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
||||||
{
|
{
|
||||||
HTMLWindow *This = HTMLWINDOW2_THIS(iface);
|
HTMLWindow *This = HTMLWINDOW2_THIS(iface);
|
||||||
FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
|
ITypeInfo *typeinfo;
|
||||||
|
HRESULT hres;
|
||||||
|
|
||||||
|
TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
|
||||||
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||||
return E_NOTIMPL;
|
|
||||||
|
hres = get_typeinfo(IHTMLWindow2_tid, &typeinfo);
|
||||||
|
if(SUCCEEDED(hres))
|
||||||
|
hres = ITypeInfo_Invoke(typeinfo, HTMLWINDOW2(This), dispIdMember, wFlags, pDispParams,
|
||||||
|
pVarResult, pExcepInfo, puArgErr);
|
||||||
|
|
||||||
|
return hres;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI HTMLWindow2_item(IHTMLWindow2 *iface, VARIANT *pvarIndex, VARIANT *pvarResult)
|
static HRESULT WINAPI HTMLWindow2_item(IHTMLWindow2 *iface, VARIANT *pvarIndex, VARIANT *pvarResult)
|
||||||
|
|
|
@ -51,10 +51,52 @@ DWORD mshtml_tls = 0;
|
||||||
|
|
||||||
static HINSTANCE shdoclc = NULL;
|
static HINSTANCE shdoclc = NULL;
|
||||||
|
|
||||||
|
static ITypeLib *typelib;
|
||||||
|
static ITypeInfo *typeinfos[LAST_tid];
|
||||||
|
|
||||||
|
static const REFIID tid_ids[] = {
|
||||||
|
&IID_IHTMLWindow2
|
||||||
|
};
|
||||||
|
|
||||||
|
HRESULT get_typeinfo(enum tid_t tid, ITypeInfo **typeinfo)
|
||||||
|
{
|
||||||
|
HRESULT hres;
|
||||||
|
|
||||||
|
if(!typelib) {
|
||||||
|
hres = LoadRegTypeLib(&LIBID_MSHTML, 4, 0, LOCALE_SYSTEM_DEFAULT, &typelib);
|
||||||
|
if(FAILED(hres)) {
|
||||||
|
ERR("LoadRegTypeLib failed: %08x\n", hres);
|
||||||
|
return hres;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!typeinfos[tid]) {
|
||||||
|
hres = ITypeLib_GetTypeInfoOfGuid(typelib, tid_ids[tid], typeinfos+tid);
|
||||||
|
if(FAILED(hres)) {
|
||||||
|
ERR("GetTypeInfoOfGuid failed: %08x\n", hres);
|
||||||
|
return hres;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
*typeinfo = typeinfos[tid];
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
static void thread_detach(void)
|
static void thread_detach(void)
|
||||||
{
|
{
|
||||||
thread_data_t *thread_data = get_thread_data(FALSE);
|
thread_data_t *thread_data;
|
||||||
|
|
||||||
|
if(typelib) {
|
||||||
|
unsigned i;
|
||||||
|
|
||||||
|
for(i=0; i < sizeof(typeinfos)/sizeof(*typeinfos); i++)
|
||||||
|
if(typeinfos[i])
|
||||||
|
ITypeInfo_Release(typeinfos[i]);
|
||||||
|
|
||||||
|
ITypeLib_Release(typelib);
|
||||||
|
}
|
||||||
|
|
||||||
|
thread_data = get_thread_data(FALSE);
|
||||||
if(!thread_data)
|
if(!thread_data)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -472,6 +472,14 @@ HWND get_thread_hwnd(void);
|
||||||
void push_task(task_t*);
|
void push_task(task_t*);
|
||||||
void remove_doc_tasks(const HTMLDocument*);
|
void remove_doc_tasks(const HTMLDocument*);
|
||||||
|
|
||||||
|
/* typelibs */
|
||||||
|
enum tid_t {
|
||||||
|
IHTMLWindow2_tid,
|
||||||
|
LAST_tid
|
||||||
|
};
|
||||||
|
|
||||||
|
HRESULT get_typeinfo(enum tid_t, ITypeInfo**);
|
||||||
|
|
||||||
DEFINE_GUID(CLSID_AboutProtocol, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
|
DEFINE_GUID(CLSID_AboutProtocol, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
|
||||||
DEFINE_GUID(CLSID_JSProtocol, 0x3050F3B2, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
|
DEFINE_GUID(CLSID_JSProtocol, 0x3050F3B2, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
|
||||||
DEFINE_GUID(CLSID_MailtoProtocol, 0x3050F3DA, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
|
DEFINE_GUID(CLSID_MailtoProtocol, 0x3050F3DA, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
|
||||||
|
|
Loading…
Reference in New Issue