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
8efbff57
Commit
8efbff57
authored
Mar 25, 2021
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Directly use otain_user_agent in ObtainUserAgentString.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
16a7293f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
22 deletions
+22
-22
session.c
dlls/urlmon/session.c
+22
-22
No files found.
dlls/urlmon/session.c
View file @
8efbff57
...
@@ -510,10 +510,18 @@ static size_t obtain_user_agent(WCHAR *ret, size_t size)
...
@@ -510,10 +510,18 @@ static size_t obtain_user_agent(WCHAR *ret, size_t size)
OSVERSIONINFOW
info
=
{
sizeof
(
info
)};
OSVERSIONINFOW
info
=
{
sizeof
(
info
)};
const
WCHAR
*
os_type
,
*
is_nt
;
const
WCHAR
*
os_type
,
*
is_nt
;
DWORD
res
,
idx
=
0
;
DWORD
res
,
idx
=
0
;
size_t
len
=
0
;
BOOL
is_wow
;
BOOL
is_wow
;
size_t
len
;
HKEY
key
;
HKEY
key
;
EnterCriticalSection
(
&
session_cs
);
if
(
user_agent
)
{
len
=
wcslen
(
user_agent
)
+
1
;
memcpy
(
ret
,
user_agent
,
min
(
size
,
len
)
*
sizeof
(
WCHAR
));
}
LeaveCriticalSection
(
&
session_cs
);
if
(
len
)
return
len
;
GetVersionExW
(
&
info
);
GetVersionExW
(
&
info
);
is_nt
=
info
.
dwPlatformId
==
VER_PLATFORM_WIN32_NT
?
L"NT "
:
L""
;
is_nt
=
info
.
dwPlatformId
==
VER_PLATFORM_WIN32_NT
?
L"NT "
:
L""
;
...
@@ -685,33 +693,25 @@ HRESULT WINAPI UrlMkSetSessionOption(DWORD dwOption, LPVOID pBuffer, DWORD dwBuf
...
@@ -685,33 +693,25 @@ HRESULT WINAPI UrlMkSetSessionOption(DWORD dwOption, LPVOID pBuffer, DWORD dwBuf
/**************************************************************************
/**************************************************************************
* ObtainUserAgentString (URLMON.@)
* ObtainUserAgentString (URLMON.@)
*/
*/
HRESULT
WINAPI
ObtainUserAgentString
(
DWORD
dwOption
,
LPSTR
pcszUAOut
,
DWORD
*
cbS
ize
)
HRESULT
WINAPI
ObtainUserAgentString
(
DWORD
option
,
char
*
ret
,
DWORD
*
ret_s
ize
)
{
{
DWORD
size
;
DWORD
size
,
len
;
HRESULT
hres
=
E_FAIL
;
WCHAR
buf
[
1024
];
HRESULT
hres
=
S_OK
;
TRACE
(
"(%d %p %p)
\n
"
,
dwOption
,
pcszUAOut
,
cbS
ize
);
TRACE
(
"(%d %p %p)
\n
"
,
option
,
ret
,
ret_s
ize
);
if
(
!
pcszUAOut
||
!
cbS
ize
)
if
(
!
ret
||
!
ret_s
ize
)
return
E_INVALIDARG
;
return
E_INVALIDARG
;
EnterCriticalSection
(
&
session_cs
);
len
=
obtain_user_agent
(
buf
,
ARRAY_SIZE
(
buf
));
size
=
WideCharToMultiByte
(
CP_ACP
,
0
,
buf
,
len
,
NULL
,
0
,
NULL
,
NULL
);
ensure_user_agent
();
if
(
size
<=
*
ret_size
)
if
(
user_agent
)
{
WideCharToMultiByte
(
CP_ACP
,
0
,
buf
,
len
,
ret
,
*
ret_size
+
1
,
NULL
,
NULL
);
size
=
WideCharToMultiByte
(
CP_ACP
,
0
,
user_agent
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
else
hres
=
E_OUTOFMEMORY
;
if
(
size
<=
*
cbSize
)
{
WideCharToMultiByte
(
CP_ACP
,
0
,
user_agent
,
-
1
,
pcszUAOut
,
*
cbSize
,
NULL
,
NULL
);
hres
=
S_OK
;
}
else
{
hres
=
E_OUTOFMEMORY
;
}
*
cbSize
=
size
;
}
LeaveCriticalSection
(
&
session_cs
)
;
*
ret_size
=
size
;
return
hres
;
return
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