server: Check for STATUS_OBJECT_TYPE_MISMATCH before STATUS_ACCESS_DENIED in get_handle_obj.
This commit is contained in:
parent
872c07a967
commit
bf3c2a06f5
|
@ -403,14 +403,19 @@ struct object *get_handle_obj( struct process *process, obj_handle_t handle,
|
||||||
set_error( STATUS_INVALID_HANDLE );
|
set_error( STATUS_INVALID_HANDLE );
|
||||||
return NULL;
|
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)
|
if ((entry->access & access) != access)
|
||||||
{
|
{
|
||||||
set_error( STATUS_ACCESS_DENIED );
|
set_error( STATUS_ACCESS_DENIED );
|
||||||
return NULL;
|
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 */
|
set_error( STATUS_OBJECT_TYPE_MISMATCH ); /* not the right type */
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in New Issue