Rob Shearman : widl: Raise RPC_X_SS_IN_NULL_CONTEXT exception for NULL in-only context handles instead of RPC_X_NULL_REF_PTR .

Alexandre Julliard julliard at winehq.org
Wed Aug 27 08:23:58 CDT 2008


Module: wine
Branch: master
Commit: 6f2687a389861fbedbbb8c8e3b3c376aef1e3676
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6f2687a389861fbedbbb8c8e3b3c376aef1e3676

Author: Rob Shearman <robertshearman at gmail.com>
Date:   Tue Aug 26 20:05:17 2008 +0100

widl: Raise RPC_X_SS_IN_NULL_CONTEXT exception for NULL in-only context handles instead of RPC_X_NULL_REF_PTR.

Based on a patch by Michael Martin.

---

 tools/widl/client.c |    8 ++++++++
 tools/widl/proxy.c  |    5 +++++
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/tools/widl/client.c b/tools/widl/client.c
index 779492e..6f148c1 100644
--- a/tools/widl/client.c
+++ b/tools/widl/client.c
@@ -188,6 +188,14 @@ static void write_function_stubs(type_t *iface, unsigned int *proc_offset)
             indent++;
             print_client("_Handle = NDRCContextBinding(%s%s);\n", is_ch_ptr ? "*" : "", context_handle_var->name);
             indent--;
+            if (is_attr(context_handle_var->attrs, ATTR_IN) &&
+                !is_attr(context_handle_var->attrs, ATTR_OUT))
+            {
+                print_client("else\n");
+                indent++;
+                print_client("RpcRaiseException(RPC_X_SS_IN_NULL_CONTEXT);\n");
+                indent--;
+            }
             fprintf(client, "\n");
         }
         else if (implicit_handle)
diff --git a/tools/widl/proxy.c b/tools/widl/proxy.c
index 60ee3c0..c5c79c3 100644
--- a/tools/widl/proxy.c
+++ b/tools/widl/proxy.c
@@ -199,6 +199,11 @@ int cant_be_null(const var_t *v)
   const attr_list_t *attrs = v->attrs;
   const type_t *type = v->type;
 
+  /* context handles have their own checking so they can be null for the
+   * purposes of null ref pointer checking */
+  if (is_aliaschain_attr(type, ATTR_CONTEXTHANDLE))
+      return 0;
+
   if (! attrs && type)
   {
     attrs = type->attrs;




More information about the wine-cvs mailing list