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
115efbed
Commit
115efbed
authored
Mar 13, 2010
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 15, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Use user agent string in IOmNavigator::get_appVersion.
parent
42a80aea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
7 deletions
+26
-7
omnavigator.c
dlls/mshtml/omnavigator.c
+16
-7
dom.c
dlls/mshtml/tests/dom.c
+10
-0
No files found.
dlls/mshtml/omnavigator.c
View file @
115efbed
...
...
@@ -160,19 +160,28 @@ static HRESULT WINAPI OmNavigator_get_appVersion(IOmNavigator *iface, BSTR *p)
{
OmNavigator
*
This
=
OMNAVIGATOR_THIS
(
iface
);
/* FIXME: Should we return something smarter? */
static
const
WCHAR
app_verW
[]
=
{
'4'
,
'.'
,
'0'
,
' '
,
'('
,
'c'
,
'o'
,
'm'
,
'p'
,
'a'
,
't'
,
'i'
,
'b'
,
'l'
,
'e'
,
';'
,
' '
,
'M'
,
'S'
,
'I'
,
'E'
,
' '
,
'7'
,
'.'
,
'0'
,
';'
,
' '
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
' '
,
'N'
,
'T'
,
' '
,
'5'
,
'.'
,
'1'
,
';'
,
' '
,
'M'
,
'o'
,
'z'
,
'i'
,
'l'
,
'l'
,
'a'
,
'/'
,
'4'
,
'.'
,
'0'
,
')'
,
0
};
char
user_agent
[
512
];
DWORD
size
;
HRESULT
hres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
*
p
=
SysAllocString
(
app_verW
);
size
=
sizeof
(
user_agent
);
hres
=
ObtainUserAgentString
(
0
,
user_agent
,
&
size
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
strncmp
(
user_agent
,
"Mozilla/"
,
8
))
{
FIXME
(
"Unsupported user agent
\n
"
);
return
E_FAIL
;
}
size
=
MultiByteToWideChar
(
CP_ACP
,
0
,
user_agent
+
8
,
-
1
,
NULL
,
0
);
*
p
=
SysAllocStringLen
(
NULL
,
size
-
1
);
if
(
!*
p
)
return
E_OUTOFMEMORY
;
MultiByteToWideChar
(
CP_ACP
,
0
,
user_agent
+
8
,
-
1
,
*
p
,
size
);
return
S_OK
;
}
...
...
dlls/mshtml/tests/dom.c
View file @
115efbed
...
...
@@ -3173,6 +3173,16 @@ static void test_navigator(IHTMLDocument2 *doc)
ok
(
!
strcmp_wa
(
bstr
,
buf
),
"userAgent returned %s, expected
\"
%s
\"\n
"
,
wine_dbgstr_w
(
bstr
),
buf
);
SysFreeString
(
bstr
);
if
(
!
strncmp
(
buf
,
"Mozilla/"
,
8
))
{
bstr
=
NULL
;
hres
=
IOmNavigator_get_appVersion
(
navigator
,
&
bstr
);
ok
(
hres
==
S_OK
,
"get_appVersion failed: %08x
\n
"
,
hres
);
ok
(
!
strcmp_wa
(
bstr
,
buf
+
8
),
"appVersion returned %s, expected
\"
%s
\"\n
"
,
wine_dbgstr_w
(
bstr
),
buf
+
8
);
SysFreeString
(
bstr
);
}
else
{
skip
(
"nonstandard user agent
\n
"
);
}
ref
=
IOmNavigator_Release
(
navigator
);
ok
(
!
ref
,
"navigator should be destroyed here
\n
"
);
}
...
...
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