Fixed bugs in NtQuerySymbolicLinkObject():

- fixed returned length and status

svn path=/trunk/; revision=5966
This commit is contained in:
Eric Kohl 2003-09-03 15:12:16 +00:00
parent 1aace81264
commit c9313c9b83

View file

@ -1,4 +1,4 @@
/* $Id: symlink.c,v 1.2 2003/06/07 12:23:14 chorns Exp $
/* $Id: symlink.c,v 1.3 2003/09/03 15:12:16 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -323,18 +323,28 @@ NtQuerySymbolicLinkObject(IN HANDLE LinkHandle,
NULL);
if (!NT_SUCCESS(Status))
{
return(Status);
return Status;
}
RtlCopyUnicodeString(LinkTarget,
SymlinkObject->Target.ObjectName);
if (ReturnedLength != NULL)
{
*ReturnedLength = SymlinkObject->Target.Length;
*ReturnedLength = (ULONG)SymlinkObject->TargetName.Length + sizeof(WCHAR);
}
if (LinkTarget->MaximumLength >= SymlinkObject->TargetName.Length + sizeof(WCHAR))
{
RtlCopyUnicodeString(LinkTarget,
&SymlinkObject->TargetName);
Status = STATUS_SUCCESS;
}
else
{
Status = STATUS_BUFFER_TOO_SMALL;
}
ObDereferenceObject(SymlinkObject);
return(STATUS_SUCCESS);
return Status;
}
/* EOF */