Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
1fa5ddfa
Commit
1fa5ddfa
authored
Dec 30, 2010
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 31, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Make nsIIOService::NewURI IUri-based.
parent
b7e78af4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
42 deletions
+31
-42
nsio.c
dlls/mshtml/nsio.c
+31
-42
No files found.
dlls/mshtml/nsio.c
View file @
1fa5ddfa
...
...
@@ -2699,13 +2699,13 @@ static nsresult NSAPI nsIOService_NewURI(nsIIOService *iface, const nsACString *
const
char
*
aOriginCharset
,
nsIURI
*
aBaseURI
,
nsIURI
**
_retval
)
{
nsWineURI
*
wine_uri
,
*
base_wine_uri
=
NULL
;
const
char
*
spec
=
NULL
;
WCHAR
new_spec
[
INTERNET_MAX_URL_LENGTH
]
;
HTMLWindow
*
window
=
NULL
;
const
char
*
spec
=
NULL
;
nsIURI
*
uri
=
NULL
;
LPCWSTR
base_wine_url
=
NULL
;
nsACString
spec_str
;
IUri
*
urlmon_uri
;
nsresult
nsres
;
HRESULT
hres
;
TRACE
(
"(%s %s %p %p)
\n
"
,
debugstr_nsacstr
(
aSpec
),
debugstr_a
(
aOriginCharset
),
aBaseURI
,
_retval
);
...
...
@@ -2718,60 +2718,49 @@ static nsresult NSAPI nsIOService_NewURI(nsIIOService *iface, const nsACString *
spec
+=
5
;
if
(
aBaseURI
)
{
PARSEDURLA
parsed_url
=
{
sizeof
(
PARSEDURLA
)};
nsres
=
nsIURI_QueryInterface
(
aBaseURI
,
&
IID_nsWineURI
,
(
void
**
)
&
base_wine_uri
);
if
(
NS_SUCCEEDED
(
nsres
))
{
base_wine_url
=
base_wine_uri
->
wine_url
;
if
(
base_wine_uri
->
window_ref
&&
base_wine_uri
->
window_ref
->
window
)
{
if
(
!
ensure_uri
(
base_wine_uri
))
return
NS_ERROR_UNEXPECTED
;
if
(
base_wine_uri
->
window_ref
)
window
=
base_wine_uri
->
window_ref
->
window
;
IHTMLWindow2_AddRef
(
&
window
->
IHTMLWindow2_iface
);
}
TRACE
(
"base url: %s window: %p
\n
"
,
debugstr_w
(
base_wine_url
),
window
);
}
else
if
(
FAILED
(
ParseURLA
(
spec
,
&
parsed_url
)))
{
TRACE
(
"not wraping
\n
"
);
return
nsIIOService_NewURI
(
nsio
,
aSpec
,
aOriginCharset
,
aBaseURI
,
_retval
);
}
else
{
WARN
(
"Could not get base nsWineURI: %08x
\n
"
,
nsres
);
}
}
nsACString_InitDepend
(
&
spec_str
,
spec
);
nsres
=
nsIIOService_NewURI
(
nsio
,
&
spec_str
,
aOriginCharset
,
aBaseURI
,
&
uri
);
nsACString_Finish
(
&
spec_str
);
if
(
NS_FAILED
(
nsres
))
TRACE
(
"NewURI failed: %08x
\n
"
,
nsres
);
nsres
=
create_uri
(
uri
,
window
,
NULL
,
&
wine_uri
);
*
_retval
=
(
nsIURI
*
)
wine_uri
;
MultiByteToWideChar
(
CP_ACP
,
0
,
spec
,
-
1
,
new_spec
,
sizeof
(
new_spec
)
/
sizeof
(
WCHAR
));
if
(
window
)
IHTMLWindow2_Release
(
&
window
->
IHTMLWindow2_iface
);
if
(
base_wine_url
)
{
WCHAR
url
[
INTERNET_MAX_URL_LENGTH
],
rel_url
[
INTERNET_MAX_URL_LENGTH
];
DWORD
len
;
HRESULT
hres
;
MultiByteToWideChar
(
CP_ACP
,
0
,
spec
,
-
1
,
rel_url
,
sizeof
(
rel_url
)
/
sizeof
(
WCHAR
));
hres
=
CoInternetCombineUrl
(
base_wine_url
,
rel_url
,
URL_ESCAPE_SPACES_ONLY
|
URL_DONT_ESCAPE_EXTRA_INFO
,
url
,
sizeof
(
url
)
/
sizeof
(
WCHAR
),
&
len
,
0
);
if
(
SUCCEEDED
(
hres
))
set_wine_url
(
wine_uri
,
url
);
else
WARN
(
"CoCombineUrl failed: %08x
\n
"
,
hres
);
if
(
base_wine_uri
)
{
hres
=
CoInternetCombineUrlEx
(
base_wine_uri
->
uri
,
new_spec
,
URL_ESCAPE_SPACES_ONLY
|
URL_DONT_ESCAPE_EXTRA_INFO
,
&
urlmon_uri
,
0
);
if
(
FAILED
(
hres
))
WARN
(
"CoInternetCombineUrlEx failed: %08x
\n
"
,
hres
);
}
else
{
WCHAR
url
[
INTERNET_MAX_URL_LENGTH
];
hres
=
CreateUri
(
new_spec
,
0
,
0
,
&
urlmon_uri
);
if
(
FAILED
(
hres
))
WARN
(
"CreateUri failed: %08x
\n
"
,
hres
);
}
MultiByteToWideChar
(
CP_ACP
,
0
,
spec
,
-
1
,
url
,
sizeof
(
url
)
/
sizeof
(
WCHAR
));
set_wine_url
(
wine_uri
,
url
);
nsres
=
nsIIOService_NewURI
(
nsio
,
aSpec
,
aOriginCharset
,
aBaseURI
,
&
uri
);
if
(
NS_FAILED
(
nsres
))
TRACE
(
"NewURI failed: %08x
\n
"
,
nsres
);
if
(
FAILED
(
hres
))
{
*
_retval
=
uri
;
return
nsres
;
}
nsres
=
create_uri
(
uri
,
window
,
NULL
,
&
wine_uri
);
if
(
base_wine_uri
)
nsIURI_Release
(
NSURI
(
base_wine_uri
));
if
(
NS_FAILED
(
nsres
))
return
nsres
;
wine_uri
->
uri
=
urlmon_uri
;
sync_wine_url
(
wine_uri
);
*
_retval
=
(
nsIURI
*
)
wine_uri
;
return
nsres
;
}
...
...
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