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
cef7e04f
Commit
cef7e04f
authored
Jun 27, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 29, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Added ObtainUserAgentString implementation.
parent
3700d279
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
25 deletions
+33
-25
session.c
dlls/urlmon/session.c
+33
-0
urlmon_main.c
dlls/urlmon/urlmon_main.c
+0
-25
No files found.
dlls/urlmon/session.c
View file @
cef7e04f
...
...
@@ -631,6 +631,39 @@ HRESULT WINAPI UrlMkSetSessionOption(DWORD dwOption, LPVOID pBuffer, DWORD dwBuf
return
S_OK
;
}
/**************************************************************************
* ObtainUserAgentString (URLMON.@)
*/
HRESULT
WINAPI
ObtainUserAgentString
(
DWORD
dwOption
,
LPSTR
pcszUAOut
,
DWORD
*
cbSize
)
{
DWORD
size
;
HRESULT
hres
=
E_FAIL
;
TRACE
(
"(%d %p %p)
\n
"
,
dwOption
,
pcszUAOut
,
cbSize
);
if
(
!
pcszUAOut
||
!
cbSize
)
return
E_INVALIDARG
;
EnterCriticalSection
(
&
session_cs
);
ensure_useragent
();
if
(
user_agent
)
{
size
=
WideCharToMultiByte
(
CP_ACP
,
0
,
user_agent
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
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
);
return
hres
;
}
void
free_session
(
void
)
{
heap_free
(
user_agent
);
...
...
dlls/urlmon/urlmon_main.c
View file @
cef7e04f
...
...
@@ -362,31 +362,6 @@ HRESULT WINAPI DllRegisterServerEx(void)
return
E_FAIL
;
}
static
const
CHAR
Agent
[]
=
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
;
/**************************************************************************
* ObtainUserAgentString (URLMON.@)
*/
HRESULT
WINAPI
ObtainUserAgentString
(
DWORD
dwOption
,
LPSTR
pcszUAOut
,
DWORD
*
cbSize
)
{
FIXME
(
"(%d, %p, %p): stub
\n
"
,
dwOption
,
pcszUAOut
,
cbSize
);
if
(
pcszUAOut
==
NULL
||
cbSize
==
NULL
)
return
E_INVALIDARG
;
if
(
*
cbSize
<
sizeof
(
Agent
))
{
*
cbSize
=
sizeof
(
Agent
);
return
E_OUTOFMEMORY
;
}
if
(
sizeof
(
Agent
)
<
*
cbSize
)
*
cbSize
=
sizeof
(
Agent
);
lstrcpynA
(
pcszUAOut
,
Agent
,
*
cbSize
);
return
S_OK
;
}
/**************************************************************************
* IsValidURL (URLMON.@)
*
...
...
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