Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
ac56d24e
Commit
ac56d24e
authored
Oct 17, 2022
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Oct 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Move the IServiceProvider interface out of basedoc.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
5e062a99
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
91 additions
and
38 deletions
+91
-38
htmldoc.c
dlls/mshtml/htmldoc.c
+6
-3
htmlwindow.c
dlls/mshtml/htmlwindow.c
+1
-1
mshtml_private.h
dlls/mshtml/mshtml_private.h
+4
-2
service.c
dlls/mshtml/service.c
+80
-32
No files found.
dlls/mshtml/htmldoc.c
View file @
ac56d24e
...
...
@@ -5633,8 +5633,6 @@ static BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv)
*
ppv
=
&
This
->
IOleInPlaceObjectWindowless_iface
;
else
if
(
IsEqualGUID
(
&
IID_IOleInPlaceObjectWindowless
,
riid
))
*
ppv
=
&
This
->
IOleInPlaceObjectWindowless_iface
;
else
if
(
IsEqualGUID
(
&
IID_IServiceProvider
,
riid
))
*
ppv
=
&
This
->
IServiceProvider_iface
;
else
if
(
IsEqualGUID
(
&
IID_IOleCommandTarget
,
riid
))
*
ppv
=
&
This
->
IOleCommandTarget_iface
;
else
if
(
IsEqualGUID
(
&
IID_IOleControl
,
riid
))
...
...
@@ -5728,7 +5726,6 @@ static void init_doc(HTMLDocument *doc, IUnknown *outer, IDispatchEx *dispex)
HTMLDocument_Persist_Init
(
doc
);
HTMLDocument_OleCmd_Init
(
doc
);
HTMLDocument_OleObj_Init
(
doc
);
HTMLDocument_Service_Init
(
doc
);
}
static
inline
HTMLDocumentNode
*
impl_from_HTMLDOMNode
(
HTMLDOMNode
*
iface
)
...
...
@@ -5747,6 +5744,8 @@ static HRESULT HTMLDocumentNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
if
(
IsEqualGUID
(
&
IID_IInternetHostSecurityManager
,
riid
))
*
ppv
=
&
This
->
IInternetHostSecurityManager_iface
;
else
if
(
IsEqualGUID
(
&
IID_IServiceProvider
,
riid
))
*
ppv
=
&
This
->
IServiceProvider_iface
;
else
if
(
IsEqualGUID
(
&
IID_IConnectionPointContainer
,
riid
))
*
ppv
=
&
This
->
cp_container
.
IConnectionPointContainer_iface
;
else
...
...
@@ -6136,6 +6135,7 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo
init_doc
(
&
doc
->
basedoc
,
(
IUnknown
*
)
&
doc
->
node
.
IHTMLDOMNode_iface
,
&
doc
->
node
.
event_target
.
dispex
.
IDispatchEx_iface
);
ConnectionPointContainer_Init
(
&
doc
->
cp_container
,
(
IUnknown
*
)
&
doc
->
basedoc
.
IHTMLDocument2_iface
,
HTMLDocumentNode_cpc
);
HTMLDocumentNode_Service_Init
(
doc
);
HTMLDocumentNode_SecMgr_Init
(
doc
);
list_init
(
&
doc
->
selection_list
);
...
...
@@ -6254,6 +6254,8 @@ static HRESULT WINAPI HTMLDocumentObj_QueryInterface(IUnknown *iface, REFIID rii
*
ppv
=
&
This
->
IViewObjectEx_iface
;
}
else
if
(
IsEqualGUID
(
&
IID_IViewObjectEx
,
riid
))
{
*
ppv
=
&
This
->
IViewObjectEx_iface
;
}
else
if
(
IsEqualGUID
(
&
IID_IServiceProvider
,
riid
))
{
*
ppv
=
&
This
->
IServiceProvider_iface
;
}
else
if
(
IsEqualGUID
(
&
IID_ITargetContainer
,
riid
))
{
*
ppv
=
&
This
->
ITargetContainer_iface
;
}
else
if
(
IsEqualGUID
(
&
IID_IConnectionPointContainer
,
riid
))
{
...
...
@@ -6480,6 +6482,7 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii
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_Service_Init
(
doc
);
TargetContainer_Init
(
doc
);
doc
->
is_mhtml
=
is_mhtml
;
...
...
dlls/mshtml/htmlwindow.c
View file @
ac56d24e
...
...
@@ -3742,7 +3742,7 @@ static HRESULT WINAPI HTMLWindowSP_QueryService(IServiceProvider *iface, REFGUID
if
(
!
This
->
outer_window
||
!
This
->
outer_window
->
browser
)
return
E_NOINTERFACE
;
return
IServiceProvider_QueryService
(
&
This
->
outer_window
->
browser
->
doc
->
basedoc
.
IServiceProvider_iface
,
return
IServiceProvider_QueryService
(
&
This
->
outer_window
->
browser
->
doc
->
IServiceProvider_iface
,
guidService
,
riid
,
ppv
);
}
...
...
dlls/mshtml/mshtml_private.h
View file @
ac56d24e
...
...
@@ -656,7 +656,6 @@ struct HTMLDocument {
IOleDocument
IOleDocument_iface
;
IOleInPlaceActiveObject
IOleInPlaceActiveObject_iface
;
IOleInPlaceObjectWindowless
IOleInPlaceObjectWindowless_iface
;
IServiceProvider
IServiceProvider_iface
;
IOleCommandTarget
IOleCommandTarget_iface
;
IOleControl
IOleControl_iface
;
IHlinkTarget
IHlinkTarget_iface
;
...
...
@@ -703,6 +702,7 @@ struct HTMLDocumentObj {
ICustomDoc
ICustomDoc_iface
;
IOleDocumentView
IOleDocumentView_iface
;
IViewObjectEx
IViewObjectEx_iface
;
IServiceProvider
IServiceProvider_iface
;
ITargetContainer
ITargetContainer_iface
;
IWindowForBindingUI
IWindowForBindingUI_iface
;
...
...
@@ -896,6 +896,7 @@ struct HTMLDocumentNode {
HTMLDOMNode
node
;
HTMLDocument
basedoc
;
IServiceProvider
IServiceProvider_iface
;
IInternetHostSecurityManager
IInternetHostSecurityManager_iface
;
nsIDocumentObserver
nsIDocumentObserver_iface
;
...
...
@@ -965,11 +966,12 @@ void detach_html_storage(IHTMLStorage*) DECLSPEC_HIDDEN;
void
HTMLDocument_Persist_Init
(
HTMLDocument
*
)
DECLSPEC_HIDDEN
;
void
HTMLDocument_OleCmd_Init
(
HTMLDocument
*
)
DECLSPEC_HIDDEN
;
void
HTMLDocument_OleObj_Init
(
HTMLDocument
*
)
DECLSPEC_HIDDEN
;
void
HTMLDocument_Service_Init
(
HTMLDocument
*
)
DECLSPEC_HIDDEN
;
void
HTMLDocument_View_Init
(
HTMLDocumentObj
*
)
DECLSPEC_HIDDEN
;
void
HTMLDocumentObj_Service_Init
(
HTMLDocumentObj
*
)
DECLSPEC_HIDDEN
;
void
TargetContainer_Init
(
HTMLDocumentObj
*
)
DECLSPEC_HIDDEN
;
void
HTMLDocumentNode_Service_Init
(
HTMLDocumentNode
*
)
DECLSPEC_HIDDEN
;
void
HTMLDocumentNode_SecMgr_Init
(
HTMLDocumentNode
*
)
DECLSPEC_HIDDEN
;
HRESULT
HTMLCurrentStyle_Create
(
HTMLElement
*
,
IHTMLCurrentStyle
**
)
DECLSPEC_HIDDEN
;
...
...
dlls/mshtml/service.c
View file @
ac56d24e
...
...
@@ -332,33 +332,76 @@ static IHTMLEditServices *create_editsvcs(void)
* IServiceProvider implementation
*/
static
inline
HTMLDocument
*
impl
_from_IServiceProvider
(
IServiceProvider
*
iface
)
static
inline
HTMLDocument
Node
*
HTMLDocumentNode
_from_IServiceProvider
(
IServiceProvider
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
HTMLDocument
,
IServiceProvider_iface
);
return
CONTAINING_RECORD
(
iface
,
HTMLDocument
Node
,
IServiceProvider_iface
);
}
static
HRESULT
WINAPI
ServiceProvider_QueryInterface
(
IServiceProvider
*
iface
,
REFIID
riid
,
void
**
ppv
)
static
HRESULT
WINAPI
DocNode
ServiceProvider_QueryInterface
(
IServiceProvider
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
HTMLDocument
*
This
=
impl
_from_IServiceProvider
(
iface
);
return
htmldoc_query_interface
(
This
,
riid
,
ppv
);
HTMLDocument
Node
*
This
=
HTMLDocumentNode
_from_IServiceProvider
(
iface
);
return
htmldoc_query_interface
(
&
This
->
basedoc
,
riid
,
ppv
);
}
static
ULONG
WINAPI
ServiceProvider_AddRef
(
IServiceProvider
*
iface
)
static
ULONG
WINAPI
DocNode
ServiceProvider_AddRef
(
IServiceProvider
*
iface
)
{
HTMLDocument
*
This
=
impl
_from_IServiceProvider
(
iface
);
return
htmldoc_addref
(
This
);
HTMLDocument
Node
*
This
=
HTMLDocumentNode
_from_IServiceProvider
(
iface
);
return
htmldoc_addref
(
&
This
->
basedoc
);
}
static
ULONG
WINAPI
ServiceProvider_Release
(
IServiceProvider
*
iface
)
static
ULONG
WINAPI
DocNode
ServiceProvider_Release
(
IServiceProvider
*
iface
)
{
HTMLDocument
*
This
=
impl
_from_IServiceProvider
(
iface
);
return
htmldoc_release
(
This
);
HTMLDocument
Node
*
This
=
HTMLDocumentNode
_from_IServiceProvider
(
iface
);
return
htmldoc_release
(
&
This
->
basedoc
);
}
static
HRESULT
WINAPI
ServiceProvider_QueryService
(
IServiceProvider
*
iface
,
REFGUID
guidService
,
static
HRESULT
WINAPI
DocNode
ServiceProvider_QueryService
(
IServiceProvider
*
iface
,
REFGUID
guidService
,
REFIID
riid
,
void
**
ppv
)
{
HTMLDocument
*
This
=
impl_from_IServiceProvider
(
iface
);
HTMLDocumentNode
*
This
=
HTMLDocumentNode_from_IServiceProvider
(
iface
);
if
(
IsEqualGUID
(
&
SID_SContainerDispatch
,
guidService
))
{
TRACE
(
"SID_SContainerDispatch
\n
"
);
return
IHTMLDocument2_QueryInterface
(
&
This
->
basedoc
.
IHTMLDocument2_iface
,
riid
,
ppv
);
}
return
IServiceProvider_QueryService
(
&
This
->
basedoc
.
doc_obj
->
IServiceProvider_iface
,
guidService
,
riid
,
ppv
);
}
static
const
IServiceProviderVtbl
DocNodeServiceProviderVtbl
=
{
DocNodeServiceProvider_QueryInterface
,
DocNodeServiceProvider_AddRef
,
DocNodeServiceProvider_Release
,
DocNodeServiceProvider_QueryService
};
static
inline
HTMLDocumentObj
*
HTMLDocumentObj_from_IServiceProvider
(
IServiceProvider
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
HTMLDocumentObj
,
IServiceProvider_iface
);
}
static
HRESULT
WINAPI
DocObjServiceProvider_QueryInterface
(
IServiceProvider
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
HTMLDocumentObj
*
This
=
HTMLDocumentObj_from_IServiceProvider
(
iface
);
return
htmldoc_query_interface
(
&
This
->
basedoc
,
riid
,
ppv
);
}
static
ULONG
WINAPI
DocObjServiceProvider_AddRef
(
IServiceProvider
*
iface
)
{
HTMLDocumentObj
*
This
=
HTMLDocumentObj_from_IServiceProvider
(
iface
);
return
htmldoc_addref
(
&
This
->
basedoc
);
}
static
ULONG
WINAPI
DocObjServiceProvider_Release
(
IServiceProvider
*
iface
)
{
HTMLDocumentObj
*
This
=
HTMLDocumentObj_from_IServiceProvider
(
iface
);
return
htmldoc_release
(
&
This
->
basedoc
);
}
static
HRESULT
WINAPI
DocObjServiceProvider_QueryService
(
IServiceProvider
*
iface
,
REFGUID
guidService
,
REFIID
riid
,
void
**
ppv
)
{
HTMLDocumentObj
*
This
=
HTMLDocumentObj_from_IServiceProvider
(
iface
);
if
(
IsEqualGUID
(
&
CLSID_CMarkup
,
guidService
))
{
FIXME
(
"(%p)->(CLSID_CMarkup %s %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppv
);
...
...
@@ -368,43 +411,43 @@ static HRESULT WINAPI ServiceProvider_QueryService(IServiceProvider *iface, REFG
if
(
IsEqualGUID
(
&
SID_SOleUndoManager
,
guidService
))
{
TRACE
(
"SID_SOleUndoManager
\n
"
);
if
(
!
This
->
doc_obj
->
undomgr
)
This
->
doc_obj
->
undomgr
=
create_undomgr
();
if
(
!
This
->
undomgr
)
This
->
undomgr
=
create_undomgr
();
if
(
!
This
->
doc_obj
->
undomgr
)
if
(
!
This
->
undomgr
)
return
E_OUTOFMEMORY
;
return
IOleUndoManager_QueryInterface
(
This
->
doc_obj
->
undomgr
,
riid
,
ppv
);
return
IOleUndoManager_QueryInterface
(
This
->
undomgr
,
riid
,
ppv
);
}
if
(
IsEqualGUID
(
&
SID_SContainerDispatch
,
guidService
))
{
TRACE
(
"SID_SContainerDispatch
\n
"
);
return
IHTMLDocument2_QueryInterface
(
&
This
->
IHTMLDocument2_iface
,
riid
,
ppv
);
return
IHTMLDocument2_QueryInterface
(
&
This
->
basedoc
.
IHTMLDocument2_iface
,
riid
,
ppv
);
}
if
(
IsEqualGUID
(
&
IID_IWindowForBindingUI
,
guidService
))
{
TRACE
(
"IID_IWindowForBindingUI
\n
"
);
return
IWindowForBindingUI_QueryInterface
(
&
This
->
doc_obj
->
IWindowForBindingUI_iface
,
riid
,
ppv
);
return
IWindowForBindingUI_QueryInterface
(
&
This
->
IWindowForBindingUI_iface
,
riid
,
ppv
);
}
if
(
IsEqualGUID
(
&
SID_SHTMLEditServices
,
guidService
))
{
TRACE
(
"SID_SHTMLEditServices
\n
"
);
if
(
!
This
->
doc_obj
->
editsvcs
)
This
->
doc_obj
->
editsvcs
=
create_editsvcs
();
if
(
!
This
->
editsvcs
)
This
->
editsvcs
=
create_editsvcs
();
if
(
!
This
->
doc_obj
->
editsvcs
)
if
(
!
This
->
editsvcs
)
return
E_OUTOFMEMORY
;
return
IHTMLEditServices_QueryInterface
(
This
->
doc_obj
->
editsvcs
,
riid
,
ppv
);
return
IHTMLEditServices_QueryInterface
(
This
->
editsvcs
,
riid
,
ppv
);
}
TRACE
(
"(%p)->(%s %s %p)
\n
"
,
This
,
debugstr_guid
(
guidService
),
debugstr_guid
(
riid
),
ppv
);
if
(
This
->
doc_obj
->
client
)
{
if
(
This
->
client
)
{
HRESULT
hres
;
hres
=
do_query_service
((
IUnknown
*
)
This
->
doc_obj
->
client
,
guidService
,
riid
,
ppv
);
hres
=
do_query_service
((
IUnknown
*
)
This
->
client
,
guidService
,
riid
,
ppv
);
if
(
SUCCEEDED
(
hres
))
return
hres
;
}
...
...
@@ -413,14 +456,19 @@ static HRESULT WINAPI ServiceProvider_QueryService(IServiceProvider *iface, REFG
return
E_NOINTERFACE
;
}
static
const
IServiceProviderVtbl
ServiceProviderVtbl
=
{
ServiceProvider_QueryInterface
,
ServiceProvider_AddRef
,
ServiceProvider_Release
,
ServiceProvider_QueryService
static
const
IServiceProviderVtbl
DocObj
ServiceProviderVtbl
=
{
DocObj
ServiceProvider_QueryInterface
,
DocObj
ServiceProvider_AddRef
,
DocObj
ServiceProvider_Release
,
DocObj
ServiceProvider_QueryService
};
void
HTMLDocument_Service_Init
(
HTMLDocument
*
This
)
void
HTMLDocumentNode_Service_Init
(
HTMLDocumentNode
*
This
)
{
This
->
IServiceProvider_iface
.
lpVtbl
=
&
DocNodeServiceProviderVtbl
;
}
void
HTMLDocumentObj_Service_Init
(
HTMLDocumentObj
*
This
)
{
This
->
IServiceProvider_iface
.
lpVtbl
=
&
ServiceProviderVtbl
;
This
->
IServiceProvider_iface
.
lpVtbl
=
&
DocObj
ServiceProviderVtbl
;
}
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