Compartilhar via


3.1.6.3 File Is Moved from Remote Machine to Local Machine

If a file is moved from a remote machine to the local machine, the following procedure SHOULD<17> be followed:

  • The FileID of the source file MUST be obtained by sending two FSCTL_GET_OBJECT_ID requests for the source file.<18> If either FSCTL_GET_OBJECT_ID request fails, no further processing SHOULD be performed. The source file is not considered to have an ObjectID, and as specified earlier, only files with ObjectIDs are processed.

  • If this step is successful, the VolumeID of the target file's volume MUST be retrieved by sending a request for an instance of the FileFsObjectIdInformation class, as specified in [MS-FSCC] section 2.5.6, and by interpreting the ObjectId field of the returned FILE_FS_OBJECTID_INFORMATION structure as the VolumeID. If the connection to the remote machine is using the [MS-SMB] protocol, this request MUST be sent by specifying FileFsObjectIdInformation as the InformationLevel of a TRANS2_QUERY_FS_INFORMATION request, specified in [MS-SMB] section 2.2.6.3.1. Otherwise, the connection to the remote machine is using the [MS-SMB2] protocol, and this request MUST be sent by specifying FileFsObjectidInformation as the FileInfoClass of an SMB2_QUERY_INFO request, specified in [MS-SMB2] section 2.2.37.<19>

  • If the preceding step is successful, the source machine MUST be notified of the move by sending an FSCTL_LMR_SET_LINK_TRACKING_INFORMATION request ([MS-FSCC] section 2.3.37). In this request, the TargetFileObject data element MUST be zero. In the TARGET_LINK_TRACKING_INFORMATION_Buffer data element ([MS-FSCC] section 2.3.37.3), the Type MUST be zero, the VolumeID field MUST be the VolumeID of the target file, the ObjectID field MUST be the ObjectID of the target file, and the NetBIOSName field MUST be the MachineID of the local machine. For the NetBIOSName field, if the MachineID ends with more than one zero byte, it MUST be truncated such that only one zero byte is included in the value.

  • If that step is successful, the ObjectID and FileID of the source file MUST be deleted by sending an FSCTL_DELETE_OBJECT_ID request ([MS-FSCC] section 2.3.3) for the source file.

  • If that step is successful, the target file MUST have its FileID set to the FileID of the source file, and the CrossVolumeMoveFlag MUST be set to 1.