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
8eb70459
Commit
8eb70459
authored
Jan 09, 2013
by
Andrew Eikum
Committed by
Alexandre Julliard
Jan 10, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ieframe: Strip '
file://
' from file URLs in BEFORENAVIGATE2 callbacks.
parent
136b738b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
1 deletion
+55
-1
navigate.c
dlls/ieframe/navigate.c
+6
-1
webbrowser.c
dlls/ieframe/tests/webbrowser.c
+49
-0
No files found.
dlls/ieframe/navigate.c
View file @
8eb70459
...
...
@@ -566,6 +566,8 @@ static void on_before_navigate2(DocHost *This, LPCWSTR url, SAFEARRAY *post_data
VARIANT
var_url
,
var_flags
,
var_frame_name
,
var_post_data
,
var_post_data2
,
var_headers
;
DISPPARAMS
dispparams
;
VARIANTARG
params
[
7
];
WCHAR
file_path
[
MAX_PATH
];
DWORD
file_path_len
=
sizeof
(
file_path
)
/
sizeof
(
*
file_path
);
dispparams
.
cArgs
=
7
;
dispparams
.
cNamedArgs
=
0
;
...
...
@@ -607,7 +609,10 @@ static void on_before_navigate2(DocHost *This, LPCWSTR url, SAFEARRAY *post_data
V_VT
(
params
+
5
)
=
(
VT_BYREF
|
VT_VARIANT
);
V_VARIANTREF
(
params
+
5
)
=
&
var_url
;
V_VT
(
&
var_url
)
=
VT_BSTR
;
V_BSTR
(
&
var_url
)
=
SysAllocString
(
url
);
if
(
PathCreateFromUrlW
(
url
,
file_path
,
&
file_path_len
,
0
)
==
S_OK
)
V_BSTR
(
&
var_url
)
=
SysAllocString
(
file_path
);
else
V_BSTR
(
&
var_url
)
=
SysAllocString
(
url
);
V_VT
(
params
+
6
)
=
(
VT_DISPATCH
);
V_DISPATCH
(
params
+
6
)
=
(
IDispatch
*
)
This
->
wb
;
...
...
dlls/ieframe/tests/webbrowser.c
View file @
8eb70459
...
...
@@ -2542,6 +2542,7 @@ static void test_ConnectionPoint(IWebBrowser2 *unk, BOOL init)
static
void
test_Navigate2
(
IWebBrowser2
*
webbrowser
,
const
char
*
nav_url
)
{
VARIANT
url
;
BOOL
is_file
;
HRESULT
hres
;
test_LocationURL
(
webbrowser
,
is_first_load
?
""
:
current_url
);
...
...
@@ -2551,6 +2552,9 @@ static void test_Navigate2(IWebBrowser2 *webbrowser, const char *nav_url)
V_VT
(
&
url
)
=
VT_BSTR
;
V_BSTR
(
&
url
)
=
a2bstr
(
current_url
=
nav_url
);
if
((
is_file
=
!
strncasecmp
(
nav_url
,
"file://"
,
7
)))
current_url
=
nav_url
+
7
;
if
(
is_first_load
)
{
SET_EXPECT
(
Invoke_AMBIENT_USERMODE
);
SET_EXPECT
(
Invoke_PROPERTYCHANGE
);
...
...
@@ -2578,6 +2582,7 @@ static void test_Navigate2(IWebBrowser2 *webbrowser, const char *nav_url)
SET_EXPECT
(
Invoke_COMMANDSTATECHANGE
);
SET_EXPECT
(
EnableModeless_TRUE
);
if
(
!
use_container_olecmd
)
SET_EXPECT
(
Invoke_DOWNLOADCOMPLETE
);
if
(
is_file
)
SET_EXPECT
(
Invoke_PROGRESSCHANGE
);
}
hres
=
IWebBrowser2_Navigate2
(
webbrowser
,
&
url
,
NULL
,
NULL
,
NULL
,
NULL
);
...
...
@@ -2609,6 +2614,7 @@ static void test_Navigate2(IWebBrowser2 *webbrowser, const char *nav_url)
todo_wine
CHECK_CALLED
(
Invoke_COMMANDSTATECHANGE
);
if
(
use_container_olecmd
)
todo_wine
CHECK_CALLED
(
Exec_SETDOWNLOADSTATE_0
);
CHECK_CALLED
(
EnableModeless_TRUE
);
if
(
is_file
)
todo_wine
CHECK_CALLED
(
Invoke_PROGRESSCHANGE
);
}
VariantClear
(
&
url
);
...
...
@@ -3511,6 +3517,48 @@ static BOOL is_ie_hardened(void)
return
ie_harden
!=
0
;
}
static
void
test_FileProtocol
(
void
)
{
IWebBrowser2
*
webbrowser
;
HANDLE
file
;
ULONG
ref
;
char
file_path
[
MAX_PATH
];
char
file_url
[
MAX_PATH
]
=
"File://"
;
static
const
char
test_file
[]
=
"wine_test.html"
;
GetTempPathA
(
MAX_PATH
,
file_path
);
strcat
(
file_path
,
test_file
);
GetLongPathNameA
(
file_path
,
file_path
,
sizeof
(
file_path
));
strcat
(
file_url
,
file_path
);
webbrowser
=
create_webbrowser
();
if
(
!
webbrowser
)
return
;
init_test
(
webbrowser
,
0
);
file
=
CreateFileA
(
file_path
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_NEW
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
file
==
INVALID_HANDLE_VALUE
&&
GetLastError
()
!=
ERROR_FILE_EXISTS
){
ok
(
0
,
"CreateFile failed
\n
"
);
return
;
}
CloseHandle
(
file
);
test_ConnectionPoint
(
webbrowser
,
TRUE
);
test_ClientSite
(
webbrowser
,
&
ClientSite
,
TRUE
);
test_DoVerb
(
webbrowser
);
test_Navigate2
(
webbrowser
,
file_url
);
test_ClientSite
(
webbrowser
,
NULL
,
TRUE
);
ref
=
IWebBrowser2_Release
(
webbrowser
);
ok
(
ref
==
0
,
"ref=%u, expected 0
\n
"
,
ref
);
if
(
file
!=
INVALID_HANDLE_VALUE
)
DeleteFileA
(
file_path
);
}
START_TEST
(
webbrowser
)
{
OleInitialize
(
NULL
);
...
...
@@ -3536,6 +3584,7 @@ START_TEST(webbrowser)
test_WebBrowser_slim_container
();
trace
(
"Testing WebBrowserV1...
\n
"
);
test_WebBrowserV1
();
test_FileProtocol
();
OleUninitialize
();
}
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