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
ebcb86d1
Commit
ebcb86d1
authored
Sep 09, 2005
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 09, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added PARSE_PATH_FROM_URL action implementation.
parent
fa34635c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
4 deletions
+45
-4
internet.c
dlls/urlmon/internet.c
+27
-0
misc.c
dlls/urlmon/tests/misc.c
+18
-4
No files found.
dlls/urlmon/internet.c
View file @
ebcb86d1
...
...
@@ -134,6 +134,31 @@ static HRESULT parse_encode(LPCWSTR url, DWORD flags, LPWSTR result, DWORD size,
return
hres
;
}
static
HRESULT
parse_path_from_url
(
LPCWSTR
url
,
DWORD
flags
,
LPWSTR
result
,
DWORD
size
,
DWORD
*
rsize
)
{
IInternetProtocolInfo
*
protocol_info
;
DWORD
prsize
;
HRESULT
hres
;
TRACE
(
"(%s %08lx %p %ld %p)
\n
"
,
debugstr_w
(
url
),
flags
,
result
,
size
,
rsize
);
protocol_info
=
get_protocol_info
(
url
);
if
(
protocol_info
)
{
hres
=
IInternetProtocolInfo_ParseUrl
(
protocol_info
,
url
,
PARSE_PATH_FROM_URL
,
flags
,
result
,
size
,
rsize
,
0
);
if
(
SUCCEEDED
(
hres
))
return
hres
;
}
prsize
=
size
;
hres
=
PathCreateFromUrlW
(
url
,
result
,
&
prsize
,
0
);
if
(
rsize
)
*
rsize
=
prsize
;
return
hres
;
}
HRESULT
WINAPI
CoInternetParseUrl
(
LPCWSTR
pwzUrl
,
PARSEACTION
ParseAction
,
DWORD
dwFlags
,
LPWSTR
pszResult
,
DWORD
cchResult
,
DWORD
*
pcchResult
,
DWORD
dwReserved
)
{
...
...
@@ -143,6 +168,8 @@ HRESULT WINAPI CoInternetParseUrl(LPCWSTR pwzUrl, PARSEACTION ParseAction, DWORD
switch
(
ParseAction
)
{
case
PARSE_ENCODE
:
return
parse_encode
(
pwzUrl
,
dwFlags
,
pszResult
,
cchResult
,
pcchResult
);
case
PARSE_PATH_FROM_URL
:
return
parse_path_from_url
(
pwzUrl
,
dwFlags
,
pszResult
,
cchResult
,
pcchResult
);
case
PARSE_SCHEMA
:
return
parse_schema
(
pwzUrl
,
dwFlags
,
pszResult
,
cchResult
,
pcchResult
);
default:
...
...
dlls/urlmon/tests/misc.c
View file @
ebcb86d1
...
...
@@ -212,6 +212,9 @@ static const WCHAR url4[] = {'f','i','l','e',':','s','o','m','e','%','2','0','f'
static
const
WCHAR
url4e
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
':'
,
's'
,
'o'
,
'm'
,
'e'
,
' '
,
'f'
,
'i'
,
'l'
,
'e'
,
'.'
,
'j'
,
'p'
,
'g'
,
0
};
static
const
WCHAR
path3
[]
=
{
'c'
,
':'
,
'\\'
,
'I'
,
'n'
,
'd'
,
'e'
,
'x'
,
'.'
,
'h'
,
't'
,
'm'
,
0
};
static
const
WCHAR
path4
[]
=
{
's'
,
'o'
,
'm'
,
'e'
,
' '
,
'f'
,
'i'
,
'l'
,
'e'
,
'.'
,
'j'
,
'p'
,
'g'
,
0
};
static
const
WCHAR
wszRes
[]
=
{
'r'
,
'e'
,
's'
,
0
};
static
const
WCHAR
wszFile
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
0
};
static
const
WCHAR
wszEmpty
[]
=
{
0
};
...
...
@@ -219,14 +222,16 @@ static const WCHAR wszEmpty[] = {0};
struct
parse_test
{
LPCWSTR
url
;
LPCWSTR
encoded_url
;
HRESULT
path_hres
;
LPCWSTR
path
;
LPCWSTR
schema
;
};
static
const
struct
parse_test
parse_tests
[]
=
{
{
url1
,
url1
,
wszRes
},
{
url2
,
url2
,
wszEmpty
},
{
url3
,
url3
,
wszFile
},
{
url4
,
url4e
,
wszFile
}
{
url1
,
url1
,
E_INVALIDARG
,
NULL
,
wszRes
},
{
url2
,
url2
,
E_INVALIDARG
,
NULL
,
wszEmpty
},
{
url3
,
url3
,
S_OK
,
path3
,
wszFile
},
{
url4
,
url4e
,
S_OK
,
path4
,
wszFile
}
};
static
void
test_CoInternetParseUrl
(
void
)
...
...
@@ -251,6 +256,15 @@ static void test_CoInternetParseUrl(void)
ok
(
!
lstrcmpW
(
parse_tests
[
i
].
encoded_url
,
buf
),
"[%d] wrong encoded url
\n
"
,
i
);
memset
(
buf
,
0xf0
,
sizeof
(
buf
));
hres
=
CoInternetParseUrl
(
parse_tests
[
i
].
url
,
PARSE_PATH_FROM_URL
,
0
,
buf
,
sizeof
(
buf
)
/
sizeof
(
WCHAR
),
&
size
,
0
);
ok
(
hres
==
parse_tests
[
i
].
path_hres
,
"[%d] path failed: %08lx
\n
"
,
i
,
hres
);
if
(
parse_tests
[
i
].
path
)
{
ok
(
size
==
lstrlenW
(
parse_tests
[
i
].
path
),
"[%d] wrong size
\n
"
,
i
);
ok
(
!
lstrcmpW
(
parse_tests
[
i
].
path
,
buf
),
"[%d] wrong path
\n
"
,
i
);
}
memset
(
buf
,
0xf0
,
sizeof
(
buf
));
hres
=
CoInternetParseUrl
(
parse_tests
[
i
].
url
,
PARSE_SCHEMA
,
0
,
buf
,
sizeof
(
buf
)
/
sizeof
(
WCHAR
),
&
size
,
0
);
ok
(
hres
==
S_OK
,
"[%d] schema failed: %08lx
\n
"
,
i
,
hres
);
...
...
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