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
0ebbcedd
Commit
0ebbcedd
authored
Mar 11, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Use global security manager.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
067e982b
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
16 deletions
+31
-16
htmldoc.c
dlls/mshtml/htmldoc.c
+4
-0
htmlwindow.c
dlls/mshtml/htmlwindow.c
+0
-9
main.c
dlls/mshtml/main.c
+20
-0
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-2
mutation.c
dlls/mshtml/mutation.c
+2
-1
persist.c
dlls/mshtml/persist.c
+1
-1
secmgr.c
dlls/mshtml/secmgr.c
+3
-3
No files found.
dlls/mshtml/htmldoc.c
View file @
0ebbcedd
...
...
@@ -5446,6 +5446,10 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii
return
E_INVALIDARG
;
}
/* ensure that security manager is initialized */
if
(
!
get_security_manager
())
return
E_OUTOFMEMORY
;
doc
=
heap_alloc_zero
(
sizeof
(
HTMLDocumentObj
));
if
(
!
doc
)
return
E_OUTOFMEMORY
;
...
...
dlls/mshtml/htmlwindow.c
View file @
0ebbcedd
...
...
@@ -228,9 +228,6 @@ static void release_outer_window(HTMLOuterWindow *This)
if
(
This
->
base
.
inner_window
)
detach_inner_window
(
This
->
base
.
inner_window
);
if
(
This
->
secmgr
)
IInternetSecurityManager_Release
(
This
->
secmgr
);
if
(
This
->
frame_element
)
This
->
frame_element
->
content_window
=
NULL
;
...
...
@@ -3574,12 +3571,6 @@ HRESULT HTMLOuterWindow_Create(HTMLDocumentObj *doc_obj, nsIDOMWindow *nswindow,
return
hres
;
}
hres
=
CoInternetCreateSecurityManager
(
NULL
,
&
window
->
secmgr
,
0
);
if
(
FAILED
(
hres
))
{
IHTMLWindow2_Release
(
&
window
->
base
.
IHTMLWindow2_iface
);
return
hres
;
}
if
(
parent
)
{
IHTMLWindow2_AddRef
(
&
window
->
base
.
IHTMLWindow2_iface
);
...
...
dlls/mshtml/main.c
View file @
0ebbcedd
...
...
@@ -54,6 +54,7 @@ DWORD mshtml_tls = TLS_OUT_OF_INDEXES;
static
HINSTANCE
shdoclc
=
NULL
;
static
WCHAR
*
status_strings
[
IDS_STATUS_LAST
-
IDS_STATUS_FIRST
+
1
];
static
IMultiLanguage2
*
mlang
;
static
IInternetSecurityManager
*
security_manager
;
static
unsigned
global_max_compat_mode
=
COMPAT_MODE_IE11
;
static
struct
list
compat_config
=
LIST_INIT
(
compat_config
);
...
...
@@ -118,6 +119,23 @@ BSTR charset_string_from_cp(UINT cp)
return
SysAllocString
(
info
.
wszWebCharset
);
}
IInternetSecurityManager
*
get_security_manager
(
void
)
{
if
(
!
security_manager
)
{
IInternetSecurityManager
*
manager
;
HRESULT
hres
;
hres
=
CoInternetCreateSecurityManager
(
NULL
,
&
manager
,
0
);
if
(
FAILED
(
hres
))
return
NULL
;
if
(
InterlockedCompareExchangePointer
((
void
**
)
&
security_manager
,
manager
,
NULL
))
IInternetSecurityManager_Release
(
manager
);
}
return
security_manager
;
}
static
BOOL
read_compat_mode
(
HKEY
key
,
compat_mode_t
*
r
)
{
WCHAR
version
[
32
];
...
...
@@ -266,6 +284,8 @@ static void process_detach(void)
TlsFree
(
mshtml_tls
);
if
(
mlang
)
IMultiLanguage2_Release
(
mlang
);
if
(
security_manager
)
IInternetSecurityManager_Release
(
security_manager
);
free_strings
();
}
...
...
dlls/mshtml/mshtml_private.h
View file @
0ebbcedd
...
...
@@ -499,8 +499,6 @@ struct HTMLOuterWindow {
SCRIPTMODE
scriptmode
;
IInternetSecurityManager
*
secmgr
;
struct
list
sibling_entry
;
struct
wine_rb_entry
entry
;
};
...
...
@@ -1330,5 +1328,6 @@ UINT cp_from_charset_string(BSTR) DECLSPEC_HIDDEN;
BSTR
charset_string_from_cp
(
UINT
)
DECLSPEC_HIDDEN
;
HINSTANCE
get_shdoclc
(
void
)
DECLSPEC_HIDDEN
;
void
set_statustext
(
HTMLDocumentObj
*
,
INT
,
LPCWSTR
)
DECLSPEC_HIDDEN
;
IInternetSecurityManager
*
get_security_manager
(
void
)
DECLSPEC_HIDDEN
;
extern
HINSTANCE
hInst
DECLSPEC_HIDDEN
;
dlls/mshtml/mutation.c
View file @
0ebbcedd
...
...
@@ -818,6 +818,7 @@ static void NSAPI nsDocumentObserver_BindToDocument(nsIDocumentObserver *iface,
if
(
This
->
document_mode
==
COMPAT_MODE_QUIRKS
)
{
nsIDOMDocumentType
*
nsdoctype
;
nsres
=
nsIContent_QueryInterface
(
aContent
,
&
IID_nsIDOMDocumentType
,
(
void
**
)
&
nsdoctype
);
if
(
NS_SUCCEEDED
(
nsres
))
{
compat_mode_t
mode
=
COMPAT_MODE_IE7
;
...
...
@@ -835,7 +836,7 @@ static void NSAPI nsDocumentObserver_BindToDocument(nsIDocumentObserver *iface,
* X-UA-Compatible version, allow configuration and default to higher version
* (once it's well supported).
*/
hres
=
IInternetSecurityManager_MapUrlToZone
(
window
->
secmgr
,
window
->
url
,
&
zone
,
0
);
hres
=
IInternetSecurityManager_MapUrlToZone
(
get_security_manager
()
,
window
->
url
,
&
zone
,
0
);
if
(
SUCCEEDED
(
hres
)
&&
zone
==
URLZONE_INTERNET
)
mode
=
COMPAT_MODE_IE8
;
}
...
...
dlls/mshtml/persist.c
View file @
0ebbcedd
...
...
@@ -62,7 +62,7 @@ static BOOL use_gecko_script(HTMLOuterWindow *window)
DWORD
zone
;
HRESULT
hres
;
hres
=
IInternetSecurityManager_MapUrlToZone
(
window
->
secmgr
,
window
->
url
,
&
zone
,
0
);
hres
=
IInternetSecurityManager_MapUrlToZone
(
get_security_manager
()
,
window
->
url
,
&
zone
,
0
);
if
(
FAILED
(
hres
))
{
WARN
(
"Could not map %s to zone: %08x
\n
"
,
debugstr_w
(
window
->
url
),
hres
);
return
TRUE
;
...
...
dlls/mshtml/secmgr.c
View file @
0ebbcedd
...
...
@@ -86,7 +86,7 @@ static HRESULT WINAPI InternetHostSecurityManager_ProcessUrlAction(IInternetHost
url
=
This
->
basedoc
.
window
->
url
?
This
->
basedoc
.
window
->
url
:
about_blankW
;
return
IInternetSecurityManager_ProcessUrlAction
(
This
->
basedoc
.
window
->
secmgr
,
url
,
dwAction
,
pPolicy
,
cbPolicy
,
return
IInternetSecurityManager_ProcessUrlAction
(
get_security_manager
()
,
url
,
dwAction
,
pPolicy
,
cbPolicy
,
pContext
,
cbContext
,
dwFlags
,
dwReserved
);
}
...
...
@@ -122,7 +122,7 @@ static HRESULT confirm_safety(HTMLDocumentNode *This, const WCHAR *url, struct C
/* FIXME: Check URLACTION_ACTIVEX_OVERRIDE_SCRIPT_SAFETY */
hres
=
IInternetSecurityManager_ProcessUrlAction
(
This
->
basedoc
.
window
->
secmgr
,
url
,
URLACTION_SCRIPT_SAFE_ACTIVEX
,
hres
=
IInternetSecurityManager_ProcessUrlAction
(
get_security_manager
()
,
url
,
URLACTION_SCRIPT_SAFE_ACTIVEX
,
(
BYTE
*
)
&
policy
,
sizeof
(
policy
),
NULL
,
0
,
0
,
0
);
if
(
FAILED
(
hres
)
||
policy
!=
URLPOLICY_ALLOW
)
{
*
ret
=
URLPOLICY_DISALLOW
;
...
...
@@ -191,7 +191,7 @@ static HRESULT WINAPI InternetHostSecurityManager_QueryCustomPolicy(IInternetHos
url
=
This
->
basedoc
.
window
->
url
?
This
->
basedoc
.
window
->
url
:
about_blankW
;
hres
=
IInternetSecurityManager_QueryCustomPolicy
(
This
->
basedoc
.
window
->
secmgr
,
url
,
guidKey
,
ppPolicy
,
pcbPolicy
,
hres
=
IInternetSecurityManager_QueryCustomPolicy
(
get_security_manager
()
,
url
,
guidKey
,
ppPolicy
,
pcbPolicy
,
pContext
,
cbContext
,
dwReserved
);
if
(
hres
!=
HRESULT_FROM_WIN32
(
ERROR_NOT_FOUND
))
return
hres
;
...
...
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