server: Move handle allocation out of open_object_dir.
diff --git a/server/mapping.c b/server/mapping.c
index cf87361..cc81e37 100644
--- a/server/mapping.c
+++ b/server/mapping.c
@@ -402,12 +402,18 @@
{
struct unicode_str name;
struct directory *root = NULL;
+ struct mapping *mapping;
get_req_unicode_str( &name );
if (req->rootdir && !(root = get_directory_obj( current->process, req->rootdir, 0 )))
return;
- reply->handle = open_object_dir( root, &name, req->attributes, &mapping_ops, req->access );
+ if ((mapping = open_object_dir( root, &name, req->attributes, &mapping_ops )))
+ {
+ reply->handle = alloc_handle( current->process, &mapping->obj, req->access,
+ req->attributes & OBJ_INHERIT );
+ release_object( mapping );
+ }
if (root) release_object( root );
}