https://git.reactos.org/?p=reactos.git;a=commitdiff;h=76ebd0d054b16c9a41f05…
commit 76ebd0d054b16c9a41f0536f197e835f8d766694
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Thu Apr 2 19:55:35 2020 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Fri Apr 3 13:33:03 2020 +0200
[RPCRT4] Handle ERROR_BAD_NETPATH failure if an RPC pipe connection is done on an
non-existing UNC path.
Addendum to 5274857d (see originally commit 13f41d74). CORE-6561
---
dll/win32/rpcrt4/rpc_transport.c | 5 +++++
dll/win32/rpcrt4/rpcrt4_ros.diff | 10 ++++++++++
2 files changed, 15 insertions(+)
diff --git a/dll/win32/rpcrt4/rpc_transport.c b/dll/win32/rpcrt4/rpc_transport.c
index e77cb287be9..88f027d9990 100644
--- a/dll/win32/rpcrt4/rpc_transport.c
+++ b/dll/win32/rpcrt4/rpc_transport.c
@@ -174,6 +174,11 @@ static RPC_STATUS rpcrt4_conn_open_pipe(RpcConnection *Connection,
LPCSTR pname,
}
TRACE("connection failed, error=%x\n", err);
return RPC_S_SERVER_TOO_BUSY;
+#ifdef __REACTOS__
+ } else if (err == ERROR_BAD_NETPATH) {
+ TRACE("connection failed, error=%x\n", err);
+ return RPC_S_SERVER_UNAVAILABLE;
+#endif
}
if (!wait || !WaitNamedPipeA(pname, NMPWAIT_WAIT_FOREVER)) {
err = GetLastError();
diff --git a/dll/win32/rpcrt4/rpcrt4_ros.diff b/dll/win32/rpcrt4/rpcrt4_ros.diff
index c1ae133a864..83aaa1ec610 100644
--- a/dll/win32/rpcrt4/rpcrt4_ros.diff
+++ b/dll/win32/rpcrt4/rpcrt4_ros.diff
@@ -118,6 +118,16 @@ diff -pudN e:\wine\dlls\rpcrt4/rpc_transport.c
e:\reactos\dll\win32\rpcrt4/rpc_t
static RpcConnection *rpcrt4_spawn_connection(RpcConnection *old_connection);
/**** ncacn_np support ****/
+@@ -174,6 +174,9 @@ static RPC_STATUS rpcrt4_conn_open_pipe(RpcConnection *Connection,
LPCSTR pname,
+ }
+ TRACE("connection failed, error=%x\n", err);
+ return RPC_S_SERVER_TOO_BUSY;
++ } else if (err == ERROR_BAD_NETPATH) {
++ TRACE("connection failed, error=%x\n", err);
++ return RPC_S_SERVER_UNAVAILABLE;
+ }
+ if (!wait || !WaitNamedPipeA(pname, NMPWAIT_WAIT_FOREVER)) {
+ err = GetLastError();
@@ -237,14 +258,24 @@ static RPC_STATUS rpcrt4_protseq_ncalrpc
return r;
}