Commit 088ababf authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

ntoskrnl.exe: Create symbolic links as permanent objects.

parent 77e74fb1
......@@ -1591,17 +1591,19 @@ NTSTATUS WINAPI IoCreateSymbolicLink( UNICODE_STRING *name, UNICODE_STRING *targ
{
HANDLE handle;
OBJECT_ATTRIBUTES attr;
NTSTATUS ret;
attr.Length = sizeof(attr);
attr.RootDirectory = 0;
attr.ObjectName = name;
attr.Attributes = OBJ_CASE_INSENSITIVE | OBJ_OPENIF;
attr.Attributes = OBJ_CASE_INSENSITIVE | OBJ_OPENIF | OBJ_PERMANENT;
attr.SecurityDescriptor = NULL;
attr.SecurityQualityOfService = NULL;
TRACE( "%s -> %s\n", debugstr_us(name), debugstr_us(target) );
/* FIXME: store handle somewhere */
return NtCreateSymbolicLinkObject( &handle, SYMBOLIC_LINK_ALL_ACCESS, &attr, target );
if (!(ret = NtCreateSymbolicLinkObject( &handle, SYMBOLIC_LINK_ALL_ACCESS, &attr, target )))
NtClose( handle );
return ret;
}
......@@ -1612,17 +1614,19 @@ NTSTATUS WINAPI IoCreateUnprotectedSymbolicLink( UNICODE_STRING *name, UNICODE_S
{
HANDLE handle;
OBJECT_ATTRIBUTES attr;
NTSTATUS ret;
attr.Length = sizeof(attr);
attr.RootDirectory = 0;
attr.ObjectName = name;
attr.Attributes = OBJ_CASE_INSENSITIVE | OBJ_OPENIF;
attr.Attributes = OBJ_CASE_INSENSITIVE | OBJ_OPENIF | OBJ_PERMANENT;
attr.SecurityDescriptor = NULL;
attr.SecurityQualityOfService = NULL;
TRACE( "%s -> %s\n", debugstr_us(name), debugstr_us(target) );
/* FIXME: store handle somewhere */
return NtCreateSymbolicLinkObject( &handle, SYMBOLIC_LINK_ALL_ACCESS, &attr, target );
if (!(ret = NtCreateSymbolicLinkObject( &handle, SYMBOLIC_LINK_ALL_ACCESS, &attr, target )))
NtClose( handle );
return ret;
}
......@@ -1644,12 +1648,7 @@ NTSTATUS WINAPI IoDeleteSymbolicLink( UNICODE_STRING *name )
if (!(status = NtOpenSymbolicLinkObject( &handle, 0, &attr )))
{
SERVER_START_REQ( unlink_object )
{
req->handle = wine_server_obj_handle( handle );
status = wine_server_call( req );
}
SERVER_END_REQ;
NtMakeTemporaryObject( handle );
NtClose( handle );
}
return status;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment