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
7226c490
Commit
7226c490
authored
Oct 01, 2013
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 01, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Include values from 'Post Platform' registry key in user agent string.
parent
723e5183
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
3 deletions
+55
-3
session.c
dlls/urlmon/session.c
+55
-3
No files found.
dlls/urlmon/session.c
View file @
7226c490
...
...
@@ -534,15 +534,26 @@ static void ensure_useragent(void)
{
OSVERSIONINFOW
info
=
{
sizeof
(
info
)};
const
WCHAR
*
os_type
,
*
is_nt
;
WCHAR
buf
[
512
];
WCHAR
buf
[
512
],
*
ret
,
*
tmp
;
DWORD
res
,
idx
=
0
;
size_t
len
,
size
;
BOOL
is_wow
;
HKEY
key
;
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
};
' '
,
'%'
,
's'
,
';'
,
' '
,
'T'
,
'r'
,
'i'
,
'd'
,
'e'
,
'n'
,
't'
,
'/'
,
'5'
,
'.'
,
'0'
,
0
};
static
const
WCHAR
post_platform_keyW
[]
=
{
'S'
,
'O'
,
'F'
,
'T'
,
'W'
,
'A'
,
'R'
,
'E'
,
'\\'
,
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'\\'
,
'I'
,
'n'
,
't'
,
'e'
,
'r'
,
'n'
,
'e'
,
't'
,
' '
,
'S'
,
'e'
,
't'
,
't'
,
'i'
,
'n'
,
'g'
,
's'
,
'\\'
,
'5'
,
'.'
,
'0'
,
'\\'
,
'U'
,
's'
,
'e'
,
'r'
,
' '
,
'A'
,
'g'
,
'e'
,
'n'
,
't'
,
'\\'
,
'P'
,
'o'
,
's'
,
't'
,
' '
,
'P'
,
'l'
,
'a'
,
't'
,
'f'
,
'o'
,
'r'
,
'm'
,
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
};
...
...
@@ -563,7 +574,48 @@ static void ensure_useragent(void)
os_type
=
win32W
;
sprintfW
(
buf
,
formatW
,
is_nt
,
info
.
dwMajorVersion
,
info
.
dwMinorVersion
,
os_type
);
user_agent
=
heap_strdupW
(
buf
);
len
=
strlenW
(
buf
);
size
=
len
+
40
;
ret
=
heap_alloc
(
size
*
sizeof
(
WCHAR
));
if
(
!
ret
)
return
;
memcpy
(
ret
,
buf
,
len
*
sizeof
(
WCHAR
));
res
=
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
post_platform_keyW
,
&
key
);
if
(
res
==
ERROR_SUCCESS
)
{
DWORD
value_len
;
while
(
1
)
{
value_len
=
sizeof
(
buf
)
/
sizeof
(
WCHAR
);
res
=
RegEnumValueW
(
key
,
idx
,
buf
,
&
value_len
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
res
!=
ERROR_SUCCESS
)
break
;
idx
++
;
if
(
len
+
value_len
+
2
/* strlen("; ") */
+
1
/* trailing ')' */
>=
size
)
{
tmp
=
heap_realloc
(
ret
,
(
size
*
2
+
value_len
)
*
sizeof
(
WCHAR
));
if
(
!
tmp
)
break
;
ret
=
tmp
;
size
=
size
*
2
+
value_len
;
}
ret
[
len
++
]
=
';'
;
ret
[
len
++
]
=
' '
;
memcpy
(
ret
+
len
,
buf
,
value_len
*
sizeof
(
WCHAR
));
len
+=
value_len
;
}
RegCloseKey
(
key
);
}
ret
[
len
++
]
=
')'
;
ret
[
len
++
]
=
0
;
user_agent
=
ret
;
TRACE
(
"Using user agent %s
\n
"
,
debugstr_w
(
user_agent
));
}
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