From 444307610ee6896c2c73c93a981f09a6d8064015 Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Wed, 4 Nov 2009 09:10:50 +0100 Subject: [PATCH] rpcrt4: Add a test for the ncalrpc protocol sequence. --- dlls/rpcrt4/tests/server.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/dlls/rpcrt4/tests/server.c b/dlls/rpcrt4/tests/server.c index 34ef797e2cb..63614e3d4ff 100644 --- a/dlls/rpcrt4/tests/server.c +++ b/dlls/rpcrt4/tests/server.c @@ -1291,6 +1291,20 @@ client(const char *test) ok(RPC_S_OK == RpcStringFree(&binding), "RpcStringFree\n"); ok(RPC_S_OK == RpcBindingFree(&IServer_IfHandle), "RpcBindingFree\n"); } + else if (strcmp(test, "ncalrpc_basic") == 0) + { + static unsigned char ncalrpc[] = "ncalrpc"; + static unsigned char guid[] = "00000000-4114-0704-2301-000000000000"; + unsigned char *binding; + + ok(RPC_S_OK == RpcStringBindingCompose(NULL, ncalrpc, NULL, guid, NULL, &binding), "RpcStringBindingCompose\n"); + ok(RPC_S_OK == RpcBindingFromStringBinding(binding, &IServer_IfHandle), "RpcBindingFromStringBinding\n"); + + run_tests(); + + ok(RPC_S_OK == RpcStringFree(&binding), "RpcStringFree\n"); + ok(RPC_S_OK == RpcBindingFree(&IServer_IfHandle), "RpcBindingFree\n"); + } else if (strcmp(test, "np_basic") == 0) { static unsigned char np[] = "ncacn_np"; @@ -1316,11 +1330,17 @@ server(void) static unsigned char port[] = PORT; static unsigned char np[] = "ncacn_np"; static unsigned char pipe[] = PIPE; - RPC_STATUS status, iptcp_status, np_status; + static unsigned char ncalrpc[] = "ncalrpc"; + static unsigned char guid[] = "00000000-4114-0704-2301-000000000000"; + RPC_STATUS status, iptcp_status, np_status, ncalrpc_status; DWORD ret; iptcp_status = RpcServerUseProtseqEp(iptcp, 20, port, NULL); ok(iptcp_status == RPC_S_OK, "RpcServerUseProtseqEp(ncacn_ip_tcp) failed with status %d\n", iptcp_status); + + ncalrpc_status = RpcServerUseProtseqEp(ncalrpc, 0, guid, NULL); + ok(ncalrpc_status == RPC_S_OK, "RpcServerUseProtseqEp(ncalrpc) failed with status %d\n", ncalrpc_status); + np_status = RpcServerUseProtseqEp(np, 0, pipe, NULL); if (np_status == RPC_S_PROTSEQ_NOT_SUPPORTED) skip("Protocol sequence ncacn_np is not supported\n"); @@ -1347,6 +1367,11 @@ server(void) else skip("tcp_basic tests skipped due to earlier failure\n"); + if (ncalrpc_status == RPC_S_OK) + run_client("ncalrpc_basic"); + else + skip("ncalrpc_basic tests skipped due to earlier failure\n"); + if (np_status == RPC_S_OK) run_client("np_basic"); else