server: Avoid redundant open call when looking for an object type.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
6ccefdb7c5
commit
eb6621081a
|
@ -269,13 +269,13 @@ struct object_type *get_object_type( const struct unicode_str *name )
|
|||
{
|
||||
struct object_type *type;
|
||||
|
||||
if ((type = open_object_dir( dir_objtype, name, 0, &object_type_ops )))
|
||||
return type;
|
||||
|
||||
if ((type = create_named_object_dir( dir_objtype, name, 0, &object_type_ops )))
|
||||
if ((type = create_named_object_dir( dir_objtype, name, OBJ_OPENIF, &object_type_ops )))
|
||||
{
|
||||
if (get_error() != STATUS_OBJECT_NAME_EXISTS)
|
||||
{
|
||||
grab_object( type );
|
||||
make_object_static( &type->obj );
|
||||
}
|
||||
clear_error();
|
||||
}
|
||||
return type;
|
||||
|
|
Loading…
Reference in New Issue