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
7cb9fe10
Commit
7cb9fe10
authored
Oct 15, 2009
by
Andrew Eikum
Committed by
Alexandre Julliard
Oct 16, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Implement IHTMLLocation::get_host.
parent
c9adc414
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
8 deletions
+36
-8
htmllocation.c
dlls/mshtml/htmllocation.c
+30
-2
htmllocation.c
dlls/mshtml/tests/htmllocation.c
+6
-6
No files found.
dlls/mshtml/htmllocation.c
View file @
7cb9fe10
...
...
@@ -228,12 +228,40 @@ static HRESULT WINAPI HTMLLocation_put_host(IHTMLLocation *iface, BSTR v)
static
HRESULT
WINAPI
HTMLLocation_get_host
(
IHTMLLocation
*
iface
,
BSTR
*
p
)
{
HTMLLocation
*
This
=
HTMLLOCATION_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
URL_COMPONENTSW
url
=
{
sizeof
(
URL_COMPONENTSW
)};
HRESULT
hres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
!
p
)
return
E_POINTER
;
return
E_NOTIMPL
;
url
.
dwHostNameLength
=
1
;
hres
=
get_url_components
(
This
,
&
url
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
!
url
.
dwHostNameLength
){
*
p
=
NULL
;
return
S_OK
;
}
if
(
url
.
nPort
)
{
/* <hostname>:<port> */
const
WCHAR
format
[]
=
{
'%'
,
'd'
,
0
};
DWORD
len
=
url
.
dwHostNameLength
+
1
+
5
+
1
;
WCHAR
buf
[
len
];
memcpy
(
buf
,
url
.
lpszHostName
,
url
.
dwHostNameLength
*
sizeof
(
WCHAR
));
buf
[
url
.
dwHostNameLength
]
=
':'
;
snprintfW
(
buf
+
url
.
dwHostNameLength
+
1
,
6
,
format
,
url
.
nPort
);
*
p
=
SysAllocString
(
buf
);
}
else
*
p
=
SysAllocStringLen
(
url
.
lpszHostName
,
url
.
dwHostNameLength
);
if
(
!*
p
)
return
E_OUTOFMEMORY
;
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLLocation_put_hostname
(
IHTMLLocation
*
iface
,
BSTR
v
)
...
...
dlls/mshtml/tests/htmllocation.c
View file @
7cb9fe10
...
...
@@ -58,7 +58,7 @@ static const struct location_test http_test = {
http_url
,
"http://www.winehq.org/?search#hash"
,
FALSE
,
"http:"
,
TRUE
,
"www.winehq.org:80"
,
FALS
E
,
"www.winehq.org:80"
,
TRU
E
,
"www.winehq.org"
,
FALSE
,
"80"
,
TRUE
,
""
,
FALSE
,
...
...
@@ -72,7 +72,7 @@ static const struct location_test http_file_test = {
http_file_url
,
"http://www.winehq.org/file?search#hash"
,
TRUE
,
"http:"
,
TRUE
,
"www.winehq.org:80"
,
FALS
E
,
"www.winehq.org:80"
,
TRU
E
,
"www.winehq.org"
,
FALSE
,
"80"
,
TRUE
,
"file"
,
FALSE
,
...
...
@@ -86,7 +86,7 @@ static const struct location_test ftp_test = {
ftp_url
,
"ftp://ftp.winehq.org/"
,
TRUE
,
"ftp:"
,
TRUE
,
"ftp.winehq.org:21"
,
FALS
E
,
"ftp.winehq.org:21"
,
TRU
E
,
"ftp.winehq.org"
,
FALSE
,
"21"
,
TRUE
,
""
,
FALSE
,
...
...
@@ -100,7 +100,7 @@ static const struct location_test ftp_file_test = {
ftp_file_url
,
"ftp://ftp.winehq.org/file"
,
TRUE
,
"ftp:"
,
TRUE
,
"ftp.winehq.org:21"
,
FALS
E
,
"ftp.winehq.org:21"
,
TRU
E
,
"ftp.winehq.org"
,
FALSE
,
"21"
,
TRUE
,
"file"
,
FALSE
,
...
...
@@ -114,7 +114,7 @@ static const struct location_test file_test = {
file_url
,
"file:///C:/windows/win.ini"
,
FALSE
,
"file:"
,
TRUE
,
NULL
,
FALS
E
,
NULL
,
TRU
E
,
NULL
,
FALSE
,
""
,
TRUE
,
"C:
\\
windows
\\
win.ini"
,
TRUE
,
...
...
@@ -195,7 +195,7 @@ static void test_host(IHTMLLocation *loc, const struct location_test *test)
test
->
name
,
E_POINTER
,
hres
);
hres
=
IHTMLLocation_get_host
(
loc
,
&
str
);
todo_wine
ok
(
hres
==
S_OK
,
"%s: get_host failed: 0x%08x
\n
"
,
test
->
name
,
hres
);
ok
(
hres
==
S_OK
,
"%s: get_host failed: 0x%08x
\n
"
,
test
->
name
,
hres
);
if
(
hres
==
S_OK
){
if
(
test
->
host_ok
)
ok
(
str_eq_wa
(
str
,
test
->
host
),
...
...
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