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
40119690
Commit
40119690
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 UrlCanonicalizeA working with long urls (>INTERNET_MAX_URL_LENGTH).
parent
fc543890
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
24 deletions
+18
-24
url.c
dlls/shlwapi/url.c
+18
-24
No files found.
dlls/shlwapi/url.c
View file @
40119690
...
@@ -232,40 +232,34 @@ HRESULT WINAPI ParseURLW(LPCWSTR x, PARSEDURLW *y)
...
@@ -232,40 +232,34 @@ HRESULT WINAPI ParseURLW(LPCWSTR x, PARSEDURLW *y)
HRESULT
WINAPI
UrlCanonicalizeA
(
LPCSTR
pszUrl
,
LPSTR
pszCanonicalized
,
HRESULT
WINAPI
UrlCanonicalizeA
(
LPCSTR
pszUrl
,
LPSTR
pszCanonicalized
,
LPDWORD
pcchCanonicalized
,
DWORD
dwFlags
)
LPDWORD
pcchCanonicalized
,
DWORD
dwFlags
)
{
{
LPWSTR
base
,
canonical
;
LPWSTR
url
,
canonical
;
HRESULT
ret
;
HRESULT
ret
;
DWORD
len
,
len2
;
DWORD
len
;
TRACE
(
"(%s, %p, %p, 0x%08x) *pcchCanonicalized: %d
\n
"
,
debugstr_a
(
pszUrl
),
pszCanonicalized
,
TRACE
(
"(%s, %p, %p, 0x%08x) *pcchCanonicalized: %d
\n
"
,
debugstr_a
(
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
;
base
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
=
strlen
(
pszUrl
)
+
1
;
(
2
*
INTERNET_MAX_URL_LENGTH
)
*
sizeof
(
WCHAR
));
url
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
canonical
=
base
+
INTERNET_MAX_URL_LENGTH
;
canonical
=
HeapAlloc
(
GetProcessHeap
(),
0
,
*
pcchCanonicalized
*
sizeof
(
WCHAR
));
if
(
!
url
||
!
canonical
)
{
HeapFree
(
GetProcessHeap
(),
0
,
url
);
HeapFree
(
GetProcessHeap
(),
0
,
canonical
);
return
E_OUTOFMEMORY
;
}
MultiByteToWideChar
(
0
,
0
,
pszUrl
,
-
1
,
base
,
INTERNET_MAX_URL_LENGTH
);
MultiByteToWideChar
(
0
,
0
,
pszUrl
,
-
1
,
url
,
len
);
len
=
INTERNET_MAX_URL_LENGTH
;
ret
=
UrlCanonicalizeW
(
base
,
canonical
,
&
len
,
dwFlags
);
ret
=
UrlCanonicalizeW
(
url
,
canonical
,
pcchCanonicalized
,
dwFlags
);
if
(
ret
!=
S_OK
)
{
if
(
ret
==
S_OK
)
*
pcchCanonicalized
=
len
*
2
;
WideCharToMultiByte
(
0
,
0
,
canonical
,
-
1
,
pszCanonicalized
,
HeapFree
(
GetProcessHeap
(),
0
,
base
);
*
pcchCanonicalized
+
1
,
0
,
0
);
return
ret
;
}
len2
=
WideCharToMultiByte
(
0
,
0
,
canonical
,
-
1
,
0
,
0
,
0
,
0
);
HeapFree
(
GetProcessHeap
(),
0
,
canonical
);
if
(
len2
>
*
pcchCanonicalized
)
{
return
ret
;
*
pcchCanonicalized
=
len2
;
HeapFree
(
GetProcessHeap
(),
0
,
base
);
return
E_POINTER
;
}
WideCharToMultiByte
(
0
,
0
,
canonical
,
-
1
,
pszCanonicalized
,
*
pcchCanonicalized
,
0
,
0
);
*
pcchCanonicalized
=
len
;
HeapFree
(
GetProcessHeap
(),
0
,
base
);
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