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
2e33485c
Commit
2e33485c
authored
Jul 21, 2011
by
Hans Leidekker
Committed by
Alexandre Julliard
Jul 21, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Implement IWinHttpRequest::Send.
parent
4aeec1b8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
2 deletions
+61
-2
request.c
dlls/winhttp/request.c
+61
-2
No files found.
dlls/winhttp/request.c
View file @
2e33485c
...
...
@@ -2156,6 +2156,10 @@ struct winhttp_request
HINTERNET
hrequest
;
HANDLE
wait
;
HANDLE
cancel
;
LONG
resolve_timeout
;
LONG
connect_timeout
;
LONG
send_timeout
;
LONG
receive_timeout
;
};
static
inline
struct
winhttp_request
*
impl_from_IWinHttpRequest
(
IWinHttpRequest
*
iface
)
...
...
@@ -2454,12 +2458,63 @@ static HRESULT WINAPI winhttp_request_GetAllResponseHeaders(
return
E_NOTIMPL
;
}
static
DWORD
wait_for_completion
(
struct
winhttp_request
*
request
,
DWORD
timeout
)
{
DWORD
err
;
HANDLE
handles
[
2
];
if
(
!
request
->
wait
)
return
ERROR_SUCCESS
;
handles
[
0
]
=
request
->
wait
;
handles
[
1
]
=
request
->
cancel
;
err
=
WaitForMultipleObjects
(
2
,
handles
,
FALSE
,
timeout
);
if
(
err
)
WARN
(
"wait failed with error %u
\n
"
,
err
);
return
err
;
}
static
void
CALLBACK
wait_status_callback
(
HINTERNET
handle
,
DWORD_PTR
context
,
DWORD
status
,
LPVOID
buffer
,
DWORD
size
)
{
struct
winhttp_request
*
request
=
(
struct
winhttp_request
*
)
context
;
SetEvent
(
request
->
wait
);
}
static
void
wait_set_status_callback
(
struct
winhttp_request
*
request
,
DWORD
status
)
{
if
(
!
request
->
wait
)
return
;
WinHttpSetStatusCallback
(
request
->
hrequest
,
wait_status_callback
,
status
,
0
);
}
static
HRESULT
WINAPI
winhttp_request_Send
(
IWinHttpRequest
*
iface
,
VARIANT
body
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
struct
winhttp_request
*
request
=
impl_from_IWinHttpRequest
(
iface
);
DWORD
err
;
TRACE
(
"%p, %s
\n
"
,
request
,
debugstr_variant
(
&
body
));
if
(
request
->
state
<
REQUEST_STATE_OPEN
)
{
return
HRESULT_FROM_WIN32
(
ERROR_WINHTTP_CANNOT_CALL_BEFORE_OPEN
);
}
if
(
request
->
state
>=
REQUEST_STATE_SENT
)
return
ERROR_SUCCESS
;
if
(
!
WinHttpSetTimeouts
(
request
->
hrequest
,
request
->
resolve_timeout
,
request
->
connect_timeout
,
request
->
send_timeout
,
request
->
receive_timeout
))
{
return
HRESULT_FROM_WIN32
(
GetLastError
()
);
}
wait_set_status_callback
(
request
,
WINHTTP_CALLBACK_STATUS_REQUEST_SENT
);
if
(
!
WinHttpSendRequest
(
request
->
hrequest
,
NULL
,
0
,
NULL
,
0
,
0
,
0
))
{
return
HRESULT_FROM_WIN32
(
GetLastError
()
);
}
if
((
err
=
wait_for_completion
(
request
,
INFINITE
)))
return
err
;
request
->
state
=
REQUEST_STATE_SENT
;
return
S_OK
;
}
static
HRESULT
WINAPI
winhttp_request_get_Status
(
...
...
@@ -2602,6 +2657,10 @@ HRESULT WinHttpRequest_create( IUnknown *unknown, void **obj )
if
(
!
(
request
=
heap_alloc_zero
(
sizeof
(
*
request
)
)))
return
E_OUTOFMEMORY
;
request
->
IWinHttpRequest_iface
.
lpVtbl
=
&
winhttp_request_vtbl
;
request
->
refs
=
1
;
request
->
resolve_timeout
=
0
;
request
->
connect_timeout
=
60000
;
request
->
send_timeout
=
30000
;
request
->
receive_timeout
=
30000
;
*
obj
=
&
request
->
IWinHttpRequest_iface
;
TRACE
(
"returning iface %p
\n
"
,
*
obj
);
...
...
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