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
846cc2b1
Commit
846cc2b1
authored
Oct 29, 2009
by
Hans Leidekker
Committed by
Alexandre Julliard
Oct 29, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Implement WinHttpQueryHeaders(WINHTTP_QUERY_VERSION).
parent
39b1dbed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
1 deletion
+33
-1
request.c
dlls/winhttp/request.c
+18
-0
winhttp.c
dlls/winhttp/tests/winhttp.c
+15
-1
No files found.
dlls/winhttp/request.c
View file @
846cc2b1
...
@@ -652,6 +652,24 @@ static BOOL query_headers( request_t *request, DWORD level, LPCWSTR name, LPVOID
...
@@ -652,6 +652,24 @@ static BOOL query_headers( request_t *request, DWORD level, LPCWSTR name, LPVOID
if
(
request_only
)
heap_free
(
headers
);
if
(
request_only
)
heap_free
(
headers
);
return
ret
;
return
ret
;
}
}
case
WINHTTP_QUERY_VERSION
:
{
DWORD
len
=
(
strlenW
(
request
->
version
)
+
1
)
*
sizeof
(
WCHAR
);
if
(
len
>
*
buflen
)
{
set_last_error
(
ERROR_INSUFFICIENT_BUFFER
);
*
buflen
=
len
;
return
FALSE
;
}
else
if
(
buffer
)
{
strcpyW
(
buffer
,
request
->
version
);
TRACE
(
"returning string: %s
\n
"
,
debugstr_w
(
buffer
));
ret
=
TRUE
;
}
*
buflen
=
len
-
sizeof
(
WCHAR
);
return
ret
;
}
default:
default:
{
{
if
(
attr
>=
sizeof
(
attribute_table
)
/
sizeof
(
attribute_table
[
0
])
||
!
attribute_table
[
attr
])
if
(
attr
>=
sizeof
(
attribute_table
)
/
sizeof
(
attribute_table
[
0
])
||
!
attribute_table
[
attr
])
...
...
dlls/winhttp/tests/winhttp.c
View file @
846cc2b1
...
@@ -816,7 +816,8 @@ static void test_request_parameter_defaults(void)
...
@@ -816,7 +816,8 @@ static void test_request_parameter_defaults(void)
static
const
WCHAR
codeweavers
[]
=
{
'c'
,
'o'
,
'd'
,
'e'
,
'w'
,
'e'
,
'a'
,
'v'
,
'e'
,
'r'
,
's'
,
'.'
,
'c'
,
'o'
,
'm'
,
0
};
static
const
WCHAR
codeweavers
[]
=
{
'c'
,
'o'
,
'd'
,
'e'
,
'w'
,
'e'
,
'a'
,
'v'
,
'e'
,
'r'
,
's'
,
'.'
,
'c'
,
'o'
,
'm'
,
0
};
HANDLE
ses
,
con
,
req
;
HANDLE
ses
,
con
,
req
;
DWORD
size
,
status
;
DWORD
size
,
status
,
error
;
WCHAR
*
version
;
BOOL
ret
;
BOOL
ret
;
ses
=
WinHttpOpen
(
test_useragent
,
0
,
NULL
,
NULL
,
0
);
ses
=
WinHttpOpen
(
test_useragent
,
0
,
NULL
,
NULL
,
0
);
...
@@ -850,6 +851,19 @@ static void test_request_parameter_defaults(void)
...
@@ -850,6 +851,19 @@ static void test_request_parameter_defaults(void)
ret
=
WinHttpReceiveResponse
(
req
,
NULL
);
ret
=
WinHttpReceiveResponse
(
req
,
NULL
);
ok
(
ret
,
"failed to receive response %u
\n
"
,
GetLastError
());
ok
(
ret
,
"failed to receive response %u
\n
"
,
GetLastError
());
size
=
0
;
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpQueryHeaders
(
req
,
WINHTTP_QUERY_VERSION
,
NULL
,
NULL
,
&
size
,
NULL
);
error
=
GetLastError
();
ok
(
!
ret
,
"succeeded unexpectedly
\n
"
);
ok
(
error
==
ERROR_INSUFFICIENT_BUFFER
,
"expected ERROR_INSUFFICIENT_BUFFER, got %u
\n
"
,
error
);
version
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
ret
=
WinHttpQueryHeaders
(
req
,
WINHTTP_QUERY_VERSION
,
NULL
,
version
,
&
size
,
NULL
);
ok
(
ret
,
"failed unexpectedly %u
\n
"
,
GetLastError
());
ok
(
lstrlenW
(
version
)
==
size
/
sizeof
(
WCHAR
),
"unexpected size %u
\n
"
,
size
);
HeapFree
(
GetProcessHeap
(),
0
,
version
);
size
=
sizeof
(
status
);
size
=
sizeof
(
status
);
ret
=
WinHttpQueryHeaders
(
req
,
WINHTTP_QUERY_STATUS_CODE
|
WINHTTP_QUERY_FLAG_NUMBER
,
NULL
,
&
status
,
&
size
,
NULL
);
ret
=
WinHttpQueryHeaders
(
req
,
WINHTTP_QUERY_STATUS_CODE
|
WINHTTP_QUERY_FLAG_NUMBER
,
NULL
,
&
status
,
&
size
,
NULL
);
ok
(
ret
,
"failed unexpectedly %u
\n
"
,
GetLastError
());
ok
(
ret
,
"failed unexpectedly %u
\n
"
,
GetLastError
());
...
...
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