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
dbbcbd59
Commit
dbbcbd59
authored
Dec 10, 2010
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 10, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added beginning support for loading data by an ActiveX object.
parent
e7cb2d35
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
91 additions
and
10 deletions
+91
-10
npplugin.c
dlls/mshtml/npplugin.c
+8
-8
pluginhost.c
dlls/mshtml/pluginhost.c
+80
-1
pluginhost.h
dlls/mshtml/pluginhost.h
+3
-1
No files found.
dlls/mshtml/npplugin.c
View file @
dbbcbd59
...
...
@@ -203,31 +203,30 @@ static BOOL get_elem_clsid(nsIDOMElement *elem, CLSID *clsid)
return
ret
;
}
static
IUnknown
*
create_activex_object
(
HTMLWindow
*
window
,
nsIDOMElement
*
nselem
)
static
IUnknown
*
create_activex_object
(
HTMLWindow
*
window
,
nsIDOMElement
*
nselem
,
CLSID
*
clsid
)
{
IClassFactoryEx
*
cfex
;
IClassFactory
*
cf
;
IUnknown
*
obj
;
DWORD
policy
;
CLSID
guid
;
HRESULT
hres
;
if
(
!
get_elem_clsid
(
nselem
,
&
gu
id
))
{
if
(
!
get_elem_clsid
(
nselem
,
cls
id
))
{
WARN
(
"Could not determine element CLSID
\n
"
);
return
NULL
;
}
TRACE
(
"clsid %s
\n
"
,
debugstr_guid
(
&
gu
id
));
TRACE
(
"clsid %s
\n
"
,
debugstr_guid
(
cls
id
));
policy
=
0
;
hres
=
IInternetHostSecurityManager_ProcessUrlAction
(
HOSTSECMGR
(
window
->
doc
),
URLACTION_ACTIVEX_RUN
,
(
BYTE
*
)
&
policy
,
sizeof
(
policy
),
(
BYTE
*
)
&
gu
id
,
sizeof
(
GUID
),
0
,
0
);
(
BYTE
*
)
&
policy
,
sizeof
(
policy
),
(
BYTE
*
)
cls
id
,
sizeof
(
GUID
),
0
,
0
);
if
(
FAILED
(
hres
)
||
policy
!=
URLPOLICY_ALLOW
)
{
WARN
(
"ProcessUrlAction returned %08x %x
\n
"
,
hres
,
policy
);
return
NULL
;
}
hres
=
CoGetClassObject
(
&
gu
id
,
CLSCTX_INPROC_SERVER
|
CLSCTX_LOCAL_SERVER
,
NULL
,
&
IID_IClassFactory
,
(
void
**
)
&
cf
);
hres
=
CoGetClassObject
(
cls
id
,
CLSCTX_INPROC_SERVER
|
CLSCTX_LOCAL_SERVER
,
NULL
,
&
IID_IClassFactory
,
(
void
**
)
&
cf
);
if
(
FAILED
(
hres
))
return
NULL
;
...
...
@@ -250,6 +249,7 @@ static NPError CDECL NPP_New(NPMIMEType pluginType, NPP instance, UINT16 mode, I
nsIDOMElement
*
nselem
;
HTMLWindow
*
window
;
IUnknown
*
obj
;
CLSID
clsid
;
NPError
err
=
NPERR_NO_ERROR
;
TRACE
(
"(%s %p %x %d %p %p %p)
\n
"
,
debugstr_a
(
pluginType
),
instance
,
mode
,
argc
,
argn
,
argv
,
saved
);
...
...
@@ -267,12 +267,12 @@ static NPError CDECL NPP_New(NPMIMEType pluginType, NPP instance, UINT16 mode, I
return
NPERR_GENERIC_ERROR
;
}
obj
=
create_activex_object
(
window
,
nselem
);
obj
=
create_activex_object
(
window
,
nselem
,
&
clsid
);
if
(
obj
)
{
PluginHost
*
host
;
HRESULT
hres
;
hres
=
create_plugin_host
(
window
->
doc
,
nselem
,
obj
,
&
host
);
hres
=
create_plugin_host
(
window
->
doc
,
nselem
,
obj
,
&
clsid
,
&
host
);
nsIDOMElement_Release
(
nselem
);
IUnknown_Release
(
obj
);
if
(
SUCCEEDED
(
hres
))
...
...
dlls/mshtml/pluginhost.c
View file @
dbbcbd59
...
...
@@ -39,6 +39,81 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
const
IID
IID_HTMLPluginContainer
=
{
0xbd7a6050
,
0xb373
,
0x4f6f
,{
0xa4
,
0x93
,
0xdd
,
0x40
,
0xc5
,
0x23
,
0xa8
,
0x6a
}};
static
BOOL
check_load_safety
(
PluginHost
*
host
)
{
DWORD
policy_size
,
policy
;
struct
CONFIRMSAFETY
cs
;
BYTE
*
ppolicy
;
HRESULT
hres
;
cs
.
clsid
=
host
->
clsid
;
cs
.
pUnk
=
host
->
plugin_unk
;
cs
.
dwFlags
=
CONFIRMSAFETYACTION_LOADOBJECT
;
hres
=
IInternetHostSecurityManager_QueryCustomPolicy
(
HOSTSECMGR
(
host
->
doc
),
&
GUID_CUSTOM_CONFIRMOBJECTSAFETY
,
&
ppolicy
,
&
policy_size
,
(
BYTE
*
)
&
cs
,
sizeof
(
cs
),
0
);
if
(
FAILED
(
hres
))
return
FALSE
;
policy
=
*
(
DWORD
*
)
ppolicy
;
CoTaskMemFree
(
ppolicy
);
return
policy
==
URLPOLICY_ALLOW
;
}
static
HRESULT
create_prop_bag
(
IPropertyBag
**
ret
)
{
*
ret
=
NULL
;
return
S_OK
;
}
static
void
load_prop_bag
(
PluginHost
*
host
,
IPersistPropertyBag
*
persist_prop_bag
)
{
IPropertyBag
*
prop_bag
;
HRESULT
hres
;
hres
=
create_prop_bag
(
&
prop_bag
);
if
(
FAILED
(
hres
))
return
;
if
(
prop_bag
&&
!
check_load_safety
(
host
))
{
IPropertyBag_Release
(
prop_bag
);
prop_bag
=
NULL
;
}
if
(
prop_bag
)
{
hres
=
IPersistPropertyBag_Load
(
persist_prop_bag
,
prop_bag
,
NULL
);
IPropertyBag_Release
(
prop_bag
);
if
(
FAILED
(
hres
))
WARN
(
"Load failed: %08x
\n
"
,
hres
);
}
else
{
hres
=
IPersistPropertyBag_InitNew
(
persist_prop_bag
);
if
(
FAILED
(
hres
))
WARN
(
"InitNew failed: %08x
\n
"
,
hres
);
}
}
static
void
load_plugin
(
PluginHost
*
host
)
{
IPersistPropertyBag2
*
persist_prop_bag2
;
IPersistPropertyBag
*
persist_prop_bag
;
HRESULT
hres
;
hres
=
IUnknown_QueryInterface
(
host
->
plugin_unk
,
&
IID_IPersistPropertyBag2
,
(
void
**
)
&
persist_prop_bag2
);
if
(
SUCCEEDED
(
hres
))
{
FIXME
(
"Use IPersistPropertyBag2 iface
\n
"
);
IPersistPropertyBag2_Release
(
persist_prop_bag2
);
return
;
}
hres
=
IUnknown_QueryInterface
(
host
->
plugin_unk
,
&
IID_IPersistPropertyBag
,
(
void
**
)
&
persist_prop_bag
);
if
(
SUCCEEDED
(
hres
))
{
load_prop_bag
(
host
,
persist_prop_bag
);
IPersistPropertyBag_Release
(
persist_prop_bag
);
return
;
}
FIXME
(
"No IPersistPeropertyBag iface
\n
"
);
}
static
void
activate_plugin
(
PluginHost
*
host
)
{
IClientSecurity
*
client_security
;
...
...
@@ -74,7 +149,10 @@ static void activate_plugin(PluginHost *host)
FIXME
(
"QuickActivate failed: %08x
\n
"
,
hres
);
}
else
{
FIXME
(
"No IQuickActivate
\n
"
);
return
;
}
load_plugin
(
host
);
}
void
update_plugin_window
(
PluginHost
*
host
,
HWND
hwnd
,
const
RECT
*
rect
)
...
...
@@ -769,7 +847,7 @@ void detach_plugin_hosts(HTMLDocumentNode *doc)
}
}
HRESULT
create_plugin_host
(
HTMLDocumentNode
*
doc
,
nsIDOMElement
*
nselem
,
IUnknown
*
unk
,
PluginHost
**
ret
)
HRESULT
create_plugin_host
(
HTMLDocumentNode
*
doc
,
nsIDOMElement
*
nselem
,
IUnknown
*
unk
,
const
CLSID
*
clsid
,
PluginHost
**
ret
)
{
PluginHost
*
host
;
HRESULT
hres
;
...
...
@@ -797,6 +875,7 @@ HRESULT create_plugin_host(HTMLDocumentNode *doc, nsIDOMElement *nselem, IUnknow
IUnknown_AddRef
(
unk
);
host
->
plugin_unk
=
unk
;
host
->
clsid
=
*
clsid
;
host
->
doc
=
doc
;
list_add_tail
(
&
doc
->
plugin_hosts
,
&
host
->
entry
);
...
...
dlls/mshtml/pluginhost.h
View file @
dbbcbd59
...
...
@@ -31,7 +31,9 @@ typedef struct {
LONG
ref
;
IUnknown
*
plugin_unk
;
CLSID
clsid
;
HWND
hwnd
;
RECT
rect
;
HTMLDocumentNode
*
doc
;
struct
list
entry
;
...
...
@@ -47,6 +49,6 @@ struct HTMLPluginContainer {
extern
const
IID
IID_HTMLPluginContainer
;
HRESULT
create_plugin_host
(
HTMLDocumentNode
*
,
nsIDOMElement
*
,
IUnknown
*
,
PluginHost
**
);
HRESULT
create_plugin_host
(
HTMLDocumentNode
*
,
nsIDOMElement
*
,
IUnknown
*
,
const
CLSID
*
,
PluginHost
**
);
void
update_plugin_window
(
PluginHost
*
,
HWND
,
const
RECT
*
);
void
detach_plugin_hosts
(
HTMLDocumentNode
*
);
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