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:
parent
2d18e5aac4
commit
6f2687a389
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue