server: Avoid redundant open call when looking for an object type.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2016-02-09 20:21:23 +09:00
parent 6ccefdb7c5
commit eb6621081a
1 changed files with 6 additions and 6 deletions

View File

@ -269,13 +269,13 @@ struct object_type *get_object_type( const struct unicode_str *name )
{ {
struct object_type *type; struct object_type *type;
if ((type = open_object_dir( dir_objtype, name, 0, &object_type_ops ))) if ((type = create_named_object_dir( dir_objtype, name, OBJ_OPENIF, &object_type_ops )))
return type;
if ((type = create_named_object_dir( dir_objtype, name, 0, &object_type_ops )))
{ {
grab_object( type ); if (get_error() != STATUS_OBJECT_NAME_EXISTS)
make_object_static( &type->obj ); {
grab_object( type );
make_object_static( &type->obj );
}
clear_error(); clear_error();
} }
return type; return type;