Commit Graph

1424 Commits

Author SHA1 Message Date
Huw Davies b2667416c2 rpcrt4: Don't free the argument if the freer was called, unless it's a simple ref.
In the simple reference case the freer will not see the top-level
pointer, so we need to free that here.

This fixes a double-free caused by commit 614afcefa3.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-08 20:21:36 +01: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
Alistair Leslie-Hughes a5767fc1f3 rpcrt4/tests: Use standard wine_dbgstr_longlong.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-27 10:46:58 +02:00
Alexandre Julliard aea6d2371d rpcrt4: Mark function that are only called from assembly as hidden.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-25 11:48:54 +02:00
Francois Gouget bea5c0ce2b rpcrt4: Spelling fixes in comments.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-06 18:49:38 +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 18fb5d25f1 rpcrt4/tests: Added more server stopping tests.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-31 21:33:40 +02:00
Jacek Caban 09e98be243 rpcrt4: Wait for server threads to finish in RpcMgmtWaitServerListen.
This fixes races when stopping manual listen RPC servers. It should fix
races in Office applications as well as our services.exe (visible as CS
error on prefix shutdown).

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-31 21:33:40 +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 5c81f8295e rpcrt4: Store server thread handle in RpcServerProtseq.
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
Nikolay Sivov dcdf7d6f6d rpcrt4/tests: Added missing assignment (Coverity).
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-15 11:11:19 +02:00
Jacek Caban 9a6781f8c9 rpcrt4/tests: Added more server listening tests.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-16 15:03:57 +01:00
Jacek Caban d0ed6d1035 rpcrt4: Get rid of manual_listen_count and use binary state instead.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-16 15:03:54 +01:00
André Hentschel b85c2f79c0 rpcrt4: Fix some spec file entries.
Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-27 16:31:43 +01: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
Hans Leidekker b621973c47 rpcrt4/tests: Also register a firewall exception for the rpc test.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-12-08 13:53:09 +01:00
Hans Leidekker dd62188627 rpcrt4/tests: Merge rpc_protseq.c into rpc.c.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-12-08 13:52:59 +01:00
Hans Leidekker 462d348e8d rpcrt4/tests: Register an exception with the firewall to avoid a dialog.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-12-06 15:02:35 +01:00
Jacek Caban c32cd1119c rpcrt4: Acquire new credential handle for each connection.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-11-30 13:23:21 +01:00
Jacek Caban da05dfd151 rpcrt4: Store security package name in rpc_server_registered_auth_info.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-11-30 13:23:19 +01:00
Hans Leidekker f8450fae23 rpcrt4: Handle NULL binding in RpcBindingInqAuthClient{,Ex}.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-11-22 16:31:52 +01:00
Jacek Caban ad77b4c5fd rpcrt4: Initialize all rpc_server_registered_auth_info fields in RpcServerRegisterAuthInfoW.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-11-08 19:01:58 +01:00
Huw Davies eb3ceac1dd rpcrt4/tests: Register the proxies to fix a crash on Windows 8 and 10.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-11-03 19:44:13 +01:00
Huw Davies f4d598ae08 rpcrt4/tests: Extend the tests for NdrDllGetClassObject().
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-11-03 19:44:10 +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
Huw Davies f53c320f04 rpcrt4/tests: Win 8 and 10 do not correctly unmarshal a ranged enum16.
In practice this bug is not observed since midl, unlike widl, does not
generate ranges in inline stub mode.  For interpreted stubs, where
midl does generate ranges, the [out] parameters are zero-initialised
by the runtime.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-09-07 00:34:25 +09:00