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
2c354b8b
Commit
2c354b8b
authored
Jun 20, 2010
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 21, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shdocvw: Return IHTMLDocument2's IDispatch in get_Document.
parent
1eced605
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
3 deletions
+30
-3
htmldoc.c
dlls/mshtml/tests/htmldoc.c
+5
-0
webbrowser.c
dlls/shdocvw/tests/webbrowser.c
+6
-0
webbrowser.c
dlls/shdocvw/webbrowser.c
+19
-3
No files found.
dlls/mshtml/tests/htmldoc.c
View file @
2c354b8b
...
...
@@ -4515,6 +4515,11 @@ static void test_QueryInterface(IHTMLDocument2 *doc)
hres
=
IUnknown_QueryInterface
(
doc
,
&
IID_IStdMarshalInfo
,
(
void
**
)
&
qi
);
ok
(
hres
==
E_NOINTERFACE
,
"QueryInterface returned %08x, expected E_NOINTERFACE
\n
"
,
hres
);
ok
(
qi
==
NULL
,
"qi=%p, expected NULL
\n
"
,
qi
);
hres
=
IUnknown_QueryInterface
(
doc
,
&
IID_IDispatch
,
(
void
**
)
&
qi
);
ok
(
hres
==
S_OK
,
"Could not get IDispatch interface: %08x
\n
"
,
hres
);
ok
(
qi
!=
(
IUnknown
*
)
doc
,
"disp == doc
\n
"
);
IUnknown_Release
(
qi
);
}
static
void
init_test
(
enum
load_state_t
ls
)
{
...
...
dlls/shdocvw/tests/webbrowser.c
View file @
2c354b8b
...
...
@@ -2369,6 +2369,7 @@ static void test_IServiceProvider(IUnknown *unk)
#define get_document(u) _get_document(__LINE__,u)
static
IDispatch
*
_get_document
(
unsigned
line
,
IUnknown
*
unk
)
{
IHTMLDocument2
*
html_doc
;
IWebBrowser2
*
wb
;
IDispatch
*
disp
;
HRESULT
hres
;
...
...
@@ -2382,6 +2383,11 @@ static IDispatch *_get_document(unsigned line, IUnknown *unk)
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"get_Document failed: %08x
\n
"
,
hres
);
ok_
(
__FILE__
,
line
)(
disp
!=
NULL
,
"doc_disp == NULL
\n
"
);
hres
=
IDispatch_QueryInterface
(
disp
,
&
IID_IHTMLDocument2
,
(
void
**
)
&
html_doc
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"Could not get IHTMLDocument iface: %08x
\n
"
,
hres
);
ok
(
disp
==
(
IDispatch
*
)
html_doc
,
"disp != html_doc
\n
"
);
IHTMLDocument_Release
(
html_doc
);
return
disp
;
}
...
...
dlls/shdocvw/webbrowser.c
View file @
2c354b8b
...
...
@@ -22,6 +22,7 @@
#include "wine/debug.h"
#include "shdocvw.h"
#include "exdispid.h"
#include "mshtml.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
shdocvw
);
...
...
@@ -334,13 +335,28 @@ static HRESULT WINAPI WebBrowser_get_Container(IWebBrowser2 *iface, IDispatch **
static
HRESULT
WINAPI
WebBrowser_get_Document
(
IWebBrowser2
*
iface
,
IDispatch
**
ppDisp
)
{
WebBrowser
*
This
=
WEBBROWSER_THIS
(
iface
);
IDispatch
*
disp
=
NULL
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
ppDisp
);
*
ppDisp
=
NULL
;
if
(
This
->
doc_host
.
document
)
IUnknown_QueryInterface
(
This
->
doc_host
.
document
,
&
IID_IDispatch
,
(
void
**
)
ppDisp
);
if
(
This
->
doc_host
.
document
)
{
HRESULT
hres
;
hres
=
IUnknown_QueryInterface
(
This
->
doc_host
.
document
,
&
IID_IDispatch
,
(
void
**
)
&
disp
);
if
(
SUCCEEDED
(
hres
))
{
IDispatch
*
html_doc
;
/* Some broken apps cast returned IDispatch to IHTMLDocument2
* without QueryInterface call */
hres
=
IDispatch_QueryInterface
(
disp
,
&
IID_IHTMLDocument2
,
(
void
**
)
&
html_doc
);
if
(
SUCCEEDED
(
hres
))
{
IDispatch_Release
(
disp
);
disp
=
html_doc
;
}
}
}
*
ppDisp
=
disp
;
return
S_OK
;
}
...
...
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