ntoskrnl.exe: Create symbolic links as permanent objects.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
77e74fb1db
commit
088ababfc2
1 changed files with 11 additions and 12 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue