From 39e60dc68003813c020c9a29d4e69d2f7a809e52 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 9 Feb 2016 20:18:20 +0900 Subject: [PATCH] server: Support opening objects from any root, not only directories. Signed-off-by: Alexandre Julliard --- dlls/ntdll/tests/om.c | 1 - server/handle.c | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/dlls/ntdll/tests/om.c b/dlls/ntdll/tests/om.c index 3d0487c2f3f..9d0f501847d 100644 --- a/dlls/ntdll/tests/om.c +++ b/dlls/ntdll/tests/om.c @@ -551,7 +551,6 @@ static void test_name_limits(void) status = pNtOpenSymbolicLinkObject( &ret2, GENERIC_ALL, &attr ); ok( status == STATUS_OBJECT_TYPE_MISMATCH, "%u: NtOpenSymbolicLinkObject failed %x\n", str.Length, status ); status = pNtOpenSymbolicLinkObject( &ret2, GENERIC_ALL, &attr3 ); - todo_wine ok( status == STATUS_SUCCESS, "%u: NtOpenSymbolicLinkObject failed %x\n", str.Length, status ); pNtClose( ret2 ); pNtClose( ret ); diff --git a/server/handle.c b/server/handle.c index f440f9fb739..15e5670d452 100644 --- a/server/handle.c +++ b/server/handle.c @@ -578,8 +578,7 @@ obj_handle_t open_object( struct process *process, obj_handle_t parent, unsigned unsigned int attributes ) { obj_handle_t handle = 0; - struct directory *root = NULL; - struct object *obj; + struct object *obj, *root = NULL; if (name->len >= 65534) { @@ -587,9 +586,9 @@ obj_handle_t open_object( struct process *process, obj_handle_t parent, unsigned return 0; } - if (parent && !(root = get_directory_obj( process, parent, 0 ))) return 0; + if (parent && !(root = get_handle_obj( process, parent, 0, NULL ))) return 0; - if ((obj = open_object_dir( root, name, attributes, ops ))) + if ((obj = open_named_object( root, ops, name, attributes ))) { handle = alloc_handle( process, obj, access, attributes ); release_object( obj );