Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

2.1.5.14.6 FileLinkInformation

InputBuffer is of type FILE_LINK_INFORMATION, as described in [MS-FSCC] section 2.4.21.<126>

Open represents the pre-existing file to which a new link named in InputBuffer.FileName will be created.

Pseudocode for the operation is as follows:

  • If Open.Stream.StreamType is DataStream and Open.Stream.Name is not empty, the operation MUST be failed with STATUS_INVALID_PARAMETER.

  • If Open.File.FileType is DirectoryFile, the operation MUST be failed with STATUS_FILE_IS_A_DIRECTORY.

  • If Open.Link.IsDeleted is TRUE, the operation MUST be failed with STATUS_ACCESS_DENIED.

  • If InputBuffer.FileName is not valid as specified in [MS-FSCC] section 2.1.5, the operation MUST be failed with STATUS_OBJECT_NAME_INVALID.

  • If Open.File.LinkList has 1024 or more entries, the operation SHOULD be failed with STATUS_TOO_MANY_LINKS.

  • Split InputBuffer.FileName into PathName and FileName, as per section 2.1.5.1.

  • Open DestinationDirectory from PathName, as per section 2.1.5.1. If the open fails for any reason, the object store MUST fail the request with that error. This request requires that the caller has FILE_ADD_FILE access on the DestinationDirectory -- if not, the store MUST fail with STATUS_ACCESS_DENIED.

  • Search DestinationDirectory.File.DirectoryList for an ExistingLink where ExistingLink.Name or ExistingLink.ShortName matches FileName using case-sensitivity according to Open.IsCaseInsensitive. If such a link is found:

    • If InputBuffer.ReplaceIfExists is TRUE:

      • Set ReplacedLinkName = DestinationDirectory.FileName + FileName.

      • Remove ExistingLink from ExistingLink.File.LinkList.

      • Remove ExistingLink from DestinationDirectory.File.DirectoryList.

      • Set DeletedLink to TRUE.

    • Else:

      • The operation MUST be failed with STATUS_OBJECT_NAME_COLLISION.

    • EndIf

  • EndIf

  • The object store MUST build a new Link object NewLink with fields initialized as follows:

    • NewLink.Name set to FileName.

    • NewLink.File set to Open.File.

    • NewLink.ParentFile set to DestinationDirectory.File.

    • All other fields set to zero.

  • The object store MUST insert NewLink into Open.File.LinkList

  • The object store MUST insert NewLink into DestinationDirectory.File.DirectoryList.

  • The object store MUST update DestinationDirectory.File.LastModifiedTime, DestinationDirectory.File.LastAccessedTime, and DestinationDirectory.File.LastChangeTime.

  • If the Oplock member of the DirectoryStream in DestinationDirectory.File.StreamList (hereinafter referred to as ParentOplock) is not empty, the object store MUST check for an oplock break on the parent according to the algorithm in section 2.1.4.12, with input values as follows:

    • Open equal to this operation's Open

    • Oplock equal to ParentOplock

    • Operation equal to "SET_INFORMATION"

    • OpParams containing a member FileInformationClass containing FileLinkInformation

    • Flags equal to "PARENT_OBJECT"

  • If Open.UserSetChangeTime is FALSE, the object store MUST update Open.File.LastChangeTime to the current time.

  • The object store MUST set Open.File.FileAttributes.FILE_ATTRIBUTE_ARCHIVE.

  • If DeletedLink is TRUE:

    • If ReplacedLinkName equals InputBuffer.FileName in a case-sensitive comparison:

      • // In this case, the link name has not changed, but the file it refers to has changed.

      • Action = FILE_ACTION_MODIFIED

      • FilterMatch = FILE_NOTIFY_CHANGE_ATTRIBUTES | FILE_NOTIFY_CHANGE_SIZE | FILE_NOTIFY_CHANGE_LAST_WRITE | FILE_NOTIFY_CHANGE_LAST_ACCESS | FILE_NOTIFY_CHANGE_CREATION | FILE_NOTIFY_CHANGE_SECURITY | FILE_NOTIFY_CHANGE_EA

      • Send directory change notification as per section 2.1.4.1, with Volume equal to File.Volume, Action equal to Action, FilterMatch equal to FilterMatch, and FileName equal to InputBuffer.FileName.

    • Else

      • // In this case, the implementer replaced a link, but the new link created differs only in case.

      • Action = FILE_ACTION_REMOVED

      • FilterMatch = FILE_NOTIFY_CHANGE_FILE_NAME

      • Send directory change notification as per section 2.1.4.1, with Volume equal to File.Volume, Action equal to Action, FilterMatch equal to FilterMatch, and FileName equal to InputBuffer.FileName.

      • Action = FILE_ACTION_ADDED

      • FilterMatch = FILE_NOTIFY_CHANGE_FILE_NAME

      • Send directory change notification as per section 2.1.4.1, with Volume equal to File.Volume, Action equal to Action, FilterMatch equal to FilterMatch, and FileName equal to InputBuffer.FileName.

    • EndIf

  • Else

    • // If the implementer did not delete a link, all that needs to be done is to notify that a new link was created.

    • Action = FILE_ACTION_ADDED

    • FilterMatch = FILE_NOTIFY_CHANGE_FILE_NAME

    • Send directory change notification as per section 2.1.4.1, with Volume equal to File.Volume, Action equal to Action, FilterMatch equal to FilterMatch, and FileName equal to InputBuffer.FileName.

  • EndIf

  • The operation returns STATUS_SUCCESS.

Show:
© 2015 Microsoft