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
fc543890
Commit
fc543890
authored
May 08, 2010
by
Piotr Caban
Committed by
Alexandre Julliard
May 08, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: Make UrlCanonicalizeW working with long urls (>INTERNET_MAX_URL_LENGTH).
parent
f4f9b1ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
url.c
dlls/shlwapi/url.c
+6
-4
No files found.
dlls/shlwapi/url.c
View file @
fc543890
...
@@ -287,11 +287,12 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized,
...
@@ -287,11 +287,12 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized,
static
const
WCHAR
wszFile
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
':'
};
static
const
WCHAR
wszFile
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
':'
};
static
const
WCHAR
wszRes
[]
=
{
'r'
,
'e'
,
's'
,
':'
};
static
const
WCHAR
wszRes
[]
=
{
'r'
,
'e'
,
's'
,
':'
};
static
const
WCHAR
wszLocalhost
[]
=
{
'l'
,
'o'
,
'c'
,
'a'
,
'l'
,
'h'
,
'o'
,
's'
,
't'
};
static
const
WCHAR
wszLocalhost
[]
=
{
'l'
,
'o'
,
'c'
,
'a'
,
'l'
,
'h'
,
'o'
,
's'
,
't'
};
static
const
WCHAR
wszFilePrefix
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
':'
,
'/'
,
'/'
,
'/'
};
TRACE
(
"(%s, %p, %p, 0x%08x) *pcchCanonicalized: %d
\n
"
,
debugstr_w
(
pszUrl
),
pszCanonicalized
,
TRACE
(
"(%s, %p, %p, 0x%08x) *pcchCanonicalized: %d
\n
"
,
debugstr_w
(
pszUrl
),
pszCanonicalized
,
pcchCanonicalized
,
dwFlags
,
pcchCanonicalized
?
*
pcchCanonicalized
:
-
1
);
pcchCanonicalized
,
dwFlags
,
pcchCanonicalized
?
*
pcchCanonicalized
:
-
1
);
if
(
!
pszUrl
||
!
pszCanonicalized
||
!
pcchCanonicalized
)
if
(
!
pszUrl
||
!
pszCanonicalized
||
!
pcchCanonicalized
||
!*
pcchCanonicalized
)
return
E_INVALIDARG
;
return
E_INVALIDARG
;
if
(
!*
pszUrl
)
{
if
(
!*
pszUrl
)
{
...
@@ -300,8 +301,9 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized,
...
@@ -300,8 +301,9 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized,
}
}
nByteLen
=
(
strlenW
(
pszUrl
)
+
1
)
*
sizeof
(
WCHAR
);
/* length in bytes */
nByteLen
=
(
strlenW
(
pszUrl
)
+
1
)
*
sizeof
(
WCHAR
);
/* length in bytes */
/* Allocate memory for simplified URL (before escaping) */
lpszUrlCpy
=
HeapAlloc
(
GetProcessHeap
(),
0
,
lpszUrlCpy
=
HeapAlloc
(
GetProcessHeap
(),
0
,
INTERNET_MAX_URL_LENGTH
*
sizeof
(
WCHAR
));
nByteLen
+
sizeof
(
wszFilePrefix
)
+
sizeof
(
WCHAR
));
if
((
dwFlags
&
URL_FILE_USE_PATHURL
)
&&
nByteLen
>=
sizeof
(
wszFile
)
if
((
dwFlags
&
URL_FILE_USE_PATHURL
)
&&
nByteLen
>=
sizeof
(
wszFile
)
&&
!
memcmp
(
wszFile
,
pszUrl
,
sizeof
(
wszFile
)))
&&
!
memcmp
(
wszFile
,
pszUrl
,
sizeof
(
wszFile
)))
...
@@ -328,8 +330,6 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized,
...
@@ -328,8 +330,6 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized,
state
=
0
;
state
=
0
;
if
(
pszUrl
[
1
]
==
':'
)
{
/* Assume path */
if
(
pszUrl
[
1
]
==
':'
)
{
/* Assume path */
static
const
WCHAR
wszFilePrefix
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
':'
,
'/'
,
'/'
,
'/'
};
memcpy
(
wk2
,
wszFilePrefix
,
sizeof
(
wszFilePrefix
));
memcpy
(
wk2
,
wszFilePrefix
,
sizeof
(
wszFilePrefix
));
wk2
+=
sizeof
(
wszFilePrefix
)
/
sizeof
(
WCHAR
);
wk2
+=
sizeof
(
wszFilePrefix
)
/
sizeof
(
WCHAR
);
if
(
dwFlags
&
URL_FILE_USE_PATHURL
)
if
(
dwFlags
&
URL_FILE_USE_PATHURL
)
...
@@ -833,6 +833,8 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative,
...
@@ -833,6 +833,8 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative,
if
(
ret
==
S_OK
)
{
if
(
ret
==
S_OK
)
{
/* Reuse mrelative as temp storage as its already allocated and not needed anymore */
/* Reuse mrelative as temp storage as its already allocated and not needed anymore */
if
(
*
pcchCombined
==
0
)
*
pcchCombined
=
1
;
ret
=
UrlCanonicalizeW
(
preliminary
,
mrelative
,
pcchCombined
,
(
dwFlags
&
~
URL_FILE_USE_PATHURL
));
ret
=
UrlCanonicalizeW
(
preliminary
,
mrelative
,
pcchCombined
,
(
dwFlags
&
~
URL_FILE_USE_PATHURL
));
if
(
SUCCEEDED
(
ret
)
&&
pszCombined
)
{
if
(
SUCCEEDED
(
ret
)
&&
pszCombined
)
{
lstrcpyW
(
pszCombined
,
mrelative
);
lstrcpyW
(
pszCombined
,
mrelative
);
...
...
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