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
91321d97
Commit
91321d97
authored
Feb 08, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Support custom user agent strings in IOmNavigator::get_appVersion.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
71750bd8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
omnavigator.c
dlls/mshtml/omnavigator.c
+6
-5
dom.c
dlls/mshtml/tests/dom.c
+12
-0
No files found.
dlls/mshtml/omnavigator.c
View file @
91321d97
...
...
@@ -1008,6 +1008,7 @@ static HRESULT WINAPI OmNavigator_get_appVersion(IOmNavigator *iface, BSTR *p)
char
user_agent
[
512
];
DWORD
size
;
HRESULT
hres
;
const
unsigned
skip_prefix
=
8
;
/* strlen("Mozilla/") */
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
...
...
@@ -1016,17 +1017,17 @@ static HRESULT WINAPI OmNavigator_get_appVersion(IOmNavigator *iface, BSTR *p)
if
(
FAILED
(
hres
))
return
hres
;
if
(
s
trncmp
(
user_agent
,
"Mozilla/"
,
8
)
)
{
FIXME
(
"Unsupported user agent
\n
"
)
;
return
E_FAIL
;
if
(
s
ize
<=
skip_prefix
)
{
*
p
=
NULL
;
return
S_OK
;
}
size
=
MultiByteToWideChar
(
CP_ACP
,
0
,
user_agent
+
8
,
-
1
,
NULL
,
0
);
size
=
MultiByteToWideChar
(
CP_ACP
,
0
,
user_agent
+
skip_prefix
,
-
1
,
NULL
,
0
);
*
p
=
SysAllocStringLen
(
NULL
,
size
-
1
);
if
(
!*
p
)
return
E_OUTOFMEMORY
;
MultiByteToWideChar
(
CP_ACP
,
0
,
user_agent
+
8
,
-
1
,
*
p
,
size
);
MultiByteToWideChar
(
CP_ACP
,
0
,
user_agent
+
skip_prefix
,
-
1
,
*
p
,
size
);
return
S_OK
;
}
...
...
dlls/mshtml/tests/dom.c
View file @
91321d97
...
...
@@ -6228,6 +6228,7 @@ static void test_navigator(IHTMLDocument2 *doc)
HRESULT
hres
;
static
const
WCHAR
v40
[]
=
{
'4'
,
'.'
,
'0'
};
static
char
ua
[]
=
"1234567890xxxABC"
;
hres
=
IHTMLDocument2_get_parentWindow
(
doc
,
&
window
);
ok
(
hres
==
S_OK
,
"parentWidnow failed: %08x
\n
"
,
hres
);
...
...
@@ -6336,6 +6337,17 @@ static void test_navigator(IHTMLDocument2 *doc)
skip
(
"nonstandard user agent
\n
"
);
}
hres
=
UrlMkSetSessionOption
(
URLMON_OPTION_USERAGENT
,
ua
,
sizeof
(
ua
),
0
);
ok
(
hres
==
S_OK
,
"UrlMkSetSessionOption failed: %08x
\n
"
,
hres
);
hres
=
IOmNavigator_get_appVersion
(
navigator
,
&
bstr
);
ok
(
hres
==
S_OK
,
"get_appVersion failed: %08x
\n
"
,
hres
);
ok
(
!
strcmp_wa
(
bstr
,
ua
+
8
),
"appVersion returned %s, expected
\"
%s
\"\n
"
,
wine_dbgstr_w
(
bstr
),
buf
+
8
);
SysFreeString
(
bstr
);
hres
=
UrlMkSetSessionOption
(
URLMON_OPTION_USERAGENT
,
buf
,
strlen
(
buf
),
0
);
ok
(
hres
==
S_OK
,
"UrlMkSetSessionOption failed: %08x
\n
"
,
hres
);
bstr
=
NULL
;
hres
=
IOmNavigator_get_appMinorVersion
(
navigator
,
&
bstr
);
ok
(
hres
==
S_OK
,
"get_appMonorVersion failed: %08x
\n
"
,
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