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
8791ce15
Commit
8791ce15
authored
Apr 05, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 05, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added support for IDispatch-only ActiveX objects.
parent
5fad02d0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
31 deletions
+60
-31
pluginhost.c
dlls/mshtml/pluginhost.c
+23
-22
activex.c
dlls/mshtml/tests/activex.c
+37
-9
No files found.
dlls/mshtml/pluginhost.c
View file @
8791ce15
...
...
@@ -185,9 +185,9 @@ static void activate_plugin(PluginHost *host)
{
IClientSecurity
*
client_security
;
IQuickActivate
*
quick_activate
;
IOleObject
*
ole_obj
=
NULL
;
IOleCommandTarget
*
cmdtrg
;
IViewObjectEx
*
view_obj
;
IOleObject
*
ole_obj
;
IDispatchEx
*
dispex
;
IDispatch
*
disp
;
RECT
rect
;
...
...
@@ -223,29 +223,28 @@ static void activate_plugin(PluginHost *host)
IQuickActivate_Release
(
quick_activate
);
if
(
FAILED
(
hres
))
FIXME
(
"QuickActivate failed: %08x
\n
"
,
hres
);
load_plugin
(
host
);
}
else
{
DWORD
status
=
0
;
hres
=
IUnknown_QueryInterface
(
host
->
plugin_unk
,
&
IID_IOleObject
,
(
void
**
)
&
ole_obj
);
if
(
FAILED
(
hres
))
{
FIXME
(
"Plugin does not support IOleObject
\n
"
);
return
;
}
hres
=
IOleObject_GetMiscStatus
(
ole_obj
,
DVASPECT_CONTENT
,
&
status
);
TRACE
(
"GetMiscStatus returned %08x %x
\n
"
,
hres
,
status
);
if
(
SUCCEEDED
(
hres
))
{
hres
=
IOleObject_GetMiscStatus
(
ole_obj
,
DVASPECT_CONTENT
,
&
status
);
TRACE
(
"GetMiscStatus returned %08x %x
\n
"
,
hres
,
status
);
hres
=
IOleObject_SetClientSite
(
ole_obj
,
&
host
->
IOleClientSite_iface
);
IOleObject_Release
(
ole_obj
);
if
(
FAILED
(
hres
))
{
FIXME
(
"SetClientSite failed: %08x
\n
"
,
hres
);
return
;
hres
=
IOleObject_SetClientSite
(
ole_obj
,
&
host
->
IOleClientSite_iface
);
IOleObject_Release
(
ole_obj
);
if
(
FAILED
(
hres
))
{
FIXME
(
"SetClientSite failed: %08x
\n
"
,
hres
);
return
;
}
}
else
{
TRACE
(
"Plugin does not support IOleObject
\n
"
);
}
}
load_plugin
(
host
);
load_plugin
(
host
);
if
(
ole_obj
)
{
hres
=
IUnknown_QueryInterface
(
host
->
plugin_unk
,
&
IID_IViewObjectEx
,
(
void
**
)
&
view_obj
);
if
(
SUCCEEDED
(
hres
))
{
DWORD
view_status
=
0
;
...
...
@@ -288,11 +287,13 @@ static void activate_plugin(PluginHost *host)
return
;
}
get_pos_rect
(
host
,
&
rect
);
hres
=
IOleObject_DoVerb
(
ole_obj
,
OLEIVERB_INPLACEACTIVATE
,
NULL
,
&
host
->
IOleClientSite_iface
,
0
,
host
->
hwnd
,
&
rect
);
IOleObject_Release
(
ole_obj
);
if
(
FAILED
(
hres
))
WARN
(
"DoVerb failed: %08x
\n
"
,
hres
);
if
(
ole_obj
)
{
get_pos_rect
(
host
,
&
rect
);
hres
=
IOleObject_DoVerb
(
ole_obj
,
OLEIVERB_INPLACEACTIVATE
,
NULL
,
&
host
->
IOleClientSite_iface
,
0
,
host
->
hwnd
,
&
rect
);
IOleObject_Release
(
ole_obj
);
if
(
FAILED
(
hres
))
WARN
(
"DoVerb failed: %08x
\n
"
,
hres
);
}
if
(
host
->
ip_object
)
{
HWND
hwnd
;
...
...
@@ -390,7 +391,7 @@ HRESULT get_plugin_dispid(HTMLPluginContainer *plugin_container, WCHAR *name, DI
}
else
if
(
plugin_container
->
props_len
==
plugin_container
->
props_size
)
{
DISPID
*
new_props
;
new_props
=
heap_realloc
(
plugin_container
->
props
,
plugin_container
->
props_size
*
2
);
new_props
=
heap_realloc
(
plugin_container
->
props
,
plugin_container
->
props_size
*
2
*
sizeof
(
DISPID
)
);
if
(
!
new_props
)
return
E_OUTOFMEMORY
;
...
...
dlls/mshtml/tests/activex.c
View file @
8791ce15
...
...
@@ -95,11 +95,13 @@ DEFINE_EXPECT(wrapped_func);
enum
{
TEST_FLASH
,
TEST_NOQUICKACT
TEST_NOQUICKACT
,
TEST_DISPONLY
};
static
HWND
container_hwnd
,
plugin_hwnd
;
static
int
plugin_behavior
;
static
BOOL
no_quickact
;
#define TESTACTIVEX_CLSID "{178fc163-f585-4e24-9c13-4bb7f6680746}"
...
...
@@ -1204,24 +1206,24 @@ static void init_wrapped_iface(void)
static
HRESULT
ax_qi
(
REFIID
riid
,
void
**
ppv
)
{
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_IOleControl
))
{
*
ppv
=
&
OleControl
;
*
ppv
=
plugin_behavior
==
TEST_DISPONLY
?
NULL
:
&
OleControl
;
}
else
if
(
IsEqualGUID
(
riid
,
&
IID_IQuickActivate
))
{
*
ppv
=
plugin_behavior
==
TEST_NOQUICKACT
?
NULL
:
&
QuickActivate
;
*
ppv
=
no_quickact
?
NULL
:
&
QuickActivate
;
}
else
if
(
IsEqualGUID
(
riid
,
&
IID_IPersistPropertyBag
))
{
*
ppv
=
plugin_behavior
==
TEST_NOQUICKACT
?
NULL
:
&
PersistPropertyBag
;
*
ppv
=
no_quickact
?
NULL
:
&
PersistPropertyBag
;
}
else
if
(
IsEqualGUID
(
riid
,
&
IID_IDispatch
))
{
*
ppv
=
&
Dispatch
;
}
else
if
(
IsEqualGUID
(
riid
,
&
IID_IViewObject
)
||
IsEqualGUID
(
riid
,
&
IID_IViewObject2
)
||
IsEqualGUID
(
riid
,
&
IID_IViewObjectEx
))
{
*
ppv
=
&
ViewObjectEx
;
*
ppv
=
plugin_behavior
==
TEST_DISPONLY
?
NULL
:
&
ViewObjectEx
;
}
else
if
(
IsEqualGUID
(
riid
,
&
IID_IOleObject
))
{
*
ppv
=
&
OleObject
;
*
ppv
=
plugin_behavior
==
TEST_DISPONLY
?
NULL
:
&
OleObject
;
}
else
if
(
IsEqualGUID
(
riid
,
&
IID_ITestActiveX
))
{
CHECK_EXPECT
(
QI_ITestActiveX
);
*
ppv
=
&
wrapped_iface
;
}
else
if
(
IsEqualGUID
(
riid
,
&
IID_IOleWindow
)
||
IsEqualGUID
(
riid
,
&
IID_IOleInPlaceObject
)
||
IsEqualGUID
(
&
IID_IOleInPlaceObjectWindowless
,
riid
))
{
*
ppv
=
&
OleInPlaceObjectWindowless
;
*
ppv
=
plugin_behavior
==
TEST_DISPONLY
?
NULL
:
&
OleInPlaceObjectWindowless
;
}
else
{
trace
(
"QI %s
\n
"
,
debugstr_guid
(
riid
));
*
ppv
=
NULL
;
...
...
@@ -2081,11 +2083,18 @@ static void release_doc(IHTMLDocument2 *doc)
}
}
static
void
init_test
(
int
behavior
)
{
plugin_behavior
=
behavior
;
no_quickact
=
behavior
==
TEST_NOQUICKACT
||
behavior
==
TEST_DISPONLY
;
}
static
void
test_flash_ax
(
void
)
{
IHTMLDocument2
*
doc
;
plugin_behavior
=
TEST_FLASH
;
init_test
(
TEST_FLASH
)
;
/*
* We pump messages until both document is loaded and plugin instance is created.
...
...
@@ -2147,7 +2156,7 @@ static void test_noquickact_ax(void)
{
IHTMLDocument2
*
doc
;
plugin_behavior
=
TEST_NOQUICKACT
;
init_test
(
TEST_NOQUICKACT
)
;
SET_EXPECT
(
CreateInstance
);
SET_EXPECT
(
FreezeEvents_TRUE
);
...
...
@@ -2188,6 +2197,23 @@ static void test_noquickact_ax(void)
CHECK_CALLED
(
SetClientSite_NULL
);
}
static
void
test_nooleobj_ax
(
void
)
{
IHTMLDocument2
*
doc
;
init_test
(
TEST_DISPONLY
);
SET_EXPECT
(
CreateInstance
);
SET_EXPECT
(
Invoke_READYSTATE
);
doc
=
create_doc
(
object_ax_str
,
&
called_CreateInstance
);
CHECK_CALLED
(
CreateInstance
);
CHECK_CALLED
(
Invoke_READYSTATE
);
release_doc
(
doc
);
}
static
LRESULT
WINAPI
wnd_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
return
DefWindowProc
(
hwnd
,
msg
,
wParam
,
lParam
);
...
...
@@ -2305,6 +2331,8 @@ START_TEST(activex)
test_flash_ax
();
trace
(
"Testing plugin without IQuickActivate iface...
\n
"
);
test_noquickact_ax
();
trace
(
"Testing plugin with IDispatch iface only...
\n
"
);
test_nooleobj_ax
();
init_registry
(
FALSE
);
}
else
{
skip
(
"Could not register ActiveX
\n
"
);
...
...
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