Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
f852f1a6
Commit
f852f1a6
authored
Oct 25, 2022
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Oct 25, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Move the IDispatchEx interface out of basedoc.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
5005bb97
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
153 additions
and
17 deletions
+153
-17
dispex.c
dlls/mshtml/dispex.c
+3
-2
htmldoc.c
dlls/mshtml/htmldoc.c
+0
-0
htmlwindow.c
dlls/mshtml/htmlwindow.c
+1
-1
mshtml_private.h
dlls/mshtml/mshtml_private.h
+3
-7
oleobj.c
dlls/mshtml/oleobj.c
+146
-7
No files found.
dlls/mshtml/dispex.c
View file @
f852f1a6
...
...
@@ -709,7 +709,7 @@ HRESULT dispex_get_dprop_ref(DispatchEx *This, const WCHAR *name, BOOL alloc, VA
return
S_OK
;
}
HRESULT
dispex_get_dynid
(
DispatchEx
*
This
,
const
WCHAR
*
name
,
DISPID
*
id
)
HRESULT
dispex_get_dynid
(
DispatchEx
*
This
,
const
WCHAR
*
name
,
BOOL
hidden
,
DISPID
*
id
)
{
dynamic_prop_t
*
prop
;
HRESULT
hres
;
...
...
@@ -718,7 +718,8 @@ HRESULT dispex_get_dynid(DispatchEx *This, const WCHAR *name, DISPID *id)
if
(
FAILED
(
hres
))
return
hres
;
prop
->
flags
|=
DYNPROP_HIDDEN
;
if
(
hidden
)
prop
->
flags
|=
DYNPROP_HIDDEN
;
*
id
=
DISPID_DYNPROP_0
+
(
prop
-
This
->
dynamic_data
->
props
);
return
S_OK
;
}
...
...
dlls/mshtml/htmldoc.c
View file @
f852f1a6
This diff is collapsed.
Click to expand it.
dlls/mshtml/htmlwindow.c
View file @
f852f1a6
...
...
@@ -3828,7 +3828,7 @@ static HRESULT HTMLWindow_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WORD
case
DISPATCH_PROPERTYPUT
:
{
DISPID
dispex_id
;
hres
=
dispex_get_dynid
(
&
This
->
event_target
.
dispex
,
prop
->
name
,
&
dispex_id
);
hres
=
dispex_get_dynid
(
&
This
->
event_target
.
dispex
,
prop
->
name
,
TRUE
,
&
dispex_id
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/mshtml/mshtml_private.h
View file @
f852f1a6
...
...
@@ -406,7 +406,7 @@ HRESULT change_type(VARIANT*,VARIANT*,VARTYPE,IServiceProvider*) DECLSPEC_HIDDEN
HRESULT
dispex_get_dprop_ref
(
DispatchEx
*
,
const
WCHAR
*
,
BOOL
,
VARIANT
**
)
DECLSPEC_HIDDEN
;
HRESULT
get_dispids
(
tid_t
,
DWORD
*
,
DISPID
**
)
DECLSPEC_HIDDEN
;
HRESULT
remove_attribute
(
DispatchEx
*
,
DISPID
,
VARIANT_BOOL
*
)
DECLSPEC_HIDDEN
;
HRESULT
dispex_get_dynid
(
DispatchEx
*
,
const
WCHAR
*
,
DISPID
*
)
DECLSPEC_HIDDEN
;
HRESULT
dispex_get_dynid
(
DispatchEx
*
,
const
WCHAR
*
,
BOOL
,
DISPID
*
)
DECLSPEC_HIDDEN
;
void
dispex_traverse
(
DispatchEx
*
,
nsCycleCollectionTraversalCallback
*
)
DECLSPEC_HIDDEN
;
void
dispex_unlink
(
DispatchEx
*
)
DECLSPEC_HIDDEN
;
void
release_typelib
(
void
)
DECLSPEC_HIDDEN
;
...
...
@@ -640,10 +640,7 @@ struct ConnectionPoint {
};
struct
HTMLDocument
{
IDispatchEx
IDispatchEx_iface
;
IUnknown
*
outer_unk
;
IDispatchEx
*
dispex
;
HTMLDocumentObj
*
doc_obj
;
HTMLDocumentNode
*
doc_node
;
...
...
@@ -666,13 +663,11 @@ static inline ULONG htmldoc_release(HTMLDocument *This)
return
IUnknown_Release
(
This
->
outer_unk
);
}
BOOL
htmldoc_qi
(
HTMLDocument
*
,
REFIID
,
void
**
)
DECLSPEC_HIDDEN
;
void
init_doc
(
HTMLDocument
*
,
IUnknown
*
,
IDispatchEx
*
)
DECLSPEC_HIDDEN
;
struct
HTMLDocumentObj
{
HTMLDocument
basedoc
;
DispatchEx
dispex
;
IUnknown
IUnknown_inner
;
IDispatchEx
IDispatchEx_iface
;
ICustomDoc
ICustomDoc_iface
;
IHTMLDocument2
IHTMLDocument2_iface
;
IHTMLDocument3
IHTMLDocument3_iface
;
...
...
@@ -899,6 +894,7 @@ struct HTMLDocumentNode {
HTMLDOMNode
node
;
HTMLDocument
basedoc
;
IDispatchEx
IDispatchEx_iface
;
IHTMLDocument2
IHTMLDocument2_iface
;
IHTMLDocument3
IHTMLDocument3_iface
;
IHTMLDocument4
IHTMLDocument4_iface
;
...
...
dlls/mshtml/oleobj.c
View file @
f852f1a6
...
...
@@ -2145,24 +2145,24 @@ static ULONG WINAPI DocObj##iface##_Release(I##iface *_0) \
static HRESULT WINAPI DocObj##iface##_GetTypeInfoCount(I##iface *_0, UINT *pctinfo) \
{ \
HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \
return IDispatchEx_GetTypeInfoCount(&This->
basedoc.
IDispatchEx_iface, pctinfo); \
return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); \
} \
static HRESULT WINAPI DocObj##iface##_GetTypeInfo(I##iface *_0, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) \
{ \
HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \
return IDispatchEx_GetTypeInfo(&This->
basedoc.
IDispatchEx_iface, iTInfo, lcid, ppTInfo); \
return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); \
} \
static HRESULT WINAPI DocObj##iface##_GetIDsOfNames(I##iface *_0, REFIID riid, LPOLESTR *rgszNames, UINT cNames, \
LCID lcid, DISPID *rgDispId) \
{ \
HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \
return IDispatchEx_GetIDsOfNames(&This->
basedoc.
IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); \
return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); \
} \
static HRESULT WINAPI DocObj##iface##_Invoke(I##iface *_0, DISPID dispIdMember, REFIID riid, LCID lcid, \
WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) \
{ \
HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \
return IDispatchEx_Invoke(&This->
basedoc.
IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); \
return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); \
}
#define HTMLDOCUMENTOBJ_FWD_TO_NODE_0(iface, method) static HRESULT WINAPI DocObj##iface##_##method(I##iface *_0) \
...
...
@@ -3251,8 +3251,8 @@ static HRESULT WINAPI HTMLDocumentObj_QueryInterface(IUnknown *iface, REFIID rii
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
))
{
*
ppv
=
&
This
->
IUnknown_inner
;
}
else
if
(
htmldoc_qi
(
&
This
->
basedoc
,
riid
,
ppv
))
{
return
*
ppv
?
S_OK
:
E_NOINTERFACE
;
}
else
if
(
IsEqualGUID
(
&
IID_IDispatch
,
riid
)
||
IsEqualGUID
(
&
IID_IDispatchEx
,
riid
))
{
*
ppv
=
&
This
->
IDispatchEx_iface
;
}
else
if
(
IsEqualGUID
(
&
IID_IHTMLDocument
,
riid
)
||
IsEqualGUID
(
&
IID_IHTMLDocument2
,
riid
))
{
*
ppv
=
&
This
->
IHTMLDocument2_iface
;
}
else
if
(
IsEqualGUID
(
&
IID_IHTMLDocument3
,
riid
))
{
...
...
@@ -3438,6 +3438,144 @@ static const IUnknownVtbl HTMLDocumentObjVtbl = {
};
/**********************************************************
* IDispatchEx implementation
*/
static
inline
HTMLDocumentObj
*
impl_from_IDispatchEx
(
IDispatchEx
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
HTMLDocumentObj
,
IDispatchEx_iface
);
}
static
HRESULT
WINAPI
DocObjDispatchEx_QueryInterface
(
IDispatchEx
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
HTMLDocumentObj
*
This
=
impl_from_IDispatchEx
(
iface
);
return
htmldoc_query_interface
(
&
This
->
basedoc
,
riid
,
ppv
);
}
static
ULONG
WINAPI
DocObjDispatchEx_AddRef
(
IDispatchEx
*
iface
)
{
HTMLDocumentObj
*
This
=
impl_from_IDispatchEx
(
iface
);
return
htmldoc_addref
(
&
This
->
basedoc
);
}
static
ULONG
WINAPI
DocObjDispatchEx_Release
(
IDispatchEx
*
iface
)
{
HTMLDocumentObj
*
This
=
impl_from_IDispatchEx
(
iface
);
return
htmldoc_release
(
&
This
->
basedoc
);
}
static
HRESULT
WINAPI
DocObjDispatchEx_GetTypeInfoCount
(
IDispatchEx
*
iface
,
UINT
*
pctinfo
)
{
HTMLDocumentObj
*
This
=
impl_from_IDispatchEx
(
iface
);
return
IDispatchEx_GetTypeInfoCount
(
&
This
->
dispex
.
IDispatchEx_iface
,
pctinfo
);
}
static
HRESULT
WINAPI
DocObjDispatchEx_GetTypeInfo
(
IDispatchEx
*
iface
,
UINT
iTInfo
,
LCID
lcid
,
ITypeInfo
**
ppTInfo
)
{
HTMLDocumentObj
*
This
=
impl_from_IDispatchEx
(
iface
);
return
IDispatchEx_GetTypeInfo
(
&
This
->
dispex
.
IDispatchEx_iface
,
iTInfo
,
lcid
,
ppTInfo
);
}
static
HRESULT
WINAPI
DocObjDispatchEx_GetIDsOfNames
(
IDispatchEx
*
iface
,
REFIID
riid
,
LPOLESTR
*
rgszNames
,
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispId
)
{
HTMLDocumentObj
*
This
=
impl_from_IDispatchEx
(
iface
);
return
IDispatchEx_GetIDsOfNames
(
&
This
->
dispex
.
IDispatchEx_iface
,
riid
,
rgszNames
,
cNames
,
lcid
,
rgDispId
);
}
static
HRESULT
WINAPI
DocObjDispatchEx_Invoke
(
IDispatchEx
*
iface
,
DISPID
dispIdMember
,
REFIID
riid
,
LCID
lcid
,
WORD
wFlags
,
DISPPARAMS
*
pDispParams
,
VARIANT
*
pVarResult
,
EXCEPINFO
*
pExcepInfo
,
UINT
*
puArgErr
)
{
HTMLDocumentObj
*
This
=
impl_from_IDispatchEx
(
iface
);
return
IDispatchEx_InvokeEx
(
&
This
->
IDispatchEx_iface
,
dispIdMember
,
lcid
,
wFlags
,
pDispParams
,
pVarResult
,
pExcepInfo
,
NULL
);
}
static
HRESULT
WINAPI
DocObjDispatchEx_GetDispID
(
IDispatchEx
*
iface
,
BSTR
bstrName
,
DWORD
grfdex
,
DISPID
*
pid
)
{
HTMLDocumentObj
*
This
=
impl_from_IDispatchEx
(
iface
);
return
IDispatchEx_GetDispID
(
&
This
->
dispex
.
IDispatchEx_iface
,
bstrName
,
grfdex
,
pid
);
}
static
HRESULT
WINAPI
DocObjDispatchEx_InvokeEx
(
IDispatchEx
*
iface
,
DISPID
id
,
LCID
lcid
,
WORD
wFlags
,
DISPPARAMS
*
pdp
,
VARIANT
*
pvarRes
,
EXCEPINFO
*
pei
,
IServiceProvider
*
pspCaller
)
{
HTMLDocumentObj
*
This
=
impl_from_IDispatchEx
(
iface
);
if
(
This
->
basedoc
.
window
)
{
switch
(
id
)
{
case
DISPID_READYSTATE
:
TRACE
(
"DISPID_READYSTATE
\n
"
);
if
(
!
(
wFlags
&
DISPATCH_PROPERTYGET
))
return
E_INVALIDARG
;
V_VT
(
pvarRes
)
=
VT_I4
;
V_I4
(
pvarRes
)
=
This
->
basedoc
.
window
->
readystate
;
return
S_OK
;
default:
break
;
}
}
return
IDispatchEx_InvokeEx
(
&
This
->
dispex
.
IDispatchEx_iface
,
id
,
lcid
,
wFlags
,
pdp
,
pvarRes
,
pei
,
pspCaller
);
}
static
HRESULT
WINAPI
DocObjDispatchEx_DeleteMemberByName
(
IDispatchEx
*
iface
,
BSTR
bstrName
,
DWORD
grfdex
)
{
HTMLDocumentObj
*
This
=
impl_from_IDispatchEx
(
iface
);
return
IDispatchEx_DeleteMemberByName
(
&
This
->
dispex
.
IDispatchEx_iface
,
bstrName
,
grfdex
);
}
static
HRESULT
WINAPI
DocObjDispatchEx_DeleteMemberByDispID
(
IDispatchEx
*
iface
,
DISPID
id
)
{
HTMLDocumentObj
*
This
=
impl_from_IDispatchEx
(
iface
);
return
IDispatchEx_DeleteMemberByDispID
(
&
This
->
dispex
.
IDispatchEx_iface
,
id
);
}
static
HRESULT
WINAPI
DocObjDispatchEx_GetMemberProperties
(
IDispatchEx
*
iface
,
DISPID
id
,
DWORD
grfdexFetch
,
DWORD
*
pgrfdex
)
{
HTMLDocumentObj
*
This
=
impl_from_IDispatchEx
(
iface
);
return
IDispatchEx_GetMemberProperties
(
&
This
->
dispex
.
IDispatchEx_iface
,
id
,
grfdexFetch
,
pgrfdex
);
}
static
HRESULT
WINAPI
DocObjDispatchEx_GetMemberName
(
IDispatchEx
*
iface
,
DISPID
id
,
BSTR
*
pbstrName
)
{
HTMLDocumentObj
*
This
=
impl_from_IDispatchEx
(
iface
);
return
IDispatchEx_GetMemberName
(
&
This
->
dispex
.
IDispatchEx_iface
,
id
,
pbstrName
);
}
static
HRESULT
WINAPI
DocObjDispatchEx_GetNextDispID
(
IDispatchEx
*
iface
,
DWORD
grfdex
,
DISPID
id
,
DISPID
*
pid
)
{
HTMLDocumentObj
*
This
=
impl_from_IDispatchEx
(
iface
);
return
IDispatchEx_GetNextDispID
(
&
This
->
dispex
.
IDispatchEx_iface
,
grfdex
,
id
,
pid
);
}
static
HRESULT
WINAPI
DocObjDispatchEx_GetNameSpaceParent
(
IDispatchEx
*
iface
,
IUnknown
**
ppunk
)
{
HTMLDocumentObj
*
This
=
impl_from_IDispatchEx
(
iface
);
return
IDispatchEx_GetNameSpaceParent
(
&
This
->
dispex
.
IDispatchEx_iface
,
ppunk
);
}
static
const
IDispatchExVtbl
DocObjDispatchExVtbl
=
{
DocObjDispatchEx_QueryInterface
,
DocObjDispatchEx_AddRef
,
DocObjDispatchEx_Release
,
DocObjDispatchEx_GetTypeInfoCount
,
DocObjDispatchEx_GetTypeInfo
,
DocObjDispatchEx_GetIDsOfNames
,
DocObjDispatchEx_Invoke
,
DocObjDispatchEx_GetDispID
,
DocObjDispatchEx_InvokeEx
,
DocObjDispatchEx_DeleteMemberByName
,
DocObjDispatchEx_DeleteMemberByDispID
,
DocObjDispatchEx_GetMemberProperties
,
DocObjDispatchEx_GetMemberName
,
DocObjDispatchEx_GetNextDispID
,
DocObjDispatchEx_GetNameSpaceParent
};
/**********************************************************
* ICustomDoc implementation
*/
...
...
@@ -3580,6 +3718,7 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii
doc
->
ref
=
1
;
doc
->
IUnknown_inner
.
lpVtbl
=
&
HTMLDocumentObjVtbl
;
doc
->
IDispatchEx_iface
.
lpVtbl
=
&
DocObjDispatchExVtbl
;
doc
->
ICustomDoc_iface
.
lpVtbl
=
&
CustomDocVtbl
;
doc
->
IHTMLDocument2_iface
.
lpVtbl
=
&
DocObjHTMLDocument2Vtbl
;
doc
->
IHTMLDocument3_iface
.
lpVtbl
=
&
DocObjHTMLDocument3Vtbl
;
...
...
@@ -3596,10 +3735,10 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii
doc
->
IDisplayServices_iface
.
lpVtbl
=
&
DocObjDisplayServicesVtbl
;
doc
->
IDocumentRange_iface
.
lpVtbl
=
&
DocObjDocumentRangeVtbl
;
doc
->
basedoc
.
outer_unk
=
outer
?
outer
:
&
doc
->
IUnknown_inner
;
doc
->
basedoc
.
doc_obj
=
doc
;
init_dispatch
(
&
doc
->
dispex
,
(
IUnknown
*
)
&
doc
->
ICustomDoc_iface
,
&
HTMLDocumentObj_dispex
,
COMPAT_MODE_QUIRKS
);
init_doc
(
&
doc
->
basedoc
,
outer
?
outer
:
&
doc
->
IUnknown_inner
,
&
doc
->
dispex
.
IDispatchEx_iface
);
ConnectionPointContainer_Init
(
&
doc
->
cp_container
,
&
doc
->
IUnknown_inner
,
HTMLDocumentObj_cpc
);
HTMLDocumentObj_Persist_Init
(
doc
);
HTMLDocumentObj_Service_Init
(
doc
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment