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
6b897513
Commit
6b897513
authored
Oct 26, 2010
by
David Hedberg
Committed by
Alexandre Julliard
Oct 26, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: Fix UrlGetPart to also return unknown schemes.
parent
be7d83f7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
1 deletion
+54
-1
url.c
dlls/shlwapi/tests/url.c
+49
-0
url.c
dlls/shlwapi/url.c
+5
-1
No files found.
dlls/shlwapi/tests/url.c
View file @
6b897513
...
...
@@ -620,6 +620,9 @@ static void test_UrlGetPart(void)
const
char
*
http_url
=
"http://user:pass 123@www.wine hq.org"
;
const
char
*
res_url
=
"res://some.dll/find.dlg"
;
const
char
*
about_url
=
"about:blank"
;
const
char
*
excid_url
=
"x-excid://36C00000/guid:{048B4E89-2E92-496F-A837-33BA02FF6D32}/Message.htm"
;
const
char
*
foo_url
=
"foo://bar-url/test"
;
const
char
*
short_url
=
"ascheme:"
;
CHAR
szPart
[
INTERNET_MAX_URL_LENGTH
];
DWORD
dwSize
;
...
...
@@ -656,6 +659,20 @@ static void test_UrlGetPart(void)
ok
(
szPart
[
0
]
==
0
,
"UrlGetPartA(
\"
hi
\"
) return
\"
%s
\"
instead of
\"\"\n
"
,
szPart
);
ok
(
dwSize
==
0
,
"dwSize = %d
\n
"
,
dwSize
);
if
(
pUrlGetPartW
)
{
const
WCHAR
hiW
[]
=
{
'h'
,
'i'
,
0
};
WCHAR
bufW
[
5
];
/* UrlGetPartW returns S_OK instead of S_FALSE */
dwSize
=
sizeof
szPart
;
bufW
[
0
]
=
'x'
;
bufW
[
1
]
=
0
;
res
=
pUrlGetPartW
(
hiW
,
bufW
,
&
dwSize
,
URL_PART_SCHEME
,
0
);
todo_wine
ok
(
res
==
S_OK
,
"UrlGetPartW(
\"
hi
\"
) returned %08X
\n
"
,
res
);
ok
(
bufW
[
0
]
==
0
,
"UrlGetPartW(
\"
hi
\"
) return
\"
%c
\"\n
"
,
bufW
[
0
]);
ok
(
dwSize
==
0
,
"dwSize = %d
\n
"
,
dwSize
);
}
dwSize
=
sizeof
szPart
;
szPart
[
0
]
=
'x'
;
szPart
[
1
]
=
0
;
res
=
pUrlGetPartA
(
"hi"
,
szPart
,
&
dwSize
,
URL_PART_QUERY
,
0
);
...
...
@@ -677,6 +694,10 @@ static void test_UrlGetPart(void)
test_url_part
(
about_url
,
URL_PART_SCHEME
,
0
,
"about"
);
test_url_part
(
excid_url
,
URL_PART_SCHEME
,
0
,
"x-excid"
);
test_url_part
(
foo_url
,
URL_PART_SCHEME
,
0
,
"foo"
);
test_url_part
(
short_url
,
URL_PART_SCHEME
,
0
,
"ascheme"
);
dwSize
=
sizeof
(
szPart
);
res
=
pUrlGetPartA
(
about_url
,
szPart
,
&
dwSize
,
URL_PART_HOSTNAME
,
0
);
ok
(
res
==
E_FAIL
,
"returned %08x
\n
"
,
res
);
...
...
@@ -707,6 +728,34 @@ static void test_UrlGetPart(void)
szPart
[
0
]
=
'x'
;
szPart
[
1
]
=
'\0'
;
res
=
pUrlGetPartA
(
"index.htm"
,
szPart
,
&
dwSize
,
URL_PART_HOSTNAME
,
0
);
ok
(
res
==
E_FAIL
,
"returned %08x
\n
"
,
res
);
dwSize
=
sizeof
(
szPart
);
szPart
[
0
]
=
'x'
;
szPart
[
1
]
=
'\0'
;
res
=
pUrlGetPartA
(
excid_url
,
szPart
,
&
dwSize
,
URL_PART_HOSTNAME
,
0
);
ok
(
res
==
E_FAIL
,
"returned %08x
\n
"
,
res
);
ok
(
szPart
[
0
]
==
'x'
,
"szPart[0] = %c
\n
"
,
szPart
[
0
]);
ok
(
dwSize
==
sizeof
(
szPart
),
"dwSize = %d
\n
"
,
dwSize
);
dwSize
=
sizeof
(
szPart
);
szPart
[
0
]
=
'x'
;
szPart
[
1
]
=
'\0'
;
res
=
pUrlGetPartA
(
excid_url
,
szPart
,
&
dwSize
,
URL_PART_QUERY
,
0
);
ok
(
res
==
S_FALSE
,
"returned %08x
\n
"
,
res
);
ok
(
szPart
[
0
]
==
0
,
"szPart[0] = %c
\n
"
,
szPart
[
0
]);
ok
(
dwSize
==
0
,
"dwSize = %d
\n
"
,
dwSize
);
dwSize
=
sizeof
(
szPart
);
szPart
[
0
]
=
'x'
;
szPart
[
1
]
=
'\0'
;
res
=
pUrlGetPartA
(
foo_url
,
szPart
,
&
dwSize
,
URL_PART_HOSTNAME
,
0
);
ok
(
res
==
E_FAIL
,
"returned %08x
\n
"
,
res
);
ok
(
szPart
[
0
]
==
'x'
,
"szPart[0] = %c
\n
"
,
szPart
[
0
]);
ok
(
dwSize
==
sizeof
(
szPart
),
"dwSize = %d
\n
"
,
dwSize
);
dwSize
=
sizeof
(
szPart
);
szPart
[
0
]
=
'x'
;
szPart
[
1
]
=
'\0'
;
res
=
pUrlGetPartA
(
foo_url
,
szPart
,
&
dwSize
,
URL_PART_QUERY
,
0
);
ok
(
res
==
S_FALSE
,
"returned %08x
\n
"
,
res
);
ok
(
szPart
[
0
]
==
0
,
"szPart[0] = %c
\n
"
,
szPart
[
0
]);
ok
(
dwSize
==
0
,
"dwSize = %d
\n
"
,
dwSize
);
}
/* ########################### */
...
...
dlls/shlwapi/url.c
View file @
6b897513
...
...
@@ -1967,6 +1967,10 @@ static LPCWSTR URL_ScanID(LPCWSTR start, LPDWORD size, WINE_URL_SCAN_TYPE type)
else
cont
=
FALSE
;
}
if
(
*
start
!=
':'
)
*
size
=
0
;
break
;
case
USERPASS
:
...
...
@@ -2190,7 +2194,7 @@ HRESULT WINAPI UrlGetPartW(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut,
switch
(
dwPart
)
{
case
URL_PART_SCHEME
:
if
(
!
pl
.
szScheme
||
scheme
==
URL_SCHEME_UNKNOWN
)
{
if
(
!
pl
.
szScheme
)
{
*
pcchOut
=
0
;
return
S_FALSE
;
}
...
...
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