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
1db3e475
Commit
1db3e475
authored
Feb 09, 2010
by
Piotr Caban
Committed by
Alexandre Julliard
Feb 09, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Fixed CoInternetGetSecurityUrl implementation.
parent
7d369354
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
14 deletions
+28
-14
sec_mgr.c
dlls/urlmon/sec_mgr.c
+28
-14
No files found.
dlls/urlmon/sec_mgr.c
View file @
1db3e475
...
...
@@ -1240,19 +1240,32 @@ HRESULT WINAPI CoInternetCreateZoneManager(IServiceProvider* pSP, IInternetZoneM
*/
HRESULT
WINAPI
CoInternetGetSecurityUrl
(
LPCWSTR
pwzUrl
,
LPWSTR
*
ppwzSecUrl
,
PSUACTION
psuAction
,
DWORD
dwReserved
)
{
WCHAR
url
[
INTERNET_MAX_URL_LENGTH
],
domain
[
INTERNET_MAX_URL_LENGTH
];
WCHAR
buf1
[
INTERNET_MAX_URL_LENGTH
],
buf2
[
INTERNET_MAX_URL_LENGTH
];
LPWSTR
url
,
domain
;
DWORD
len
;
HRESULT
hres
;
TRACE
(
"(%p,%p,%u,%u)
\n
"
,
pwzUrl
,
ppwzSecUrl
,
psuAction
,
dwReserved
);
hres
=
CoInternetParseUrl
(
pwzUrl
,
PARSE_SECURITY_URL
,
0
,
url
,
INTERNET_MAX_URL_LENGTH
,
&
len
,
0
);
if
(
hres
==
S_OK
)
{
if
(
psuAction
==
PSU_DEFAULT
)
hres
=
CoInternetParseUrl
(
url
,
PARSE_SECURITY_DOMAIN
,
0
,
domain
,
INTERNET_MAX_URL_LENGTH
,
&
len
,
0
);
url
=
buf1
;
domain
=
buf2
;
strcpyW
(
url
,
pwzUrl
);
while
(
1
)
{
hres
=
CoInternetParseUrl
(
url
,
PARSE_SECURITY_URL
,
0
,
domain
,
INTERNET_MAX_URL_LENGTH
,
&
len
,
0
);
if
(
hres
!=
S_OK
||
!
strcmpW
(
url
,
domain
))
break
;
if
(
url
==
buf1
)
{
url
=
buf2
;
domain
=
buf1
;
}
else
{
url
=
buf1
;
domain
=
buf2
;
}
}
if
(
psuAction
==
PSU_SECURITY_URL_ONLY
||
hres
!=
S_OK
)
{
if
(
psuAction
==
PSU_SECURITY_URL_ONLY
)
{
len
=
lstrlenW
(
url
)
+
1
;
*
ppwzSecUrl
=
CoTaskMemAlloc
(
len
*
sizeof
(
WCHAR
));
if
(
!*
ppwzSecUrl
)
...
...
@@ -1262,6 +1275,9 @@ HRESULT WINAPI CoInternetGetSecurityUrl(LPCWSTR pwzUrl, LPWSTR *ppwzSecUrl, PSUA
return
S_OK
;
}
hres
=
CoInternetParseUrl
(
url
,
PARSE_SECURITY_DOMAIN
,
0
,
domain
,
INTERNET_MAX_URL_LENGTH
,
&
len
,
0
);
if
(
SUCCEEDED
(
hres
))
{
len
++
;
*
ppwzSecUrl
=
CoTaskMemAlloc
(
len
*
sizeof
(
WCHAR
));
if
(
!*
ppwzSecUrl
)
...
...
@@ -1271,14 +1287,13 @@ HRESULT WINAPI CoInternetGetSecurityUrl(LPCWSTR pwzUrl, LPWSTR *ppwzSecUrl, PSUA
return
S_OK
;
}
if
(
psuAction
==
PSU_DEFAULT
)
{
hres
=
CoInternetParseUrl
(
pwzUrl
,
PARSE_ROOTDOCUMENT
,
0
,
url
,
0
,
&
len
,
0
);
hres
=
CoInternetParseUrl
(
url
,
PARSE_ROOTDOCUMENT
,
0
,
domain
,
0
,
&
len
,
0
);
if
(
hres
==
S_FALSE
)
{
hres
=
CoInternetParseUrl
(
pwzU
rl
,
PARSE_SCHEMA
,
0
,
domain
,
hres
=
CoInternetParseUrl
(
u
rl
,
PARSE_SCHEMA
,
0
,
domain
,
INTERNET_MAX_URL_LENGTH
,
&
len
,
0
);
if
(
hres
==
S_OK
)
{
domain
[
len
]
=
':'
;
hres
=
CoInternetParseUrl
(
pwzU
rl
,
PARSE_DOMAIN
,
0
,
domain
+
len
+
1
,
hres
=
CoInternetParseUrl
(
u
rl
,
PARSE_DOMAIN
,
0
,
domain
+
len
+
1
,
INTERNET_MAX_URL_LENGTH
-
len
-
1
,
&
len
,
0
);
if
(
hres
==
S_OK
)
{
len
=
lstrlenW
(
domain
)
+
1
;
...
...
@@ -1291,13 +1306,12 @@ HRESULT WINAPI CoInternetGetSecurityUrl(LPCWSTR pwzUrl, LPWSTR *ppwzSecUrl, PSUA
}
}
}
}
len
=
lstrlenW
(
pwzU
rl
)
+
1
;
len
=
lstrlenW
(
u
rl
)
+
1
;
*
ppwzSecUrl
=
CoTaskMemAlloc
(
len
*
sizeof
(
WCHAR
));
if
(
!*
ppwzSecUrl
)
return
E_OUTOFMEMORY
;
memcpy
(
*
ppwzSecUrl
,
pwzU
rl
,
len
*
sizeof
(
WCHAR
));
memcpy
(
*
ppwzSecUrl
,
u
rl
,
len
*
sizeof
(
WCHAR
));
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