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
8cb7dc2e
Commit
8cb7dc2e
authored
Nov 30, 2022
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Nov 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Don't lock document mode when querying IEventTarget.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
2e4721ac
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
1 deletion
+52
-1
oleobj.c
dlls/mshtml/oleobj.c
+1
-1
dom.c
dlls/mshtml/tests/dom.c
+51
-0
No files found.
dlls/mshtml/oleobj.c
View file @
8cb7dc2e
...
...
@@ -3380,7 +3380,7 @@ static HRESULT WINAPI HTMLDocumentObj_QueryInterface(IUnknown *iface, REFIID rii
}
else
if
(
IsEqualGUID
(
&
IID_IEventTarget
,
riid
))
{
/* IEventTarget is conditionally exposed. This breaks COM rules when
it changes its compat mode, but it is how native works (see tests). */
if
(
!
This
->
doc_node
||
dispex_compat_mode
(
&
This
->
doc_node
->
node
.
event_target
.
dispex
)
<
COMPAT_MODE_IE9
)
{
if
(
!
This
->
doc_node
||
This
->
doc_node
->
document_mode
<
COMPAT_MODE_IE9
)
{
*
ppv
=
NULL
;
return
E_NOINTERFACE
;
}
...
...
dlls/mshtml/tests/dom.c
View file @
8cb7dc2e
...
...
@@ -11731,6 +11731,56 @@ static void test_quirks_mode(void)
"</html>"
,
test_document_mode
);
}
static
void
test_document_mode_lock
(
void
)
{
IEventTarget
*
event_target
;
IPersistStreamInit
*
init
;
IHTMLDocument2
*
doc
;
IStream
*
stream
;
HRESULT
hres
;
HGLOBAL
mem
;
SIZE_T
len
;
MSG
msg
;
notif_doc
=
doc
=
create_document
();
if
(
!
doc
)
return
;
doc_complete
=
FALSE
;
hres
=
IHTMLDocument2_QueryInterface
(
doc
,
&
IID_IEventTarget
,
(
void
**
)
&
event_target
);
ok
(
hres
==
E_NOINTERFACE
,
"QueryInterface(IID_IEventTarget) returned %08lx.
\n
"
,
hres
);
ok
(
event_target
==
NULL
,
"event_target != NULL
\n
"
);
len
=
strlen
(
doc_blank_ie9
);
mem
=
GlobalAlloc
(
0
,
len
);
memcpy
(
mem
,
doc_blank_ie9
,
len
);
hres
=
CreateStreamOnHGlobal
(
mem
,
TRUE
,
&
stream
);
ok
(
hres
==
S_OK
,
"Failed to create stream: %08lx.
\n
"
,
hres
);
hres
=
IHTMLDocument2_QueryInterface
(
doc
,
&
IID_IPersistStreamInit
,
(
void
**
)
&
init
);
ok
(
hres
==
S_OK
,
"QueryInterface(IID_IPersistStreamInit) failed: %08lx.
\n
"
,
hres
);
IPersistStreamInit_Load
(
init
,
stream
);
IPersistStreamInit_Release
(
init
);
IStream_Release
(
stream
);
set_client_site
(
doc
,
TRUE
);
do_advise
((
IUnknown
*
)
doc
,
&
IID_IPropertyNotifySink
,
(
IUnknown
*
)
&
PropertyNotifySink
);
while
(
!
doc_complete
&&
GetMessageW
(
&
msg
,
NULL
,
0
,
0
))
{
TranslateMessage
(
&
msg
);
DispatchMessageW
(
&
msg
);
}
hres
=
IHTMLDocument2_QueryInterface
(
doc
,
&
IID_IEventTarget
,
(
void
**
)
&
event_target
);
ok
(
hres
==
S_OK
,
"QueryInterface(IID_IEventTarget) returned %08lx.
\n
"
,
hres
);
ok
(
event_target
!=
NULL
,
"event_target == NULL
\n
"
);
IEventTarget_Release
(
event_target
);
set_client_site
(
doc
,
FALSE
);
IHTMLDocument2_Release
(
doc
);
}
static
void
test_custom_user_agent
(
IHTMLDocument2
*
doc
)
{
static
const
WCHAR
ua
[]
=
L"1234567890xxxABC"
;
...
...
@@ -11830,6 +11880,7 @@ START_TEST(dom)
run_domtest
(
doctype_str
,
test_doctype
);
test_quirks_mode
();
test_document_mode_lock
();
/* Run this last since it messes with the process-wide user agent */
if
(
winetest_interactive
||
!
is_ie_hardened
())
{
...
...
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