[PATCH 2/2] rpcrt4: Add a test for RpcBindingServerFromClient (todo_wine).

Colin Finck mail at colinfinck.de
Thu Aug 18 12:45:37 CDT 2016


Signed-off-by: Colin Finck <mail at colinfinck.de>
---
 dlls/rpcrt4/tests/server.c | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/dlls/rpcrt4/tests/server.c b/dlls/rpcrt4/tests/server.c
index 0b31d3d..972b164 100644
--- a/dlls/rpcrt4/tests/server.c
+++ b/dlls/rpcrt4/tests/server.c
@@ -744,6 +744,40 @@ void __cdecl s_context_handle_test(void)
 
         pNDRSContextUnmarshall2(binding, buf, NDR_LOCAL_DATA_REPRESENTATION, &server_if2.InterfaceId, 0);
     }
+
+    /* test RpcBindingServerFromClient */
+    /* skip this on older Windows versions, the NULL parameter is only supported in Windows 2000 and later */
+    if (!old_windows_version)
+    {
+        binding = NULL;
+        status = RpcBindingServerFromClient(NULL, &binding);
+
+        todo_wine
+        {
+            ok(status == RPC_S_OK, "expected RPC_S_OK got %u\n", status);
+            ok(binding != NULL, "binding is NULL\n");
+        }
+
+        if (status == RPC_S_OK && binding)
+        {
+            unsigned char* computer_name;
+            unsigned char* string_binding;
+
+            status = RpcBindingToStringBindingA(binding, &string_binding);
+            ok(status == RPC_S_OK, "expected RPC_S_OK got %u\n", status);
+
+            memset(computer_name, 0, sizeof(computer_name));
+            status = RpcStringBindingParseA(string_binding, NULL, NULL, &computer_name, NULL, NULL);
+            ok(status == RPC_S_OK, "expected RPC_S_OK got %u\n", status);
+            ok(*computer_name, "computer_name is NULL\n");
+
+            RpcStringFreeA(&string_binding);
+        }
+        else
+        {
+            skip("RpcBindingToStringBindingA and RpcStringBindingParseA tests skipped due to RpcBindingServerFromClient failure.\n");
+        }
+    }
 }
 
 void __cdecl s_get_numbers(int length, int size, pints_t n[])
-- 
1.9.1




More information about the wine-patches mailing list