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
24c3ce6f
Commit
24c3ce6f
authored
Jan 29, 2024
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Jan 30, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Forward the script site's QueryService to the document's.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
6aca31f1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
25 deletions
+30
-25
script.c
dlls/mshtml/script.c
+3
-20
service.c
dlls/mshtml/service.c
+5
-0
script.c
dlls/mshtml/tests/script.c
+22
-5
No files found.
dlls/mshtml/script.c
View file @
24c3ce6f
...
...
@@ -675,27 +675,10 @@ static HRESULT WINAPI ASServiceProvider_QueryService(IServiceProvider *iface, RE
{
ScriptHost
*
This
=
impl_from_IServiceProvider
(
iface
);
if
(
IsEqualGUID
(
&
SID_SInternetHostSecurityManager
,
guidService
))
{
TRACE
(
"(%p)->(SID_SInternetHostSecurityManager)
\n
"
,
This
);
if
(
!
This
->
window
||
!
This
->
window
->
doc
)
return
E_NOINTERFACE
;
return
IInternetHostSecurityManager_QueryInterface
(
&
This
->
window
->
doc
->
IInternetHostSecurityManager_iface
,
riid
,
ppv
);
}
if
(
IsEqualGUID
(
&
SID_SContainerDispatch
,
guidService
))
{
TRACE
(
"(%p)->(SID_SContainerDispatch)
\n
"
,
This
);
if
(
!
This
->
window
||
!
This
->
window
->
doc
)
return
E_NOINTERFACE
;
return
IHTMLDocument2_QueryInterface
(
&
This
->
window
->
doc
->
IHTMLDocument2_iface
,
riid
,
ppv
);
}
if
(
!
This
->
window
||
!
This
->
window
->
doc
)
return
E_NOINTERFACE
;
FIXME
(
"(%p)->(%s %s %p)
\n
"
,
This
,
debugstr_guid
(
guidService
),
debugstr_guid
(
riid
),
ppv
);
return
E_NOINTERFACE
;
return
IServiceProvider_QueryService
(
&
This
->
window
->
doc
->
IServiceProvider_iface
,
guidService
,
riid
,
ppv
);
}
static
const
IServiceProviderVtbl
ASServiceProviderVtbl
=
{
...
...
dlls/mshtml/service.c
View file @
24c3ce6f
...
...
@@ -360,6 +360,11 @@ static HRESULT WINAPI DocNodeServiceProvider_QueryService(IServiceProvider *ifac
{
HTMLDocumentNode
*
This
=
HTMLDocumentNode_from_IServiceProvider
(
iface
);
if
(
IsEqualGUID
(
&
SID_SInternetHostSecurityManager
,
guidService
))
{
TRACE
(
"SID_SInternetHostSecurityManager
\n
"
);
return
IInternetHostSecurityManager_QueryInterface
(
&
This
->
IInternetHostSecurityManager_iface
,
riid
,
ppv
);
}
if
(
IsEqualGUID
(
&
SID_SContainerDispatch
,
guidService
))
{
TRACE
(
"SID_SContainerDispatch
\n
"
);
return
IHTMLDocument2_QueryInterface
(
&
This
->
IHTMLDocument2_iface
,
riid
,
ppv
);
...
...
dlls/mshtml/tests/script.c
View file @
24c3ce6f
...
...
@@ -197,16 +197,16 @@ static BOOL skip_loadobject_tests;
static
IActiveScriptSite
*
site
,
*
site2
;
static
SCRIPTSTATE
state
,
state2
;
static
BOOL
iface_cmp
(
IUnknown
*
iface1
,
IUnknown
*
iface2
)
static
BOOL
iface_cmp
(
void
*
iface1
,
void
*
iface2
)
{
IUnknown
*
unk1
,
*
unk2
;
if
(
iface1
==
iface2
)
return
TRUE
;
IUnknown_QueryInterface
(
iface1
,
&
IID_IHTMLWindow2
,
(
void
**
)
&
unk1
);
IUnknown_QueryInterface
(
(
IUnknown
*
)
iface1
,
&
IID_IUnknown
,
(
void
**
)
&
unk1
);
IUnknown_Release
(
unk1
);
IUnknown_QueryInterface
(
iface2
,
&
IID_IHTMLWindow2
,
(
void
**
)
&
unk2
);
IUnknown_QueryInterface
(
(
IUnknown
*
)
iface2
,
&
IID_IUnknown
,
(
void
**
)
&
unk2
);
IUnknown_Release
(
unk2
);
return
unk1
==
unk2
;
...
...
@@ -2265,8 +2265,10 @@ static void test_security_reg(IInternetHostSecurityManager *sec_mgr, DWORD polic
static
void
test_security
(
void
)
{
IInternetHostSecurityManager
*
sec_mgr
;
IInternetHostSecurityManager
*
sec_mgr
,
*
sec_mgr2
;
IServiceProvider
*
sp
;
IHTMLWindow2
*
window
;
IHTMLDocument2
*
doc
;
DWORD
policy
,
policy_size
;
struct
CONFIRMSAFETY
cs
;
BYTE
*
ppolicy
;
...
...
@@ -2280,6 +2282,21 @@ static void test_security(void)
IServiceProvider_Release
(
sp
);
ok
(
hres
==
S_OK
,
"QueryService failed: %08lx
\n
"
,
hres
);
hres
=
IDispatchEx_QueryInterface
(
window_dispex
,
&
IID_IHTMLWindow2
,
(
void
**
)
&
window
);
ok
(
hres
==
S_OK
,
"Could not get IHTMLWindow2 iface: %08lx
\n
"
,
hres
);
hres
=
IHTMLWindow2_get_document
(
window
,
&
doc
);
ok
(
hres
==
S_OK
,
"get_document failed: %08lx
\n
"
,
hres
);
hres
=
IHTMLDocument2_QueryInterface
(
doc
,
&
IID_IServiceProvider
,
(
void
**
)
&
sp
);
ok
(
hres
==
S_OK
,
"Could not get IServiceProvider iface: %08lx
\n
"
,
hres
);
IHTMLWindow2_Release
(
window
);
IHTMLDocument2_Release
(
doc
);
hres
=
IServiceProvider_QueryService
(
sp
,
&
SID_SInternetHostSecurityManager
,
&
IID_IInternetHostSecurityManager
,
(
void
**
)
&
sec_mgr2
);
ok
(
hres
==
S_OK
,
"QueryService failed: %08lx
\n
"
,
hres
);
ok
(
iface_cmp
(
sec_mgr
,
sec_mgr2
),
"sec_mgr != sec_mgr2
\n
"
);
IInternetHostSecurityManager_Release
(
sec_mgr2
);
IServiceProvider_Release
(
sp
);
hres
=
IInternetHostSecurityManager_ProcessUrlAction
(
sec_mgr
,
URLACTION_ACTIVEX_RUN
,
(
BYTE
*
)
&
policy
,
sizeof
(
policy
),
(
BYTE
*
)
&
CLSID_TestActiveX
,
sizeof
(
CLSID
),
0
,
0
);
ok
(
hres
==
S_OK
,
"ProcessUrlAction failed: %08lx
\n
"
,
hres
);
...
...
@@ -4498,7 +4515,7 @@ static void test_exec_script(IHTMLDocument2 *doc, const WCHAR *codew, const WCHA
hres
=
IHTMLDocument2_get_parentWindow
(
doc
,
&
window
);
ok
(
hres
==
S_OK
,
"get_parentWindow failed: %08lx
\n
"
,
hres
);
ok
(
iface_cmp
(
(
IUnknown
*
)
window
,
(
IUnknown
*
)
window_dispex
),
"window != dispex_window
\n
"
);
ok
(
iface_cmp
(
window
,
window_dispex
),
"window != dispex_window
\n
"
);
code
=
SysAllocString
(
codew
);
lang
=
SysAllocString
(
langw
);
...
...
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