Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/rpcrt4/tests/server.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
diff --git a/dlls/rpcrt4/tests/server.c b/dlls/rpcrt4/tests/server.c index 5278a1d..5a61181 100644 --- a/dlls/rpcrt4/tests/server.c +++ b/dlls/rpcrt4/tests/server.c @@ -1680,6 +1680,19 @@ client(const char *test) ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n"); ok(RPC_S_OK == RpcBindingFree(&IServer_IfHandle), "RpcBindingFree\n"); } + else if (strcmp(test, "ncalrpc_autolisten") == 0) + { + ok(RPC_S_OK == RpcStringBindingComposeA(NULL, ncalrpc, NULL, guid, NULL, &binding), "RpcStringBindingCompose\n"); + ok(RPC_S_OK == RpcBindingFromStringBindingA(binding, &IServer_IfHandle), "RpcBindingFromStringBinding\n"); + + run_tests(); + authinfo_test(RPC_PROTSEQ_LRPC, 0); +todo_wine + test_is_server_listening(IServer_IfHandle, RPC_S_NOT_LISTENING); + + ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n"); + ok(RPC_S_OK == RpcBindingFree(&IServer_IfHandle), "RpcBindingFree\n"); + } else if (strcmp(test, "ncalrpc_secure") == 0) { ok(RPC_S_OK == RpcStringBindingComposeA(NULL, ncalrpc, NULL, guid, NULL, &binding), "RpcStringBindingCompose\n"); @@ -1790,6 +1803,19 @@ server(void) CloseHandle(stop_event); stop_event = NULL;
+ if (pRpcServerRegisterIfEx) + { + status = pRpcServerRegisterIfEx(s_IServer_v0_0_s_ifspec, NULL, NULL, + RPC_IF_ALLOW_CALLBACKS_WITH_NO_AUTH | RPC_IF_AUTOLISTEN, + RPC_C_LISTEN_MAX_CALLS_DEFAULT, NULL); + ok(status == RPC_S_OK, "RpcServerRegisterIf() failed: %u\n", status); + + run_client("ncalrpc_autolisten"); + + status = RpcServerUnregisterIf(s_IServer_v0_0_s_ifspec, NULL, TRUE); + ok(status == RPC_S_OK, "RpcServerUnregisterIf() failed: %u\n", status); + } + CoUninitialize(); }
Fixes https://bugs.winehq.org/show_bug.cgi?id=45134.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/rpcrt4/rpc_server.c | 3 ++- dlls/rpcrt4/tests/server.c | 11 +++++++++++ dlls/rpcrt4/tests/server.idl | 1 + 3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/dlls/rpcrt4/rpc_server.c b/dlls/rpcrt4/rpc_server.c index d1b5d64..91de3b9 100644 --- a/dlls/rpcrt4/rpc_server.c +++ b/dlls/rpcrt4/rpc_server.c @@ -1220,7 +1220,8 @@ RPC_STATUS WINAPI RpcServerUnregisterIf( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid
EnterCriticalSection(&server_cs); LIST_FOR_EACH_ENTRY(cif, &server_interfaces, RpcServerInterface, entry) { - if ((!IfSpec || !memcmp(&If->InterfaceId, &cif->If->InterfaceId, sizeof(RPC_SYNTAX_IDENTIFIER))) && + if (((!IfSpec && !(cif->Flags & RPC_IF_AUTOLISTEN)) || + (IfSpec && !memcmp(&If->InterfaceId, &cif->If->InterfaceId, sizeof(RPC_SYNTAX_IDENTIFIER)))) && UuidEqual(MgrTypeUuid, &cif->MgrTypeUuid, &status)) { list_remove(&cif->entry); TRACE("unregistering cif %p\n", cif); diff --git a/dlls/rpcrt4/tests/server.c b/dlls/rpcrt4/tests/server.c index 5a61181..dfad1ed 100644 --- a/dlls/rpcrt4/tests/server.c +++ b/dlls/rpcrt4/tests/server.c @@ -844,6 +844,14 @@ void __cdecl s_stop(void) } }
+void __cdecl s_stop_autolisten(void) +{ + RPC_STATUS status; + status = RpcServerUnregisterIf(NULL, NULL, FALSE); +todo_wine + ok(status == RPC_S_UNKNOWN_MGR_TYPE, "got %u\n", status); +} + void __cdecl s_ip_test(ipu_t *a) { STATSTG st; @@ -1690,6 +1698,9 @@ client(const char *test) todo_wine test_is_server_listening(IServer_IfHandle, RPC_S_NOT_LISTENING);
+ stop_autolisten(); + ok(int_return() == INT_CODE, "RPC int_return\n"); + ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n"); ok(RPC_S_OK == RpcBindingFree(&IServer_IfHandle), "RpcBindingFree\n"); } diff --git a/dlls/rpcrt4/tests/server.idl b/dlls/rpcrt4/tests/server.idl index 75d78f7..6aa7382 100644 --- a/dlls/rpcrt4/tests/server.idl +++ b/dlls/rpcrt4/tests/server.idl @@ -385,6 +385,7 @@ cpp_quote("#endif") void authinfo_test(unsigned int protseq, int secure);
void stop(void); + void stop_autolisten(void);
typedef union ipu switch(int t) {