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
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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
33 deletions
+47
-33
sec_mgr.c
dlls/urlmon/sec_mgr.c
+47
-33
No files found.
dlls/urlmon/sec_mgr.c
View file @
1db3e475
...
...
@@ -1240,28 +1240,44 @@ 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
)
{
len
=
lstrlenW
(
url
)
+
1
;
*
ppwzSecUrl
=
CoTaskMemAlloc
(
len
*
sizeof
(
WCHAR
));
if
(
!*
ppwzSecUrl
)
return
E_OUTOFMEMORY
;
if
(
psuAction
==
PSU_SECURITY_URL_ONLY
)
{
len
=
lstrlenW
(
url
)
+
1
;
*
ppwzSecUrl
=
CoTaskMemAlloc
(
len
*
sizeof
(
WCHAR
));
if
(
!*
ppwzSecUrl
)
return
E_OUTOFMEMORY
;
memcpy
(
*
ppwzSecUrl
,
url
,
len
*
sizeof
(
WCHAR
));
return
S_OK
;
}
memcpy
(
*
ppwzSecUrl
,
url
,
len
*
sizeof
(
WCHAR
));
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,33 +1287,31 @@ 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
);
if
(
hres
==
S_FALSE
)
{
hres
=
CoInternetParseUrl
(
pwzUrl
,
PARSE_SCHEMA
,
0
,
domain
,
INTERNET_MAX_URL_LENGTH
,
&
len
,
0
);
hres
=
CoInternetParseUrl
(
url
,
PARSE_ROOTDOCUMENT
,
0
,
domain
,
0
,
&
len
,
0
);
if
(
hres
==
S_FALSE
)
{
hres
=
CoInternetParseUrl
(
url
,
PARSE_SCHEMA
,
0
,
domain
,
INTERNET_MAX_URL_LENGTH
,
&
len
,
0
);
if
(
hres
==
S_OK
)
{
domain
[
len
]
=
':'
;
hres
=
CoInternetParseUrl
(
url
,
PARSE_DOMAIN
,
0
,
domain
+
len
+
1
,
INTERNET_MAX_URL_LENGTH
-
len
-
1
,
&
len
,
0
);
if
(
hres
==
S_OK
)
{
domain
[
len
]
=
':'
;
hres
=
CoInternetParseUrl
(
pwzUrl
,
PARSE_DOMAIN
,
0
,
domain
+
len
+
1
,
INTERNET_MAX_URL_LENGTH
-
len
-
1
,
&
len
,
0
);
if
(
hres
==
S_OK
)
{
len
=
lstrlenW
(
domain
)
+
1
;
*
ppwzSecUrl
=
CoTaskMemAlloc
(
len
*
sizeof
(
WCHAR
));
if
(
!*
ppwzSecUrl
)
return
E_OUTOFMEMORY
;
memcpy
(
*
ppwzSecUrl
,
domain
,
len
*
sizeof
(
WCHAR
));
return
S_OK
;
}
len
=
lstrlenW
(
domain
)
+
1
;
*
ppwzSecUrl
=
CoTaskMemAlloc
(
len
*
sizeof
(
WCHAR
));
if
(
!*
ppwzSecUrl
)
return
E_OUTOFMEMORY
;
memcpy
(
*
ppwzSecUrl
,
domain
,
len
*
sizeof
(
WCHAR
));
return
S_OK
;
}
}
}
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