Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
05a7e3d3
Commit
05a7e3d3
authored
Oct 02, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Oct 05, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Correct user agent handling.
parent
b63c1cb2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
internet.c
dlls/wininet/internet.c
+20
-1
internet.c
dlls/wininet/tests/internet.c
+2
-2
No files found.
dlls/wininet/internet.c
View file @
05a7e3d3
...
...
@@ -526,17 +526,36 @@ static DWORD APPINFO_QueryOption(object_header_t *hdr, DWORD option, void *buffe
bufsize
=
*
size
;
if
(
unicode
)
{
*
size
=
(
strlenW
(
ai
->
lpszAgent
)
+
1
)
*
sizeof
(
WCHAR
);
DWORD
len
=
ai
->
lpszAgent
?
strlenW
(
ai
->
lpszAgent
)
:
0
;
*
size
=
(
len
+
1
)
*
sizeof
(
WCHAR
);
if
(
!
buffer
||
bufsize
<
*
size
)
return
ERROR_INSUFFICIENT_BUFFER
;
if
(
ai
->
lpszAgent
)
strcpyW
(
buffer
,
ai
->
lpszAgent
);
else
*
(
WCHAR
*
)
buffer
=
0
;
/* If the buffer is copied, the returned length doesn't include
* the NULL terminator.
*/
*
size
=
len
*
sizeof
(
WCHAR
);
}
else
{
if
(
ai
->
lpszAgent
)
*
size
=
WideCharToMultiByte
(
CP_ACP
,
0
,
ai
->
lpszAgent
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
else
*
size
=
1
;
if
(
!
buffer
||
bufsize
<
*
size
)
return
ERROR_INSUFFICIENT_BUFFER
;
if
(
ai
->
lpszAgent
)
WideCharToMultiByte
(
CP_ACP
,
0
,
ai
->
lpszAgent
,
-
1
,
buffer
,
*
size
,
NULL
,
NULL
);
else
*
(
char
*
)
buffer
=
0
;
/* If the buffer is copied, the returned length doesn't include
* the NULL terminator.
*/
*
size
-=
1
;
}
return
ERROR_SUCCESS
;
...
...
dlls/wininet/tests/internet.c
View file @
05a7e3d3
...
...
@@ -184,7 +184,7 @@ static void test_InternetQueryOptionA(void)
if
(
retval
)
{
ok
(
!
strcmp
(
useragent
,
buffer
),
"Got wrong user agent string %s instead of %s
\n
"
,
buffer
,
useragent
);
todo_wine
ok
(
len
==
strlen
(
useragent
),
"Got wrong user agent length %d instead of %d
\n
"
,
len
,
lstrlenA
(
useragent
));
ok
(
len
==
strlen
(
useragent
),
"Got wrong user agent length %d instead of %d
\n
"
,
len
,
lstrlenA
(
useragent
));
}
ok
(
err
==
0xdeadbeef
,
"Got wrong error code %d
\n
"
,
err
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
...
...
@@ -231,7 +231,7 @@ static void test_InternetQueryOptionA(void)
len
=
0
;
retval
=
InternetQueryOptionA
(
hinet
,
INTERNET_OPTION_USER_AGENT
,
NULL
,
&
len
);
err
=
GetLastError
();
todo_wine
ok
(
len
==
1
,
"Got wrong user agent length %d instead of %d
\n
"
,
len
,
1
);
ok
(
len
==
1
,
"Got wrong user agent length %d instead of %d
\n
"
,
len
,
1
);
ok
(
retval
==
0
,
"Got wrong return value %d
\n
"
,
retval
);
ok
(
err
==
ERROR_INSUFFICIENT_BUFFER
,
"Got wrong error code%d
\n
"
,
err
);
...
...
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