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
3adfe170
Commit
3adfe170
authored
Dec 15, 2009
by
Piotr Caban
Committed by
Alexandre Julliard
Dec 16, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Added PARSE_DOMAIN to CoInternetParseUrl.
parent
8de69a17
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
6 deletions
+49
-6
internet.c
dlls/urlmon/internet.c
+32
-0
misc.c
dlls/urlmon/tests/misc.c
+17
-6
No files found.
dlls/urlmon/internet.c
View file @
3adfe170
...
...
@@ -170,6 +170,36 @@ static HRESULT parse_security_domain(LPCWSTR url, DWORD flags, LPWSTR result,
return
E_FAIL
;
}
static
HRESULT
parse_domain
(
LPCWSTR
url
,
DWORD
flags
,
LPWSTR
result
,
DWORD
size
,
DWORD
*
rsize
)
{
IInternetProtocolInfo
*
protocol_info
;
HRESULT
hres
;
TRACE
(
"(%s %08x %p %d %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_DOMAIN
,
flags
,
result
,
size
,
rsize
,
0
);
IInternetProtocolInfo_Release
(
protocol_info
);
if
(
SUCCEEDED
(
hres
))
return
hres
;
}
hres
=
UrlGetPartW
(
url
,
result
,
&
size
,
URL_PART_HOSTNAME
,
flags
);
if
(
rsize
)
*
rsize
=
size
;
if
(
hres
==
E_POINTER
)
return
S_FALSE
;
if
(
FAILED
(
hres
))
return
E_FAIL
;
return
S_OK
;
}
/**************************************************************************
* CoInternetParseUrl (URLMON.@)
*/
...
...
@@ -192,6 +222,8 @@ HRESULT WINAPI CoInternetParseUrl(LPCWSTR pwzUrl, PARSEACTION ParseAction, DWORD
return
parse_schema
(
pwzUrl
,
dwFlags
,
pszResult
,
cchResult
,
pcchResult
);
case
PARSE_SECURITY_DOMAIN
:
return
parse_security_domain
(
pwzUrl
,
dwFlags
,
pszResult
,
cchResult
,
pcchResult
);
case
PARSE_DOMAIN
:
return
parse_domain
(
pwzUrl
,
dwFlags
,
pszResult
,
cchResult
,
pcchResult
);
default:
FIXME
(
"not supported action %d
\n
"
,
ParseAction
);
}
...
...
dlls/urlmon/tests/misc.c
View file @
3adfe170
...
...
@@ -270,6 +270,8 @@ static const WCHAR wszHttp[] = {'h','t','t','p',0};
static
const
WCHAR
wszAbout
[]
=
{
'a'
,
'b'
,
'o'
,
'u'
,
't'
,
0
};
static
const
WCHAR
wszEmpty
[]
=
{
0
};
static
const
WCHAR
wszWineHQ
[]
=
{
'w'
,
'w'
,
'w'
,
'.'
,
'w'
,
'i'
,
'n'
,
'e'
,
'h'
,
'q'
,
'.'
,
'o'
,
'r'
,
'g'
,
0
};
struct
parse_test
{
LPCWSTR
url
;
HRESULT
secur_hres
;
...
...
@@ -277,15 +279,17 @@ struct parse_test {
HRESULT
path_hres
;
LPCWSTR
path
;
LPCWSTR
schema
;
LPCWSTR
domain
;
HRESULT
domain_hres
;
};
static
const
struct
parse_test
parse_tests
[]
=
{
{
url1
,
S_OK
,
url1
,
E_INVALIDARG
,
NULL
,
wszRes
},
{
url2
,
E_FAIL
,
url2
,
E_INVALIDARG
,
NULL
,
wszEmpty
},
{
url3
,
E_FAIL
,
url3
,
S_OK
,
path3
,
wszFile
},
{
url4
,
E_FAIL
,
url4e
,
S_OK
,
path4
,
wszFile
},
{
url5
,
E_FAIL
,
url5
,
E_INVALIDARG
,
NULL
,
wszHttp
},
{
url6
,
S_OK
,
url6
,
E_INVALIDARG
,
NULL
,
wszAbout
}
{
url1
,
S_OK
,
url1
,
E_INVALIDARG
,
NULL
,
wszRes
,
NULL
,
E_FAIL
},
{
url2
,
E_FAIL
,
url2
,
E_INVALIDARG
,
NULL
,
wszEmpty
,
NULL
,
E_FAIL
},
{
url3
,
E_FAIL
,
url3
,
S_OK
,
path3
,
wszFile
,
wszEmpty
,
S_OK
},
{
url4
,
E_FAIL
,
url4e
,
S_OK
,
path4
,
wszFile
,
wszEmpty
,
S_OK
},
{
url5
,
E_FAIL
,
url5
,
E_INVALIDARG
,
NULL
,
wszHttp
,
wszWineHQ
,
S_OK
},
{
url6
,
S_OK
,
url6
,
E_INVALIDARG
,
NULL
,
wszAbout
,
NULL
,
E_FAIL
}
};
static
void
test_CoInternetParseUrl
(
void
)
...
...
@@ -331,6 +335,13 @@ static void test_CoInternetParseUrl(void)
ok
(
hres
==
S_OK
,
"[%d] schema failed: %08x
\n
"
,
i
,
hres
);
ok
(
size
==
lstrlenW
(
parse_tests
[
i
].
schema
),
"[%d] wrong size
\n
"
,
i
);
ok
(
!
lstrcmpW
(
parse_tests
[
i
].
schema
,
buf
),
"[%d] wrong schema
\n
"
,
i
);
memset
(
buf
,
0xf0
,
sizeof
(
buf
));
hres
=
CoInternetParseUrl
(
parse_tests
[
i
].
url
,
PARSE_DOMAIN
,
0
,
buf
,
sizeof
(
buf
)
/
sizeof
(
WCHAR
),
&
size
,
0
);
ok
(
hres
==
parse_tests
[
i
].
domain_hres
,
"[%d] domain failed: %08x
\n
"
,
i
,
hres
);
if
(
parse_tests
[
i
].
domain
)
ok
(
!
lstrcmpW
(
parse_tests
[
i
].
domain
,
buf
),
"[%d] wrong domain, received %s
\n
"
,
i
,
wine_dbgstr_w
(
buf
));
}
}
...
...
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