Commit Graph

193 Commits

Author SHA1 Message Date
Dmitry Timoshkov a6fe4f6e65 rpcrt4: Reimplement rpcrt4_conn_np_wait_for_incoming_data() using asynchronous read with zero sized buffer.
The problem with NtFsControlFile(FSCTL_PIPE_PEEK) is that it happily returns
STATUS_SUCCESS with 0 bytes of data available. That makes the client think
that the server already sent a reply and try to read the reply data, which
hangs. A solution to this is call NtReadFile() with zero sized buffer, which
has correct behaviour: just waits for incoming data to appear without mangling
the data in the pipe.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-25 20:09:14 +02:00
Dmitry Timoshkov bb7c119190 rpcrt4: Implement wait_for_incoming_data() for named pipes transport.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-17 16:50:44 +02:00
Alexandre Julliard eadb037ba1 rpcrt4: Build with msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-19 11:22:47 +02:00
Michael Stefaniuc 377243b411 rpcrt4: Use the standard ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-19 22:34:36 +02:00
Michael Stefaniuc ac0c0062b4 rpcrt4: Use the ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-19 22:34:32 +02:00
Michael Stefaniuc 5ee8a6530b rpcrt4: Avoid a variable holding an ARRAY_SIZE result.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-19 22:34:27 +02:00
Jacek Caban 3b4f3ff397 rpcrt4: Reset assoc_group_id on associations with no active connection.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-16 22:26:07 +02:00
Jacek Caban ac6325e4bb rpcrt4: Wait for available pipe when connecting to busy server.
It's most likely to happen when server just accepted another connection
and didn't create a new listening pipe instance yet.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-28 00:37:50 +02:00
Jacek Caban 2d9e894d28 rpcrt4: Always protect ref access for connections associated with protseq in RPCRT4_ReleaseConnection.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-08-02 20:20:56 +02:00
Jacek Caban 2cb32b2f3b rpcrt4: Change RPCRT4_ReleaseConnection return type to void.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-06-08 16:44:59 +02:00
Jacek Caban e889b027ef rpcrt4: Fix a race when server grabs a connection from the list of active connections.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-06-08 16:44:59 +02:00
Jacek Caban e98c7a59c2 rpcrt4: Wait for all active connections to be released before quiting server thread.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-31 21:33:39 +02:00
Jacek Caban 10a6b33a93 rpcrt4: Recreate listening pipe in rpcrt4_protseq_np_get_wait_array if needed.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-31 21:33:39 +02:00
Jacek Caban 5c2083fd22 rpcrt4: Store listening pipe name in RpcConnection_np.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-31 21:33:38 +02:00
Jacek Caban 6b53b79e18 rpcrt4: Use HEAP_ZERO_MEMORY to alloc RpcServerProtseq objects.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-24 13:57:52 +02:00
Jacek Caban 28f865b134 rpcrt4: Add close_read implementation for TCP connections.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-24 13:57:47 +02:00
Jacek Caban 29f0b28240 rpcrt4: Add close_read implementation for named pipe connections.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-24 13:57:43 +02:00
Jacek Caban 42ba4d731a rpcrt4: Introduce op for closing connection read end and use it when shutting down server.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-24 13:57:37 +02:00
Jacek Caban ef267f115f rpcrt4: Store all active connections in RpcServerProtseq.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-23 19:25:43 +02:00
Jacek Caban dae30652e6 rpcrt4: Remove connection from list in RPCRT4_ReleaseConnection.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-23 19:25:30 +02:00
Jacek Caban 812897c8ad rpcrt4: Use HEAP_ZERO_MEMORY to alloc RpcConnection objects.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-23 19:25:23 +02:00
Jacek Caban 13d529a749 rpcrt4: Renamed connections list to listeners.
To preserve the name for actual connections.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-23 19:25:19 +02:00
Jacek Caban c953763a4c rpcrt4: Remove no longer needed helpers.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-23 19:25:13 +02:00
Jacek Caban b54833890a rpcrt4: Implement cancel_call for named pipes.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-22 19:11:26 +02:00
Jacek Caban 372c9e0db5 rpcrt4: Cache event handle in RpcConnection_np object.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-22 19:11:26 +02:00
Jacek Caban 6e7a2978e7 rpcrt4: Use non-blocking listening on named pipes.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-22 19:11:26 +02:00
Jacek Caban 4f4ac8c40e rpcrt4: Use named pipe in overlapped mode.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-22 19:11:26 +02:00
Jacek Caban bd6f8071d8 rpcrt4: Simplify rpcrt4_conn_np_read implementation.
Since RPC messages are sent as a single message, if it's too short, it
means the message is broken and we let the caller to handle an error.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-22 19:11:26 +02:00
Jacek Caban f62b9d69ae rpcrt4: Simplify rpcrt4_conn_np_write implementation.
There is no need for the loop. Named pipes always do complete writes.
Also use NtWriteFile like we do for reading to not mess with GetLastError().

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-22 19:11:25 +02:00
Jacek Caban 2035294d0c rpcrt4: Use standard Wine list to store connections in RpcServerProtseq.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-16 18:58:56 +02:00
Jacek Caban e6215938b7 rpcrt4: Always use winsock for networking.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-16 18:58:56 +02:00
Gerald Pfeifer 042b41dd57 rpcrt4: Avoid potential overflow in rpcrt4_protseq_ncacn_np_open_endpoint.
Signed-off-by: Gerald Pfeifer <gerald@pfeifer.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-25 11:24:08 +01:00
Alexandre Julliard 38b57b30fe rpcrt4: Include ntstatus.h before headers that may need it.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-11-03 18:06:45 +01:00
Alexandre Julliard 7b0c2cdbcd rpcrt4: Remove noisy fixme.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-20 16:26:26 -07:00
Christoph von Wittich 01290cdc1f rpcrt4: Implement RpcBindingServerFromClient and populate NetworkAddr for each transport.
Add more thorough testing for this function.

Signed-off-by: Colin Finck <mail@colinfinck.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-19 09:44:01 -07:00
Jacek Caban 2f0de6a1bc rpcrt4: Use NtReadFile in rpcrt4_conn_np_read.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-07 18:08:02 +02:00
Jacek Caban 41f93d8f59 rpcrt4: Added support for binding argument in RpcMgmtIsServerListening.
Based on patch by Andrew Eikum.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-10-28 12:45:01 +09:00
Jacek Caban 6c40b63d3e rpcrt4: Moved formatting pipe names to helper functions.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-10-28 12:45:01 +09:00
Michael Müller ab82b446a0 rpcrt4: Fix arguments of HttpAddRequestHeaders. 2015-06-25 21:01:16 +09:00
Hans Leidekker 0877e4cbb2 rpcrt4: Remove a couple of unused assignments. 2015-05-21 17:53:40 +09:00
Hans Leidekker 852721863a rpcrt4: Use InternetSetCookie to set the session cookie.
This ensures that the cookie is preserved when the server sets an additional cookie.
2015-05-21 17:53:30 +09:00
Marcus Meissner 7b9efb1f45 rpcrt4: Make sure we do not have *data allocated on error (Coverity). 2015-05-21 13:56:47 +09:00
Hans Leidekker f4c5940656 rpcrt4: Allow all HTTP read requests to be cancelled. 2015-05-14 00:06:57 +09:00
Hans Leidekker e34cb91399 rpcrt4: Also set the Content-Length header explicitly on the in pipe request. 2015-05-14 00:06:57 +09:00
Hans Leidekker 9002780015 rpcrt4: Use the Unicode version of InternetReadFileEx. 2015-05-14 00:06:56 +09:00
Hans Leidekker 49a2fb660b rpcrt4: Make sure the Content-Length header is set correctly when preparing the out pipe. 2014-12-19 22:36:17 +01:00
Marcus Meissner 906c341781 rpcrt4: Fixed memory leak on error exit (Coverity). 2014-07-15 15:30:44 +02:00
Bruno Jesus d4278ce0ed rpcrt4: Take care of EINTR on send/recv. 2014-06-12 18:05:03 +02:00
Frédéric Delanoy 44c1ba9f9e rpcrt4: Constify a character string. 2013-12-18 11:39:29 +01:00
Hans Leidekker 057c98323e rpcrt4: Don't try to decode the authorization value in the first leg. 2013-09-11 16:10:05 +02:00