Commit 6f2687a3 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

widl: Raise RPC_X_SS_IN_NULL_CONTEXT exception for NULL in-only context handles…

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.
parent 2d18e5aa
......@@ -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)
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment