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
139382a3
Commit
139382a3
authored
Feb 08, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 08, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: CoInternetGetSecurityUrlEx rewrite.
parent
69ee496f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
70 deletions
+19
-70
sec_mgr.c
dlls/urlmon/sec_mgr.c
+19
-70
No files found.
dlls/urlmon/sec_mgr.c
View file @
139382a3
...
@@ -293,59 +293,6 @@ static HRESULT get_action_policy(DWORD zone, DWORD action, BYTE *policy, DWORD s
...
@@ -293,59 +293,6 @@ static HRESULT get_action_policy(DWORD zone, DWORD action, BYTE *policy, DWORD s
return
hres
;
return
hres
;
}
}
static
HRESULT
parse_security_uri
(
IUri
*
uri
,
PSUACTION
action
,
IUri
**
result
)
{
WCHAR
buf1
[
INTERNET_MAX_URL_LENGTH
],
buf2
[
INTERNET_MAX_URL_LENGTH
];
LPWSTR
url
,
tmp
;
HRESULT
hres
;
DWORD
len
=
0
;
BOOL
use_url
=
FALSE
;
url
=
buf1
;
tmp
=
buf2
;
*
result
=
NULL
;
hres
=
IUri_GetPropertyLength
(
uri
,
Uri_PROPERTY_ABSOLUTE_URI
,
&
len
,
0
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
CoInternetParseIUri
(
uri
,
PARSE_SECURITY_URL
,
0
,
url
,
len
+
1
,
&
len
,
0
);
if
(
hres
==
S_OK
)
{
use_url
=
TRUE
;
while
(
TRUE
)
{
hres
=
CoInternetParseUrl
(
url
,
PARSE_SECURITY_URL
,
0
,
tmp
,
len
+
1
,
&
len
,
0
);
if
(
hres
!=
S_OK
||
!
strcmpW
(
url
,
tmp
))
break
;
if
(
url
==
buf1
)
{
url
=
buf2
;
tmp
=
buf1
;
}
else
{
url
=
buf1
;
tmp
=
buf2
;
}
}
}
if
(
action
==
PSU_DEFAULT
)
{
if
(
use_url
)
{
hres
=
CoInternetParseUrl
(
url
,
PARSE_SECURITY_DOMAIN
,
0
,
tmp
,
len
+
1
,
&
len
,
0
);
url
=
tmp
;
}
else
{
hres
=
CoInternetParseIUri
(
uri
,
PARSE_SECURITY_DOMAIN
,
0
,
url
,
len
+
1
,
&
len
,
0
);
if
(
hres
==
S_OK
)
use_url
=
TRUE
;
}
}
if
(
use_url
)
{
hres
=
CreateUri
(
url
,
0
,
0
,
result
);
if
(
FAILED
(
hres
))
return
hres
;
}
return
S_OK
;
}
/***********************************************************************
/***********************************************************************
* InternetSecurityManager implementation
* InternetSecurityManager implementation
*
*
...
@@ -1464,42 +1411,44 @@ HRESULT WINAPI CoInternetGetSecurityUrl(LPCWSTR pwzUrl, LPWSTR *ppwzSecUrl, PSUA
...
@@ -1464,42 +1411,44 @@ HRESULT WINAPI CoInternetGetSecurityUrl(LPCWSTR pwzUrl, LPWSTR *ppwzSecUrl, PSUA
*/
*/
HRESULT
WINAPI
CoInternetGetSecurityUrlEx
(
IUri
*
pUri
,
IUri
**
ppSecUri
,
PSUACTION
psuAction
,
DWORD_PTR
dwReserved
)
HRESULT
WINAPI
CoInternetGetSecurityUrlEx
(
IUri
*
pUri
,
IUri
**
ppSecUri
,
PSUACTION
psuAction
,
DWORD_PTR
dwReserved
)
{
{
HRESULT
hres
;
BSTR
secure_uri
;
URL_SCHEME
scheme_type
;
URL_SCHEME
scheme_type
;
BSTR
secure_uri
;
WCHAR
*
ret_url
;
HRESULT
hres
;
TRACE
(
"(%p,%p,%u,%u)
\n
"
,
pUri
,
ppSecUri
,
psuAction
,
(
DWORD
)
dwReserved
);
TRACE
(
"(%p,%p,%u,%u)
\n
"
,
pUri
,
ppSecUri
,
psuAction
,
(
DWORD
)
dwReserved
);
if
(
!
pUri
||
!
ppSecUri
)
if
(
!
pUri
||
!
ppSecUri
)
return
E_INVALIDARG
;
return
E_INVALIDARG
;
/* Try to find the Security url using pluggable protocols first. */
hres
=
IUri_GetDisplayUri
(
pUri
,
&
secure_uri
);
hres
=
parse_security_uri
(
pUri
,
psuAction
,
ppSecUri
);
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
)
||
*
ppSecUri
)
return
hres
;
return
hres
;
hres
=
IUri_GetScheme
(
pUri
,
(
DWORD
*
)
&
scheme_type
);
hres
=
parse_security_url
(
secure_uri
,
psuAction
,
&
ret_url
);
SysFreeString
(
secure_uri
);
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
return
hres
;
return
hres
;
hres
=
IUri_GetDisplayUri
(
pUri
,
&
secure_uri
);
hres
=
CreateUri
(
ret_url
,
Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME
,
0
,
ppSecUri
);
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
{
CoTaskMemFree
(
ret_url
);
return
hres
;
return
hres
;
}
/* File URIs have to hierarchical. */
/* File URIs have to hierarchical. */
if
(
scheme_type
==
URL_SCHEME_FILE
)
{
hres
=
IUri_GetScheme
(
pUri
,
(
DWORD
*
)
&
scheme_type
);
const
WCHAR
*
tmp
=
secure_uri
;
if
(
SUCCEEDED
(
hres
)
&&
scheme_type
==
URL_SCHEME_FILE
)
{
const
WCHAR
*
tmp
=
ret_url
;
/* Check and see if a "//" is after the scheme name. */
/* Check and see if a "//" is after the scheme name. */
tmp
+=
sizeof
(
fileW
)
/
sizeof
(
WCHAR
);
tmp
+=
sizeof
(
fileW
)
/
sizeof
(
WCHAR
);
if
(
*
tmp
!=
'/'
||
*
(
tmp
+
1
)
!=
'/'
)
{
if
(
*
tmp
!=
'/'
||
*
(
tmp
+
1
)
!=
'/'
)
SysFreeString
(
secure_uri
);
hres
=
E_INVALIDARG
;
return
E_INVALIDARG
;
}
}
}
hres
=
CreateUri
(
secure_uri
,
Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME
,
0
,
ppSecUri
);
if
(
SUCCEEDED
(
hres
))
SysFreeString
(
secure_u
ri
);
hres
=
CreateUri
(
ret_url
,
Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME
,
0
,
ppSecU
ri
);
CoTaskMemFree
(
ret_url
);
return
hres
;
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