Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ntoskrnl.exe/ntoskrnl.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index d407cffee69..fa85979d0bf 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -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;