Rob Shearman : rpcrt4: Fix context handle test on Vista upwards.
Alexandre Julliard
julliard at winehq.org
Tue Apr 7 09:04:39 CDT 2009
Module: wine
Branch: master
Commit: b2a5bfdfc91b2ddf58195af0a65673f02953cb47
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b2a5bfdfc91b2ddf58195af0a65673f02953cb47
Author: Rob Shearman <robertshearman at gmail.com>
Date: Tue Apr 7 12:27:13 2009 +0100
rpcrt4: Fix context handle test on Vista upwards.
Don't run tests that results in an ERROR_INVALID_HANDLE exception being raised.
Check for the context handle function pointers being non-NULL to
prevent exceptions being raised on platforms without these functions.
---
dlls/rpcrt4/tests/server.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/dlls/rpcrt4/tests/server.c b/dlls/rpcrt4/tests/server.c
index efa64eb..18cfa59 100644
--- a/dlls/rpcrt4/tests/server.c
+++ b/dlls/rpcrt4/tests/server.c
@@ -591,6 +591,12 @@ s_context_handle_test(void)
binding = I_RpcGetCurrentCallHandle();
ok(binding != NULL, "I_RpcGetCurrentCallHandle returned NULL\n");
+ if (!pNDRSContextMarshall2 || !pNDRSContextUnmarshall2)
+ {
+ win_skip("NDRSContextMarshall2 or NDRSContextUnmarshall2 not exported from rpcrt4.dll\n");
+ return;
+ }
+
h = pNDRSContextUnmarshall2(binding, NULL, NDR_LOCAL_DATA_REPRESENTATION, NULL, 0);
ok(h != NULL, "NDRSContextUnmarshall2 returned NULL\n");
@@ -614,6 +620,9 @@ s_context_handle_test(void)
ok(h != NULL, "NDRSContextUnmarshall2 returned NULL\n");
ok(h->userContext == (void *)0xdeadbeef, "userContext of interface didn't unmarshal properly: %p\n", h->userContext);
+ /* raises ERROR_INVALID_HANDLE exception on Vista upwards */
+ if (0)
+ {
/* marshal a context handle with an interface specified */
h = pNDRSContextUnmarshall2(binding, NULL, NDR_LOCAL_DATA_REPRESENTATION, &server_if.InterfaceId, 0);
ok(h != NULL, "NDRSContextUnmarshall2 returned NULL\n");
@@ -627,6 +636,7 @@ s_context_handle_test(void)
h = pNDRSContextUnmarshall2(binding, buf, NDR_LOCAL_DATA_REPRESENTATION, &server_if.InterfaceId, 0);
ok(h != NULL, "NDRSContextUnmarshall2 returned NULL\n");
ok(h->userContext == (void *)0xcafebabe, "userContext of interface didn't unmarshal properly: %p\n", h->userContext);
+ }
/* test same interface data, but different pointer */
/* raises ERROR_INVALID_HANDLE exception */
More information about the wine-cvs
mailing list