server: Support opening objects from any root, not only directories.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2016-02-09 20:18:20 +09:00
parent 7ad32cf56a
commit 39e60dc680
2 changed files with 3 additions and 5 deletions

View File

@ -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 );

View File

@ -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 );