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.
This commit is contained in:
Rob Shearman 2008-08-26 20:05:17 +01:00 committed by Alexandre Julliard
parent 2d18e5aac4
commit 6f2687a389
2 changed files with 13 additions and 0 deletions

View File

@ -188,6 +188,14 @@ static void write_function_stubs(type_t *iface, unsigned int *proc_offset)
indent++; indent++;
print_client("_Handle = NDRCContextBinding(%s%s);\n", is_ch_ptr ? "*" : "", context_handle_var->name); print_client("_Handle = NDRCContextBinding(%s%s);\n", is_ch_ptr ? "*" : "", context_handle_var->name);
indent--; 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"); fprintf(client, "\n");
} }
else if (implicit_handle) else if (implicit_handle)

View File

@ -199,6 +199,11 @@ int cant_be_null(const var_t *v)
const attr_list_t *attrs = v->attrs; const attr_list_t *attrs = v->attrs;
const type_t *type = v->type; 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) if (! attrs && type)
{ {
attrs = type->attrs; attrs = type->attrs;