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
13a95f16
Commit
13a95f16
authored
Jul 19, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 21, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Move InternetQueryOption(INTERNET_OPTION_USER_AGENT) to vtbl.
parent
a7d06e74
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
40 deletions
+30
-40
http.c
dlls/wininet/http.c
+1
-1
internet.c
dlls/wininet/internet.c
+27
-37
internet.c
dlls/wininet/tests/internet.c
+2
-2
No files found.
dlls/wininet/http.c
View file @
13a95f16
...
...
@@ -3473,7 +3473,7 @@ static DWORD HTTPSESSION_QueryOption(WININETHANDLEHEADER *hdr, DWORD option, voi
}
FIXME
(
"Not implemented option %d
\n
"
,
option
);
return
ERROR_INTERNET_IN
VALID_OPTION
;
return
ERROR_INTERNET_IN
CORRECT_HANDLE_TYPE
;
}
static
const
HANDLEHEADERVtbl
HTTPSESSIONVtbl
=
{
...
...
dlls/wininet/internet.c
View file @
13a95f16
...
...
@@ -495,6 +495,8 @@ static VOID APPINFO_Destroy(WININETHANDLEHEADER *hdr)
static
DWORD
APPINFO_QueryOption
(
WININETHANDLEHEADER
*
hdr
,
DWORD
option
,
void
*
buffer
,
DWORD
*
size
,
BOOL
unicode
)
{
LPWININETAPPINFOW
ai
=
(
LPWININETAPPINFOW
)
hdr
;
switch
(
option
)
{
case
INTERNET_OPTION_HANDLE_TYPE
:
TRACE
(
"INTERNET_OPTION_HANDLE_TYPE
\n
"
);
...
...
@@ -505,6 +507,30 @@ static DWORD APPINFO_QueryOption(WININETHANDLEHEADER *hdr, DWORD option, void *b
*
size
=
sizeof
(
DWORD
);
*
(
DWORD
*
)
buffer
=
INTERNET_HANDLE_TYPE_INTERNET
;
return
ERROR_SUCCESS
;
case
INTERNET_OPTION_USER_AGENT
:
{
DWORD
bufsize
;
TRACE
(
"INTERNET_OPTION_USER_AGENT
\n
"
);
bufsize
=
*
size
;
if
(
unicode
)
{
*
size
=
(
strlenW
(
ai
->
lpszAgent
)
+
1
)
*
sizeof
(
WCHAR
);
if
(
!
buffer
||
bufsize
<
*
size
)
return
ERROR_INSUFFICIENT_BUFFER
;
strcpyW
(
buffer
,
ai
->
lpszAgent
);
}
else
{
*
size
=
WideCharToMultiByte
(
CP_ACP
,
0
,
ai
->
lpszAgent
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
(
!
buffer
||
bufsize
<
*
size
)
return
ERROR_INSUFFICIENT_BUFFER
;
WideCharToMultiByte
(
CP_ACP
,
0
,
ai
->
lpszAgent
,
-
1
,
buffer
,
*
size
,
NULL
,
NULL
);
}
return
ERROR_SUCCESS
;
}
}
FIXME
(
"Not implemented option %d
\n
"
,
option
);
...
...
@@ -1959,43 +1985,6 @@ static BOOL INET_QueryOptionHelper(BOOL bIsUnicode, HINTERNET hInternet, DWORD d
break
;
}
case
INTERNET_OPTION_USER_AGENT
:
{
DWORD
required
;
LPWININETAPPINFOW
ai
=
(
LPWININETAPPINFOW
)
lpwhh
;
TRACE
(
"INTERNET_OPTION_USER_AGENT
\n
"
);
if
(
!
lpwhh
||
lpwhh
->
htype
!=
INTERNET_HANDLE_TYPE_INTERNET
)
{
INTERNET_SetLastError
(
ERROR_INTERNET_INCORRECT_HANDLE_TYPE
);
return
FALSE
;
}
if
(
bIsUnicode
)
{
required
=
(
strlenW
(
ai
->
lpszAgent
)
+
1
)
*
sizeof
(
WCHAR
);
if
(
*
lpdwBufferLength
<
required
)
INTERNET_SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
else
if
(
lpBuffer
)
{
strcpyW
(
lpBuffer
,
ai
->
lpszAgent
);
bSuccess
=
TRUE
;
}
}
else
{
required
=
WideCharToMultiByte
(
CP_ACP
,
0
,
ai
->
lpszAgent
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
(
*
lpdwBufferLength
<
required
)
INTERNET_SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
else
if
(
lpBuffer
)
{
WideCharToMultiByte
(
CP_ACP
,
0
,
ai
->
lpszAgent
,
-
1
,
lpBuffer
,
required
,
NULL
,
NULL
);
bSuccess
=
TRUE
;
}
}
*
lpdwBufferLength
=
required
;
break
;
}
case
INTERNET_OPTION_HTTP_VERSION
:
{
if
(
*
lpdwBufferLength
<
sizeof
(
HTTP_VERSION_INFO
))
...
...
@@ -2230,6 +2219,7 @@ static BOOL INET_QueryOptionHelper(BOOL bIsUnicode, HINTERNET hInternet, DWORD d
SetLastError
(
res
);
}
else
{
FIXME
(
"Stub! %d
\n
"
,
dwOption
);
SetLastError
(
ERROR_INTERNET_INCORRECT_HANDLE_TYPE
);
break
;
}
}
...
...
dlls/wininet/tests/internet.c
View file @
13a95f16
...
...
@@ -161,7 +161,7 @@ static void test_InternetQueryOptionA(void)
err
=
GetLastError
();
ok
(
len
==
strlen
(
useragent
)
+
1
,
"Got wrong user agent length %d instead of %d
\n
"
,
len
,
lstrlenA
(
useragent
));
ok
(
retval
==
0
,
"Got wrong return value %d
\n
"
,
retval
);
todo_wine
ok
(
err
==
ERROR_INSUFFICIENT_BUFFER
,
"Got wrong error code
%d
\n
"
,
err
);
ok
(
err
==
ERROR_INSUFFICIENT_BUFFER
,
"Got wrong error code
%d
\n
"
,
err
);
SetLastError
(
0xdeadbeef
);
len
=
strlen
(
useragent
)
+
1
;
...
...
@@ -221,7 +221,7 @@ static void test_InternetQueryOptionA(void)
err
=
GetLastError
();
todo_wine
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
);
todo_wine
ok
(
err
==
ERROR_INSUFFICIENT_BUFFER
,
"Got wrong error code%d
\n
"
,
err
);
ok
(
err
==
ERROR_INSUFFICIENT_BUFFER
,
"Got wrong error code%d
\n
"
,
err
);
InternetCloseHandle
(
hinet
);
}
...
...
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