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
5d1b0d89
Commit
5d1b0d89
authored
Jul 29, 2006
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 31, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: Change file path to URL in UrlCanonicalize.
parent
5674260b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
path.c
dlls/shlwapi/tests/path.c
+6
-1
url.c
dlls/shlwapi/url.c
+15
-1
No files found.
dlls/shlwapi/tests/path.c
View file @
5d1b0d89
...
...
@@ -77,6 +77,11 @@ const TEST_URL_CANONICALIZE TEST_CANONICALIZE[] = {
{
"file:///c:
\\
tests
\\
foo bar"
,
URL_DONT_SIMPLIFY
,
S_OK
,
"file:///c:/tests/foo bar"
},
{
"http://www.winehq.org/site/about"
,
URL_FILE_USE_PATHURL
,
S_OK
,
"http://www.winehq.org/site/about"
},
{
"file_://www.winehq.org/site/about"
,
URL_FILE_USE_PATHURL
,
S_OK
,
"file_://www.winehq.org/site/about"
},
{
"c:
\\
dir
\\
file"
,
0
,
S_OK
,
"file:///c:/dir/file"
},
{
"file:///c:
\\
dir
\\
file"
,
0
,
S_OK
,
"file:///c:/dir/file"
},
{
"c:dir
\\
file"
,
0
,
S_OK
,
"file:///c:dir/file"
},
{
"A"
,
0
,
S_OK
,
"A"
},
{
""
,
0
,
S_OK
,
""
}
};
typedef
struct
_TEST_URL_ESCAPE
{
...
...
@@ -429,7 +434,7 @@ static void test_url_canonicalize(const char *szUrl, DWORD dwFlags, HRESULT dwEx
dwSize
=
INTERNET_MAX_URL_LENGTH
;
ok
(
UrlCanonicalizeA
(
szUrl
,
NULL
,
&
dwSize
,
dwFlags
)
!=
dwExpectReturn
,
"Unexpected return for NULL buffer
\n
"
);
ok
(
UrlCanonicalizeA
(
szUrl
,
szReturnUrl
,
&
dwSize
,
dwFlags
)
==
dwExpectReturn
,
"UrlCanonicalizeA didn't return 0x%08lx
\n
"
,
dwExpectReturn
);
ok
(
strcmp
(
szReturnUrl
,
szExpectUrl
)
==
0
,
"UrlCanonicalizeA dwFlags 0x%08lx Expected
%s, but got %s
\n
"
,
dwFlags
,
szExpectUrl
,
szReturnUrl
);
ok
(
strcmp
(
szReturnUrl
,
szExpectUrl
)
==
0
,
"UrlCanonicalizeA dwFlags 0x%08lx Expected
\"
%s
\"
, but got
\"
%s
\"
\n
"
,
dwFlags
,
szExpectUrl
,
szReturnUrl
);
dwSize
=
INTERNET_MAX_URL_LENGTH
;
ok
(
UrlCanonicalizeW
(
wszUrl
,
NULL
,
&
dwSize
,
dwFlags
)
!=
dwExpectReturn
,
"Unexpected return for NULL buffer
\n
"
);
...
...
dlls/shlwapi/url.c
View file @
5d1b0d89
...
...
@@ -340,8 +340,13 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized,
if
(
!
pszUrl
||
!
pszCanonicalized
||
!
pcchCanonicalized
)
return
E_INVALIDARG
;
if
(
!*
pszUrl
)
{
*
pszCanonicalized
=
0
;
return
S_OK
;
}
nByteLen
=
(
lstrlenW
(
pszUrl
)
+
1
)
*
sizeof
(
WCHAR
);
/* length in bytes */
lpszUrlCpy
=
HeapAlloc
(
GetProcessHeap
(),
0
,
nByteLen
);
lpszUrlCpy
=
HeapAlloc
(
GetProcessHeap
(),
0
,
INTERNET_MAX_URL_LENGTH
);
if
((
dwFlags
&
URL_FILE_USE_PATHURL
)
&&
nByteLen
>=
sizeof
(
wszFile
)
&&
!
memcmp
(
wszFile
,
pszUrl
,
sizeof
(
wszFile
)))
...
...
@@ -361,6 +366,15 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized,
wk1
=
(
LPWSTR
)
pszUrl
;
wk2
=
lpszUrlCpy
;
state
=
0
;
if
(
pszUrl
[
1
]
==
':'
)
{
/* Assume path */
static
const
WCHAR
wszFilePrefix
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
':'
,
'/'
,
'/'
,
'/'
};
memcpy
(
wk2
,
wszFilePrefix
,
sizeof
(
wszFilePrefix
));
wk2
+=
sizeof
(
wszFilePrefix
)
/
sizeof
(
WCHAR
);
state
=
5
;
}
while
(
*
wk1
)
{
switch
(
state
)
{
case
0
:
...
...
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