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
6f9e3308
Commit
6f9e3308
authored
Apr 06, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 06, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Build more appropriate user agent string.
The registry value we used previously seems to be ignored by recent IEs.
parent
edcf723b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
19 deletions
+26
-19
session.c
dlls/urlmon/session.c
+26
-19
No files found.
dlls/urlmon/session.c
View file @
6f9e3308
...
...
@@ -532,31 +532,38 @@ static LPWSTR user_agent;
static
void
ensure_useragent
(
void
)
{
DWORD
size
=
sizeof
(
DWORD
),
res
,
type
;
HKEY
hkey
;
static
const
WCHAR
user_agentW
[]
=
{
'U'
,
's'
,
'e'
,
'r'
,
' '
,
'A'
,
'g'
,
'e'
,
'n'
,
't'
,
0
};
OSVERSIONINFOW
info
=
{
sizeof
(
info
)};
const
WCHAR
*
os_type
,
*
is_nt
;
WCHAR
buf
[
512
];
BOOL
is_wow
;
static
const
WCHAR
formatW
[]
=
{
'M'
,
'o'
,
'z'
,
'i'
,
'l'
,
'l'
,
'a'
,
'/'
,
'4'
,
'.'
,
'0'
,
' '
,
'('
,
'c'
,
'o'
,
'm'
,
'p'
,
'a'
,
't'
,
'i'
,
'b'
,
'l'
,
'e'
,
';'
,
' '
,
'M'
,
'S'
,
'I'
,
'E'
,
' '
,
'8'
,
'.'
,
'0'
,
';'
,
' '
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
' '
,
'%'
,
's'
,
'%'
,
'd'
,
'.'
,
'%'
,
'd'
,
';'
,
' '
,
'%'
,
's'
,
';'
,
' '
,
'T'
,
'r'
,
'i'
,
'd'
,
'e'
,
'n'
,
't'
,
'/'
,
'5'
,
'.'
,
'0'
,
')'
,
0
};
static
const
WCHAR
ntW
[]
=
{
'N'
,
'T'
,
' '
,
0
};
static
const
WCHAR
win32W
[]
=
{
'W'
,
'i'
,
'n'
,
'3'
,
'2'
,
0
};
static
const
WCHAR
win64W
[]
=
{
'W'
,
'i'
,
'n'
,
'6'
,
'4'
,
0
};
static
const
WCHAR
wow64W
[]
=
{
'W'
,
'O'
,
'W'
,
'6'
,
'4'
,
0
};
static
const
WCHAR
emptyW
[]
=
{
0
};
if
(
user_agent
)
return
;
res
=
RegOpenKeyW
(
HKEY_CURRENT_USER
,
internet_settings_keyW
,
&
hkey
);
if
(
res
!=
ERROR_SUCCESS
)
return
;
GetVersionExW
(
&
info
);
is_nt
=
info
.
dwPlatformId
==
VER_PLATFORM_WIN32_NT
?
ntW
:
emptyW
;
res
=
RegQueryValueExW
(
hkey
,
user_agentW
,
NULL
,
&
type
,
NULL
,
&
size
);
if
(
res
==
ERROR_SUCCESS
&&
type
==
REG_SZ
)
{
user_agent
=
heap_alloc
(
size
);
res
=
RegQueryValueExW
(
hkey
,
user_agentW
,
NULL
,
&
type
,
(
LPBYTE
)
user_agent
,
&
size
);
if
(
res
!=
ERROR_SUCCESS
)
{
heap_free
(
user_agent
);
user_agent
=
NULL
;
}
}
else
{
WARN
(
"Could not find User Agent value: %u
\n
"
,
res
);
}
if
(
sizeof
(
void
*
)
==
8
)
os_type
=
win64W
;
else
if
(
IsWow64Process
(
GetCurrentProcess
(),
&
is_wow
)
&&
is_wow
)
os_type
=
wow64W
;
else
os_type
=
win32W
;
RegCloseKey
(
hkey
);
sprintfW
(
buf
,
formatW
,
is_nt
,
info
.
dwMajorVersion
,
info
.
dwMinorVersion
,
os_type
);
user_agent
=
heap_strdupW
(
buf
);
}
LPWSTR
get_useragent
(
void
)
...
...
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