server: Check for STATUS_OBJECT_TYPE_MISMATCH before STATUS_ACCESS_DENIED in get_handle_obj.

This commit is contained in:
Bernhard Loos 2011-07-19 13:20:39 +02:00 committed by Alexandre Julliard
parent 872c07a967
commit bf3c2a06f5
1 changed files with 7 additions and 2 deletions

View File

@ -403,14 +403,19 @@ struct object *get_handle_obj( struct process *process, obj_handle_t handle,
set_error( STATUS_INVALID_HANDLE );
return NULL;
}
obj = entry->ptr;
if (ops && (obj->ops != ops))
{
set_error( STATUS_OBJECT_TYPE_MISMATCH ); /* not the right type */
return NULL;
}
if ((entry->access & access) != access)
{
set_error( STATUS_ACCESS_DENIED );
return NULL;
}
obj = entry->ptr;
}
if (ops && (obj->ops != ops))
else if (ops && (obj->ops != ops))
{
set_error( STATUS_OBJECT_TYPE_MISMATCH ); /* not the right type */
return NULL;